Printing invoices with statements

We have a handful of customers, like 100, that want their invoices to go along with their statements. So I modified the report that OnPostDataItem will look through the ledger entries and then print each invoice if that custom option is selected on the item card. It works and it prints them but not the way I had in my head. I basically have a report object and then I set the tableview with the record and then disable the userequestform to false and then runmodal. So this just prints the report directly.

What I really want to have happen is that it adds it to the statement report. So if I were to preview the statement it would include the invoices. I think this would require me actually adding the reports to the sections section. Is that correct? If that is the case I guess I can’t see how that can work. Does anyone else have any other ideas? Thanks.

Yes, you’re right Jason. If you call one report from a trigger of another, you won’t be able to view both in a single preview window. You would have to turn it into one big report. Probably not a feasible solution, since you mentioned that you only need to do this for around 100 customers.

One alternative for viewing the reports would be to print them all to pdf and then open them in a viewer, but without knowing why you want to preview the reports, I can’t suggest that this approach would solve your problem.

Hope that helps.

Thank you George. The reason I want it all in one report is because we print our monthly statements to a large PDF each month. Sometimes this is easier for some of our staff to look through when a customer has a question about their statement. So we see what they see! If I set my printer to a PDF printer I can print PDF’s, but it asks me the filename to save it to for each statement and then each invoice, it doesn’t lump them all together. I might play around with PDFCreator and see about integrating that into the system to dump reports through that. At this point I just made a wrapper report that will print the statement and then all invoices for that customer and then move on to the next customer.

Hi Jason,

Sounds like a reasonable goal. So your objective is not necessarily to be able to preview all of these reports at once in NAV, but rather to create a single PDF output file from the various reports so your users can see it later, right? If that’s the case, I think you’re on the right track. You should be able to find a method for creating pdf files without the UI coming into play. And, if you keep track of the files you’re creating while running the reports, you might also be able to cause multiple pdf files to be consolidated into a single file.