I have an invoicing processing that loops through and generates multiple (200-300) reports. My report is a main report that contains 5 subreports. My main report has 3 different background images, one on the Report Header, one on an unbound group header and then one for the Report (which displays for every page but the report header and the 1st group header). Each image is a png file that fills a 8x11 page.
Currently I create a new report object for each invoice. I have a shared ReportProcessor that I use to get each report as a pdf file in a memory stream and then store the document in the database. Then I either email or fax the memory stream OR print the original report object. I ran into problems last month where after 10-20 report I got an Argument exception and it mentioned the BackgroundImage property. Unfortunately I cannot remember the exact error or reproduce it without printing all the reports.
Any ideas or suggestions? Can I share a report processor like that? Should I recreate the report each time? I will try and re-generate the error by pausing the print queue and letting the code go through the steps.
Example code:
Currently I create a new report object for each invoice. I have a shared ReportProcessor that I use to get each report as a pdf file in a memory stream and then store the document in the database. Then I either email or fax the memory stream OR print the original report object. I ran into problems last month where after 10-20 report I got an Argument exception and it mentioned the BackgroundImage property. Unfortunately I cannot remember the exact error or reproduce it without printing all the reports.
Any ideas or suggestions? Can I share a report processor like that? Should I recreate the report each time? I will try and re-generate the error by pausing the print queue and letting the code go through the steps.
Example code:
Dim rp as new ReportProcessor, r as InvoiceReport, ms as MemoryStream
for each itm in list( of items)
r=New InvoiceReport
rp.RenderReport("PDF", r, Nothing)
'database save code
Select itm.SendFormat
Case email,fax
'do email/fax processing with memory stresm
Case paper
rp.PrintReport(r,settings)
End Select
r.dispose
ms.dispose