I have a class called clsInvoice. I have a report called InvoiceReport. When InvoiceReport is created, the DataSource is assigned to be a clsInvoice. Then I assign a few images on the report manually. Then I preview the report. All is well.
Now I want to print multiple invoices. I created a new report MultInvoiceReports. I added a detail band only. I added a SubReport to this band, and set it to be an InvoiceReport. My InvoiceReports data source is an ObservableCollection<clsInvoice>.
I tried for a long time to get bindings to work. I never could. Eventually I used the NeedDataSource method and manually assigned it. The images I was creating and assigning did not print, but the report worked otherwise.
Next, I removed the subreport from the designer, and tried everything manually:
foreach (clsInvoice c in InvoiceList)
{
// Create a new InvoiceReport
// set the data source to c
// Assign my images
// Create a subreport
// Set the ReportSource to the InvoiceReport
// Find the DetailSection in MultInvoiceReports and add the subreport to DetailSections.Items.
}
This makes the reports all show, however there are 4 to 7 blank pages between sub reports, and again my images do not work.
Is there a better way to do this?
Now I want to print multiple invoices. I created a new report MultInvoiceReports. I added a detail band only. I added a SubReport to this band, and set it to be an InvoiceReport. My InvoiceReports data source is an ObservableCollection<clsInvoice>.
I tried for a long time to get bindings to work. I never could. Eventually I used the NeedDataSource method and manually assigned it. The images I was creating and assigning did not print, but the report worked otherwise.
Next, I removed the subreport from the designer, and tried everything manually:
foreach (clsInvoice c in InvoiceList)
{
// Create a new InvoiceReport
// set the data source to c
// Assign my images
// Create a subreport
// Set the ReportSource to the InvoiceReport
// Find the DetailSection in MultInvoiceReports and add the subreport to DetailSections.Items.
}
This makes the reports all show, however there are 4 to 7 blank pages between sub reports, and again my images do not work.
Is there a better way to do this?