merrymonk has asked for the wisdom of the Perl Monks concerning the following question:

I am writing a spreadsheet that has a variable number of columns. The columns widths vary and even when it is the same type of data the width can vary from case to case
The general layout of the spreadsheet is some header rows and then some body rows.
It is in the body row section that the number of column varies.
Sometimes the columns in the body rows require two pages to be printed.
Is there any way I can tell when two pages are required? If so how can I find out which is the first column on the 2nd page?
  • Comment on Finding columns on multipage spreadsheets

Replies are listed 'Best First'.
Re: Finding columns on multipage spreadsheets
by roboticus (Chancellor) on Jul 06, 2010 at 16:32 UTC

    merrymonk:

    You've been here long enough to know how to format a post! ;^)

    Anyway, to answer your question: Using Spreadsheet::WriteExcel, I don't believe it's possible. After all, you don't know anything about the printer: Paper size, orientation, scale are all unknown to the program. That's enough to be a problem.

    Using Win32::OLE you might be able to do it by forcing a print preview and then querying the data structures, but that sounds like a bit more effort than I'd consider.

    ...roboticus

    Update: Inserted missing word in sentence (in bold).

      I cannot help but agree about the format of the post.
      An aberation for which I hope I can be forgiven.
      It looks like some hardwork as a penance since I am not using Spreadsheet::WriteExcel
      (that is unless some other Monk has more ideas!)

        merrymonk:

        Gah! I missed a word in my reply (updated above). Sorry about that. I don't believe it's possible in Spreadsheet::WriteExcel.

        ...roboticus