[]
        
(Showing Draft Content)

C1.Report.FlexReport

FlexReport Class

Generates data-based banded reports that can be rendered to printer, preview, or exported to various portable formats (including HTML, PDF and other).

Implements
Namespace: C1.Report
Assembly: C1.FlexReport.dll
Syntax
public class FlexReport : C1DocumentSource, IComponent, IDisposable

Constructors

Name Description
FlexReport()

Initializes a new instance of the FlexReport class.

Fields

Name Description
_measureContext

Used in functions which use DX calls. Has valuable value only while report rendering.

_serializer

Properties

Name Description
ActualCulture

Gets the actual culture used in report, returns CurrentCulture if Culture is null.

ActualRightToLeft

Gets the actual right-to-left value that is being used. The value is obtained using the following rules:

  1. If RightToLeft is not null, then that value is used.
  2. If the current report is a sub-report, then ActualRightToLeft of the owner subreport field is used.
  3. Else the value of DefaultRightToLeft static property is used.
AvailableHeight

Gets the height of the remaining area available for sections on the current page. This property can only be used while the report is being rendered in paginated mode (i.e. when IsBusy and C1.Document.C1DocumentSource.Paginated are true). If IsBusy is false then -1 is returned. If C1.Document.C1DocumentSource.Paginated is false then double.MaxValue is returned. Note that if used in OnPrint/OnFormat scripts, this value does NOT account for the current section's height. For subreports this property returns AvailableHeight of the master report.

BasePath

Gets or sets the StorageFolder that is used to search for any additional files specified with relative path names. This property is updated automatically when a report is loaded from a file. If you load a report definition from a MemoryStream or via the ReportDefinition property, make sure that WorkingDirectory has the correct value if the report template contains items with relative file names. If this property is null then DefaultBasePath is used, otherwise CurrentDirectory is used.

BehaviorOptions

Gets the BehaviorOptions object containing options controlling the behavior of the report.

Cancel

Specifies whether to cancel generation of the current report.

Credential

Gets or sets the default credential used during rendering of the report.

Culture

Gets or sets the CultureInfo determining the current report culture. This culture is used to convert values to/from strings. By default it is null, in which case the CurrentCulture is used.

CurrentDataScope

For internal use. Specifies the current data scope.

DataSource

Gets or sets a reference to the report's main DataSource, or null if the report is unbound.

DataSourceName

Gets or sets the name of the report's main data source. This name should match the name of a data source in the DataSources collection.

DataSources

Gets the collection of DataSource objects used in report.

DefaultBasePath

Gets or sets the default directory that is used to resolve relative file names. By default this property is null, in which case Environment.CurrentDirectory is used.

DefaultRightToLeft

Gets or sets the value used as the default for the RightToLeft property.

DoEvents

Specifies whether the control should handle Windows messages while rendering reports in synchronious mode.

Document

Gets a C1Document object produced by the current FlexReport during report rendering.

DocumentName

Overriden. Gets the user-frienly name for this FlexReport object.

ExposeScriptObjects

Specifies whether script objects of report should be exposed to subreports.

Features

Overridden. Gets a C1DocumentSourceFeatures object defining features of the FlexReport.

Fields

Gets the collection of Field objects in the report definition.

FileName

Gets the filename that was used to load or save the report.

Font

Gets or sets the default font used by report fields.

Fonts

Gets the data used by report fonts.

FormatVersion

Gets the C1.Document.Serialization.C1FormatVersion object specifying the version of the report definition files.

GlobalScripts

Gets or sets the global VBScript module. Functions and subroutines defined here (using the standard VBScript syntax) can be used in other scripts in the current report like standard VBScript functions.

Groups

Gets a collection with all the groups in the report.

GrowShrinkMode

Gets or sets the method used to process CanGrow/CanShrink fields.

IgnoreScriptErrors

Specifies whether the component should ignore script errors by default.

LabelOffset

Gets or sets the position of the first label on a partially used sheet.

Layout

Gets a reference to the report's Layout object.

MasterReport

