Under this scenario, an application generates reports using a fixed set of report definitions that are built into the application. This type of application does not rely on any external report definition files, and end-users have no way to modify the reports.
The main advantage of this type of application is that you don't need to distribute the report definition file, and you can be sure that no one will modify the report format. The disadvantage is that to make any modifications to the report, you must recompile the application.
If you want to use a report definition that you already have, without any modifications, follow these steps (we will later describe how you can edit an embedded report or create one from scratch):
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub btnProductsReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProductsReport.Click ppv.Document = rptProducts End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void btnProductsReport_Click(object sender, System.EventArgs e) { ppv.Document = rptProducts; } |
Note that rptProducts is the name of the C1Report component that contains the report selected by the user and ppv is the name of the C1PrintPreview control.