I have the following problem: I want to merge salesInvoice reports in 1 report containing all invoices.
I'm using a job that prints reports with printJobSettings, Args and reportRun classes. My parm is a ledgerJournal num and I want to print all relative invoices in one report not printing each invoice separately.
How can I do to generate only one report?
Basically, I take my JournalNum from LedgerJournalTrans Table, I loop on CustInvoiceJour table to have all relative invoices and execute report, I think I should override fetch method to do this, but fetch method on salesInvoice report is quiet heavy and I don't want to loose information.
You can call the
printJournal
method of theCustInvoiceJour
table. As the second argument give it aRecordSortedList
of the invoices you want to print.You will also need a
SalesFormLetter
object as the first argument, populated with relevantprintJobSettings
.You will most likely have to change the
fetch
method as theelement.reset()
call finalizes the report as a print job. This no good if the output is going to a PDF or mail.Most likely you can change
element.reset
to:This will make a page break and reset the page counter. One caveat:
pageTotal
method will not be reset, so "Page 1 of 7" will not work.