This example shows how to render and export reports asynchronously. First, specify the path to the reports:
...

	public FormMain()
	{
		InitializeComponent();

		labelLoad.Text = "Loading... ";

		Report = new StiReport();
		Report.Load("..\\MasterDetail.mrt");

		labelLoad.Text += "OK";
	}

...

Next, use RenderAsync() method to render the report:
...

	private async void buttonRender_Click(object sender, EventArgs e)
	{
		labelRender.Text = "Rendering... ";

		await Report.CompileAsync(); // if compilation is needed
		await Report.RenderAsync();

		labelRender.Text += "OK";
	}
	
...

After that, use ExportDocumentAsync() method to export the report:
...

	private async void buttonExport_Click(object sender, EventArgs e)
	{
		saveFileDialog.FileName = Report.ReportName + ".pdf";
		if (saveFileDialog.ShowDialog() == DialogResult.OK)
		{
			labelExport.Text = "Exporting... ";

			await Report.ExportDocumentAsync(StiExportFormat.Pdf, saveFileDialog.FileName);

			labelExport.Text += "OK";
		}
	}
	
...

Auf dem Screenshot unten Sie können das Ergebnis des Beispiel-Codes ansehen:

Rendering and Exporting a Report Asynchronously

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.