Gets the FlexReport object representing master, i.e. root report that currently rendered, this property returns this if this is not subreport.

MaxPages

Gets or sets the maximum number of pages allowed for a report.

OnClose

Gets or sets the VBScript that is executed when the report finishes rendering.

OnError

Gets or sets the VBScript that is executed when an error occurs.

OnNoData

Gets or sets the VBScript that is executed when the report starts rendering and its source recordset is empty.

OnOpen

Gets or sets the VBScript that is executed when the report starts rendering.

OnPage

Gets or sets the VBScript that is executed when a new page is created.

Overlay

Gets the Watermark object defining properties of the report's overlay.

Page

Gets or sets the current page number.

PageSettings

Overriden. This is shortcut to the page settings returned by the Layout object accessible via the Layout property.

Pages

Gets the already generated pages.

Parameters

Gets a collection of parameters used to generate report.

ParentReport

Gets the main report that contains this subreport (null for main reports).

RecordsPerPage

Gets or sets the number of detail records to render per page or group.

RenderDocument

Gets the C1Document object currently generated.

ReportDefinition

Gets or sets an XML string containing the complete report definition.

ReportInfo

Gets or sets a ReportInfo object containing report metadata.

ReportName

Gets or sets the name of the report (used with the Load method).

RightToLeft

Gets or sets a value indicating whether the fields of the report should use right-to-left rules for rendering text.

If null (which is the default), the value of the static property DefaultRightToLeft is used.

This value may be overridden by individual fields.

ScriptContext

Gets the report ReportScriptContext object which can be used to execute scripts / evaluate expressions.

Sections

Gets the collection of Section objects in the report definition.

SupportedExportProviders

Overridden. Gets an array of exporters supported by the current document source object.

Tag

Gets or sets arbitrary user-defined data.

VersionNode

Gets the C1.Document.Serialization.XmlNodeWrapperBase object specifying the version of the Node definition files.

Watermark

Gets the Watermark object defining properties of the report's watermark.

Methods

Name Description
BuildErrorMessageBrick(FieldBase, string, Exception)
Clear()

Clears the current report.

CopyDefinitionFrom(FlexReport)

Copies a report definition from another FlexReport component. Please note, subreports referenced from the report via SubreportField or Field are not cloned.

CreateField(XmlNodeWrapperBase, string)
CreateParametersCollection()

Overriden. Creates ReportParameterCollection collection containing list of report parameters.

Dispose(bool)

Releases the unmanaged resources used by the Component and optionally releases the managed resources.

DoOnError(Exception, bool)
Evaluate(string)

Evaluates a VBScript expression in the current report context.

Evaluate(string, IReportScriptContext)

Evaluates a VBScript expression.

Execute(string)

Executes a VBScript statement in the current report context.

Execute(string, IReportScriptContext)

Executes a VBScript statement.

FinalizeRendering()
GetPageImageSvg(int)

Returns a GrapeCity.Documents.Svg.GcSvgDocument representing the specified page.

GetReportList(XmlDocumentWrapperBase)

Gets a list of reports available in an C1.Document.Serialization.XmlDocumentWrapperBase.

GetReportList(Stream)

Gets a list of reports available in an XML report definition file.

GetReportList(string)

Gets a list of reports available in an XML report definition file.

GetReportList(XDocument)

Gets a list of reports available in an System.Xml.Linq.XDocument.

GetReportList(XmlDocument)

Gets a list of reports available in an System.Xml.XmlDocument.

Init()

Overridden. Performs additional initializations of this FlexReport instance.

InitializeRendering(IExecutionContext)
InternalRenderSubreport(IExecutionContext, string, ReportParameterValues)

Render as subreport. This method uses following properties:

  • _owner.
Load(Stream, string)

Loads a report from an XML report definition in stream.

Load(Stream, string, out bool)

Loads a report from an XML report definition in stream.

Load(string)

Load report.

Load(string, string)

Loads a report from an XML report definition file.

Load(string, string, out bool)

Loads a report from an XML report definition file.

