LocalReport Class

 

Represents a report that is processed and rendered locally without connecting to a report server.

Namespace:   Microsoft.Reporting.WinForms
Assembly:  Microsoft.ReportViewer.WinForms (in Microsoft.ReportViewer.WinForms.dll)

System.Object
  Microsoft.Reporting.WinForms.Report
    Microsoft.Reporting.WinForms.LocalReport

[SerializableAttribute]
public sealed class LocalReport : Report, ISerializable, IDisposable

NameDescription
System_CAPS_pubmethodLocalReport()

Initializes a new instance of the LocalReport class.

NameDescription
System_CAPS_pubpropertyDataSources

Gets a collection of data sources used by the report.

System_CAPS_pubpropertyDisplayName

Gets or sets the display name of the report.(Inherited from Report.)

System_CAPS_pubpropertyEnableExternalImages

Indicates whether the report can be rendered if it has external images.

System_CAPS_pubpropertyEnableHyperlinks

Indicates whether the report can be rendered if it contains hyperlink actions.

System_CAPS_pubpropertyIsDrillthroughReport

Indicates whether the report is a drillthrough report.(Inherited from Report.)

System_CAPS_pubpropertyIsReadyForRendering

Gets a Boolean value that indicates whether a report definition and all required parameters have been specified, and all data sources are ready for use. (Inherited from Report.)

System_CAPS_pubpropertyMapTileServerConfiguration

Defines configuration settings for Microsoft Bing Maps SOAP Services that provides a tile background for map report items in the report.

System_CAPS_pubpropertyOriginalParametersToDrillthrough

Returns the parameters passed from a parent report to this report, if it is a drillthrough report.

System_CAPS_pubpropertyReportEmbeddedResource

Gets or sets the name of the report-embedded resource.

System_CAPS_pubpropertyReportPath

Gets or sets the file system path of the local report.

System_CAPS_pubpropertyShowDetailedSubreportMessages

Gets or sets a boolean value that indicates whether detailed messages should be displayed when an error occurs in a subreport.

NameDescription
System_CAPS_pubmethodAddFullTrustModuleInSandboxAppDomain(StrongName)

Adds the supplied assembly to the list of assemblies that run in full trust mode in the sandboxed application domain.

System_CAPS_pubmethodAddTrustedCodeModuleInCurrentAppDomain(String)

Obsolete.Adds the supplied assembly to the list of assemblies that are trusted to execute in the current AppDomain.

System_CAPS_pubmethodDispose()

Releases all resources that are used by the LocalReport object.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodExecuteReportInCurrentAppDomain(Evidence)

Obsolete.Causes processing extensions and expressions in the report to be executed in the current AppDomain.

System_CAPS_pubmethodExecuteReportInSandboxAppDomain()

Obsolete.Causes processing extensions and expressions to be run in an application domain with limited permissions.

System_CAPS_pubmethodGetDataSourceNames()

Returns the names of all datasets used within the local report.

System_CAPS_pubmethodGetDefaultPageSettings()

Gets the default page settings specified in the local report.(Overrides Report.GetDefaultPageSettings().)

System_CAPS_pubmethodGetDocumentMap()

Returns the representation of the document map for the local report.(Inherited from Report.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetParameters()

Returns report parameter properties for the report. (Overrides Report.GetParameters().)

System_CAPS_pubmethodGetTotalPages()

Returns the total number of soft pages in the report. (Inherited from Report.)

System_CAPS_pubmethodGetTotalPages(PageCountMode)

Returns the total number of soft pages in the report and a PageCountMode enumeration value that indicates the current page count mode.(Overrides Report.GetTotalPages(PageCountMode).)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodListRenderingExtensions()

Returns all available rendering extensions for the local report.(Overrides Report.ListRenderingExtensions().)

System_CAPS_pubmethodLoadReportDefinition(Stream)

Loads a report definition for processing using a Stream.(Inherited from Report.)

System_CAPS_pubmethodLoadReportDefinition(TextReader)

Loads a report definition from the local file system using a TextReader.(Overrides Report.LoadReportDefinition(TextReader).)

System_CAPS_pubmethodLoadSubreportDefinition(String, Stream)

Loads a subreport definition using a Stream.

System_CAPS_pubmethodLoadSubreportDefinition(String, TextReader)

Loads a subreport definition using a TextReader.

System_CAPS_pubmethodRefresh()

Causes the local report to be rendered with new data.(Overrides Report.Refresh().)

System_CAPS_pubmethodReleaseSandboxAppDomain()

Causes the LocalReport object to release its reference to the sandboxed application domain immediately.

System_CAPS_pubmethodRender(String)

Processes the report and renders it in the specified format.(Inherited from Report.)

System_CAPS_pubmethodRender(String, String)

Processes the report and renders it in the specified format.(Inherited from Report.)

System_CAPS_pubmethodRender(String, String, CreateStreamCallback, Warning[])

Processes the report and renders it in the specified format using a stream provided by a callback function.

System_CAPS_pubmethodRender(String, String, PageCountMode, CreateStreamCallback, Warning[])

Processes the report with a specified page count mode and renders it in the specified format using a stream provided by a callback function.

System_CAPS_pubmethodRender(String, String, PageCountMode, String, String, String, String[], Warning[])

Processes the report with a specified page count mode and renders it in the specified format.(Overrides Report.Render(String, String, PageCountMode, String, String, String, String[], Warning[]).)

System_CAPS_pubmethodRender(String, String, String, String, String, String[], Warning[])

Processes the report and renders it in the specified format.(Inherited from Report.)

System_CAPS_pubmethodSetBasePermissionsForSandboxAppDomain(PermissionSet)

Sets the base permissions for the sandboxed application domain with the supplied permission set.

System_CAPS_pubmethodSetParameters(IEnumerable<ReportParameter>)

Sets report parameter properties for the local report.(Overrides Report.SetParameters(IEnumerable<ReportParameter>).)

System_CAPS_pubmethodSetParameters(ReportParameter)

Sets report parameter properties for the report.(Inherited from Report.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubeventSubreportProcessing

Occurs when a subreport is processed.

The LocalReport class represents reports that are processed and rendered locally without connecting to a report server. This class is the same object that is used by the ReportViewer control, but it also can be used independently as a nonvisual object that encapsulates the core functionality of the ReportViewer control.

The LocalReport object can open client report definition (RDLC) files from the file system or from embedded resources, or the RDLC file can be supplied to it as a Stream or a TextReader.

The LocalReport object does not have the ability to execute queries or fetch data; instead, data sources must be added to the DataSources collection property.

The LocalReport object supports report parameters, but does not support parameter prompts.

Legacy Code Example

In the following code example, a LocalReport object is used to load and export a report.

private void button1_Click(object sender, EventArgs e)
{

   Microsoft.Reporting.WinForms.LocalReport lr = new Microsoft.Reporting.WinForms.LocalReport();

   string deviceInfo =
     "<DeviceInfo>" +
     "<SimplePageHeaders>True</SimplePageHeaders>" + 
     "</DeviceInfo>";

   lr.ReportPath = @"C:\My Reports\Monthly Sales.rdlc";

   lr.DataSources.Add(new ReportDataSource("Sales", GetSalesData()));

   byte[] bytes = lr.Render("Excel", deviceInfo, out mimeType, 
     out encoding, out streamids, out warnings);

      using (FileStream fs = = new FileStream(@"c:\My Reports\Monthly Sales.xls", FileMode.Create))
      {
        fs.Write(bytes, 0, bytes.Length);
      }
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: