Printing with sorted output

Discussion forum about all things Report Builder (all versions).
hassler.w

Printing with sorted output

Post by hassler.w » 16 Nov 2011, 11:03

hi,
need an example how to set sorted output on a printer using SAL.

e.g. Print some document with 3 copies
option 1 : page 1 - 3copies, page 2 - 3copies, page 3 - 3copies
option 2 : page 1, page 2, page 3 .... page1, page 2, page 3 .... page1, page2, page3

"solution" is renamed to "option" ;)

thx
werner
Last edited by hassler.w on 17 Nov 2011, 08:22, edited 3 times in total.

Jeff Luther

Re: Printing with sorted output

Post by Jeff Luther » 16 Nov 2011, 18:33

Which one is the 'solution' ? Which of those solutions you show is how your multiple reports are being printed now? Your current/default printing I would think has to be 1 of those 2 ways.
solution 2: page 1, page 2, page 3 .... page1, page 2, page 3 .... page1, page2, page3
For this solution, I simply print out the report one at a time, in a loop, with SalReportPrint() nCopies = 1. Here's a little code I've used:

Code: Select all

Set nCopy = 1
While nCopy <= nCopies
   If NOT SalReportPrint( ... )
      Call SalMessageBox( 'Report Print error #' || 
               SalNumberToStrX( nRptError, 0 ),
               '', MB_IconStop )
      Return FALSE
   Call SalPause( 500 )   ! 1/2 second pause between reports...
   Set nCopy = nCopy+1
and I see I've trapped SAM_ReportFinish and have a Return TRUE in it.

hassler.w

Re: Printing with sorted output

Post by hassler.w » 17 Nov 2011, 08:19

Hi Jeff,

thanks for your advice.
Sorry, but "solution" wasn't the right word. What i mean is a solution for "option 1" or "option 2". Also it would be nice to use something like "SalReportPrint" and setting the sort. Using the "copy" - option in SalReportPrint is also useful because of printing lots of pages (e.g. 20..50) so it is saved to the printer-RAM and prints very fast.

Jeff Luther

Re: Printing with sorted output

Post by Jeff Luther » 18 Nov 2011, 20:38

it would be nice to use something like "SalReportPrint" and setting the sort.
Just to clarify: What you mean by 'sort' refers to how your printer prints out 2 copies of a 3-page report, either:
A) 1,1; 2,2 3,3
or
B) 1,2,3 ; 1,2,3

That isn't and wouldn't be a ReportPrint feature. That's a feature of how your printer is set up or configured. That might be an enhancement to SalPrtSetParmDefaults() or SalPrtSetParmNum(), perhaps.

I never did get my question answered by you, though: Which printing method is the default it prints out now? A or B above?
As I wrote earlier, I provided you a way to bring like B, if that's of interest to you.

hassler.w

Re: Printing with sorted output

Post by hassler.w » 23 Nov 2011, 08:09

hi jeff,

the idea was (like in crystall reports) to set any print parameter to do the sort.

unfortunatly "the sort" depends on the printer driver and customers like to decide it.

cheers

werner

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 1 guest