Load(XDocument, string)

Loads a report from an System.Xml.Linq.XDocument.

Load(XDocument, string, out bool)

Loads a report from an System.Xml.Linq.XDocument.

Load(XmlDocument, string)

Loads a report from an System.Xml.XmlDocument.

Load(XmlDocument, string, out bool)

Loads a report from an System.Xml.XmlDocument.

Load(XmlDocument, string, out bool, bool)

Loads a report from an System.Xml.XmlDocument.

OnEndPage(int)

Raises the EndPage event.

OnEndReport()

Raises the EndReport event.

OnGetScriptObject(string)

Raises the GetScriptObject event.

OnLongOperation(double, bool)

Overriden. Raises the LongOperation event

OnNoReportData()

Raises the NoData event.

OnPrintSection(Section)

Raises the PrintSection event.

OnReportDefinitionChanged()

Raises the ReportDefinitionChanged event. Called each time a property on the current report or on any of the contained objects in changed.

OnReportError(int, Exception, bool)

Raises the ReportError event.

OnStartPage(int)

Raises the StartPage event.

OnStartReport()

Raises the StartReport event.

OnStartSection(Section)

Raises the StartSection event.

ParseExpression(string)

Parses a VBScript expression in the current report context.

ParseStatement(string)

Parses a VBScript statement in the current report context.

ReadProp(C1ReaderBase)

Override in derived classes to provide advanced persistence mechanism. Use C1.Document.Serialization.C1ReaderBase.PropName to determine the name of the current property, use C1ReaderBase.ReadXXX(...) to read property value.

Render()

Renders the report. This method is a shortcut to the Generate() method on the base class.

RenderAsync()

Non-blocking (asynchronous) version of the Render() method. This method is a shortcut to the GenerateAsync() method on the base class.

RenderAsyncEx()

Non-blocking (asynchronous) version of the Render() method. This method is a shortcut to the GenerateAsyncEx() method on the base class.

RenderToFilter(ExportFilter)

Renders the report into an ExportFilter object. This method is a shortcut to the Export(ExportFilter) method on the base class.

RenderToFilterAsync(ExportFilter)

Non-blocking (asynchronous) version of the RenderToFilter(ExportFilter) method. This method is a shortcut to the ExportAsync(ExportFilter) method on the base class.

RenderToFilterAsyncEx(ExportFilter)

Non-blocking (asynchronous) version of the RenderToFilter(ExportFilter) method. This method is a shortcut to the ExportAsyncEx(ExportFilter) method on the base class.

Save(Stream, bool, bool, bool, FontEmbedType)

Saves the current report definition to a stream.

Save(string)

Saves the current report definition to a file.

Save(string, bool, FontEmbedType)

Saves the current report definition to a file.

Save(string, bool, bool, bool, FontEmbedType)

Saves the current report definition to a file.

Save(XmlWriter)

Saves the current report definition to an System.Xml.XmlWriter object.

Save(XmlWriter, bool, FontEmbedType)

Saves the current report definition to an XmlWriter object.

Save(XmlWriter, bool, bool, FontEmbedType)

Saves the current report definition to an XmlWriter object.

Write(C1WriterBase)

Override in derived classes to provide advanced persistence mechanism. Use C1.Document.Serialization.C1WriterBase methods to write additional object properties.

Events

Name Description
EndPage

Occurs when a page finishes rendering.

EndReport

Occurs when the report finishes rendering.

GetScriptObject

Occurs when an unknown object is found in the report's script or expression.

NoData

Occurs when the report starts rendering and the main report data source is empty.

PrintSection

Occurs before each Section is printed (after it has been formatted.)

RenderCompleted

Occurs when the RenderAsync() method has completed.

ReportDefinitionChanged

Occurs when the current report definition changes.

ReportError

Occurs when an error occurs while rendering a report.

StartPage

Occurs when a new page starts rendering.

StartReport

Occurs when the report starts rendering, before it opens the datasources and checks parameters.

StartSection

Occurs before each Section is formatted.