ComponentOne Reports for WinForms Designer Edition: ComponentOne Reports for WinForms > Reports for WinForms Task-Based Help > Reporting Task-Based Help > Loading Report Definitions > Loading a Report Definition from a String

Loading a Report Definition from a String

C1Report has a ReportDefinition property that allows you to get or set the entire report definition as a string. This is a convenient way to store and retrieve report definitions in databases or in data structures within your application.

The ReportDefinition string contains the exact same XML that would be stored in the report definition file, for example:

      Visual Basic

' Load report definition into C1Report component

c1r.Load(reportFile, reportName)

 

' Copy report definition to the clipboard

Dim repDef As String = c1r.ReportDefinition

Clipboard.SetDataObject(repDef)

 

' Copy report definition to c1r2 component

c1r2.ReportDefinition = repDef

      C#

// Load report definition into C1Report component

c1r.Load(reportFile, reportName);

 

// Copy report definition to the clipboard

string repDef = c1r.ReportDefinition;

Clipboard.SetDataObject(repDef);

 

// Copy report definition to c1r2 component

c1r2.ReportDefinition = repDef;


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