Splitting Report Output

We have a report that gathers up Invoices and Cr Memos by customer and prints them together for mailing. We want to print to a PDF file, which, through the use of an OCX, works fine. However, we’d like to split the print jobs to get a separate file per Customer record, rather than one file. Any ideas? Thanks, Mike

Create a function based on a customer variable and that just use that function to set a filter per each customer and then launch the report for each of them filtered by customer (1 customer on the report). Something like: var rcustomer : record [ customer]; rReport : report [ myreport]; IF (Rcustomer.FIND(’-’)) THEN REPEAT rCustomer.SETRANGE(“No.”,rCustomer.“No.”); CLEAR (rReport); rReport.SETTABLEVIEW(rCustomer); rReport.RUNMODAL; RCustomer.SETRANGE(“No.”); UNTIL (rCustomer.NEXT = 0); Regards, Alfonso Pertierra (Spain)apertierra@teleline.es

Alfonso, Thanks for the reply! I would call this from the OnPostDataItem trigger of the Customer section? Mike

Mike, the function is supposed to be used in a button or something similar instead of calling the report directly.The problem when saving as PDF is that it considers as the same file all the report, so we’ve to break it in different “works” to the printer, so, instead of calling the report directly, the function calls the report n times (n = number of customers to print). Another way could be using another report instead (based just on the customer table) and using the code in the onAftergetRecord of the new report (remember… it’s not in the report you’re trying to send to the pdf file). In the example, myReport is the report you’re trying to split by Customer. dataitem customer rReport : report [ myreport]; Customer.SETRANGE(“No.”,Customer.“No.”); CLEAR (rReport); rReport.SETTABLEVIEW(Customer); rReport.RUNMODAL; Customer.SETRANGE(“No.”); Alfonso Pertierra (Spain)apertierra@teleline.es

Got it! Thanks a lot.

Otherwise you can use our Output Management system LaserNet between Navision and your Output. You can find further information on http://www.graphium.dk/index.asp