How do I wait until the report has finished rendering before the rest of the code gets executed?
Printable View
How do I wait until the report has finished rendering before the rest of the code gets executed?
What report? What Code?
Ok, let me put it this way.
This is what happens on form load:
1: report gets generated from a datatable (using microsoft report viewer)
2: export the report to a .pdf
Now I get the problem that it wants to start the export before the report hes finished rendering(generating)
You didn't post your code.
I dont see how it is relevant, because after it ran all the code it still gives an animated screen on in the reportviewer and then after the "generation" is complete it shows the report. I might be wrong, so this is the code I'm using.
vb Code:
Dim MyReportDataSource = New ReportDataSource("dsNewInvoice_LABELS", dsPrintLabels.Tables(0)) rvLabel.LocalReport.DataSources.Add(MyReportDataSource) Me.rvLabel.RefreshReport()
Code is relevant when you ask for help with code!
How do we know what you are doing, even if you say so, you may not be right. No one is right all the time, myself included.
If the computer isn't working ALWAYS check to see if it is plugged in even if you know it is plugged in. Then check for power in the outlet before you even open the case.
It is the first step to basic troubleshooting, review the code. If you want others to help you, they need to review the code.
I've never used whatever report thing you are using, since you didn't specify, I couldn't even do an search for it. But since you posted some code maybe someone will recognize it and tell you if you can run it asynchronously or handle an event.