ComponentOne ReportViewer for ASP.NET AJAX: The C1ReportViewer Control > Note on C1Report/C1PrintDocument Licensing

Note on C1Report/C1PrintDocument Licensing

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:

      Visual Basic

Dim doc As C1PrintDocument = Me.C1ReportViewer1.CreateC1PrintDocument()

Dim rep As C1.C1Report.C1Report = Me.C1ReportViewer1.CreateC1Report()

      C#

C1PrintDocument doc = this.C1ReportViewer1.CreateC1PrintDocument();

C1.C1Report.C1Report rep = this.C1ReportViewer1.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:

      Visual Basic

Dim doc As New C1PrintDocument()

Dim rep As New C1.C1Report.C1Report()

      C#

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.


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.