Note how in the Displaying Reports and Documents section, in-memory C1Report and C1PrintDocument objects were created with calls to method on the C1ReportViewer rather than using regular constructors:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Dim doc As C1PrintDocument = Me.C1ReportViewer.CreateC1PrintDocument() Dim rep As C1.C1Report.C1Report = Me.C1ReportViewer.CreateC1Report() |
To write code in C#
C# |
Copy Code
|
---|---|
C1PrintDocument doc = this.C1ReportViewer.CreateC1PrintDocument(); C1.C1Report.C1Report rep = this.C1ReportViewer.CreateC1Report(); |
Using the CreateC1Report and CreateC1PrintDocument methods ensures that, as long as your C1ReportViewer control is licensed, the instances of C1.C1Report.C1Report and C1.C1Preview.C1PrintDocument classes that you create in this way are also licensed, and you or your users will not see the nag screen about using an unlicensed copy of C1Report.
If you simply wrote:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Dim doc As New C1PrintDocument() Dim rep As New C1.C1Report.C1Report() |
To write code in C#
C# |
Copy Code
|
---|---|
C1PrintDocument doc = new C1PrintDocument(); C1.C1Report.C1Report rep = new C1.C1Report.C1Report(); |
chances are that at run time, those calls would have generated nag screens because run-time licenses for C1.C1Report.C1Report and C1.C1Preview.C1PrintDocument were not embedded into the application.
So, whenever you need to create an instance of a C1.C1Report.C1Report or a C1.C1Preview.C1PrintDocument in code that you want to assign to the C1DocumentViewer.Document, use the appropriate CreateC1Report or CreateC1PrintDocument method to make sure the created instance is licensed properly.