[Tutor] interface with libreoffice calc spreadsheet to export pdf reports

Jim Smith Sr. jim7fl at ideas4you.com
Wed Sep 19 17:56:34 CEST 2012


I have a spreadsheet with a named range "pdfReport" to export
to pdf in the default location.  The data changed based on student
number input to another named range "_pid".

Assumptions:  the spreadsheet is already open and on the correct
sheet.  This doesn't matter, as we will be selecting the cell and the
print range anyway.

So I need to do something similar to:

howmany = 16                  # number of students to process

for c from 1 to howmany  # begin loop

    select _pid
    typein c  and press enter  # this changes the data in the report
    select _filename                # this is a cell which has a new
filename for each report
    copy cell                            # this gives me the filename to
paste later
    select pdfReport                # select the range to export

    # the menu choices are  File>Export as PDF>
    # then the next dialog box gives choices but the only
    # choice I want is in General (default tab)
    # Range has All selected, I want Selection selected
    # then Export or Enter pressed
    #This is followed by a prompt for file name
    Paste filename from above
    Export

next c

ideally, my first task would be to copy a cell or pass a variable
containing the number "howmany"
so this would work for any of my classes.

Thanks in advance for getting me started with this.  I'm in the process
of learning python from
the excellent tutorial at Learn Pyton the Hard Way
<http://learnpythonthehardway.org/book/ex0.html>   Although, it is not
really the hard way, but rather
quite simple but time consuming for someone unfamiliar with Python and
the UNO Basic dispatch of
both OpenOffice and LibreOffice.

Best Regards,
Jim



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120919/eec7a219/attachment-0001.html>


More information about the Tutor mailing list