次の方法で共有


LocalReport クラス

 

レポート サーバーに接続せずにローカルで処理されて表示されるレポートを表します。

名前空間:   Microsoft.Reporting.WinForms
アセンブリ:  Microsoft.ReportViewer.WinForms (Microsoft.ReportViewer.WinForms.dll 内)

継承階層

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

構文

[SerializableAttribute]
public sealed class LocalReport : Report, ISerializable, IDisposable
[SerializableAttribute]
public ref class LocalReport sealed : Report, ISerializable, 
    IDisposable
[<Sealed>]
[<SerializableAttribute>]
type LocalReport = 
    class
        inherit Report
        interface ISerializable
        interface IDisposable
    end
<SerializableAttribute>
Public NotInheritable Class LocalReport
    Inherits Report
    Implements ISerializable, IDisposable

コンストラクター

名前 説明
System_CAPS_pubmethod LocalReport()

LocalReport クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
System_CAPS_pubproperty DataSources

レポートで使用されるデータ ソースのコレクションを取得します。

System_CAPS_pubproperty DisplayName

レポートの表示名を取得または設定します。(Report から継承されます。)

System_CAPS_pubproperty EnableExternalImages

レポートに外部画像がある場合に表示可能かどうかを示します。

System_CAPS_pubproperty EnableHyperlinks

レポートにハイパーリンクのアクションがある場合に表示可能かどうかを示します。

System_CAPS_pubproperty IsDrillthroughReport

レポートがドリルスルー レポートかどうかを示します。(Report から継承されます。)

System_CAPS_pubproperty IsReadyForRendering

レポート定義と必要なすべてのパラメーターが指定されており、すべてのデータ ソースが使用できる状態であるかどうかを示すブール値を取得します。(Report から継承されます。)

System_CAPS_pubproperty MapTileServerConfiguration

レポート内のマップ レポート アイテムのタイル背景を提供する Microsoft Bing Maps SOAP サービスの構成設定を定義します。

System_CAPS_pubproperty OriginalParametersToDrillthrough

レポートがドリルスルー レポートの場合、親レポートからそのレポートに渡されたパラメーターを返します。

System_CAPS_pubproperty ReportEmbeddedResource

レポートに埋め込まれたリソースの名前を取得または設定します。

System_CAPS_pubproperty ReportPath

ローカル レポートのファイル システムのパスを取得または設定します。

System_CAPS_pubproperty ShowDetailedSubreportMessages

サブレポートでエラーが発生した場合に、詳細メッセージを表示するかどうかを示す boolean 値を取得または設定します。

メソッド

名前 説明
System_CAPS_pubmethod AddFullTrustModuleInSandboxAppDomain(StrongName)

指定したアセンブリをサンド ボックス アプリケーション ドメインで完全信頼モードで実行されているアセンブリの一覧に追加します。

System_CAPS_pubmethod AddTrustedCodeModuleInCurrentAppDomain(String)

互換性のために残されています。現在の実行が信頼されているアセンブリの一覧に、指定したアセンブリを追加 AppDomainします。

System_CAPS_pubmethod Dispose()

LocalReport オブジェクトによって使用されているすべてのリソースを解放します。

System_CAPS_pubmethod Equals(Object)

(Object から継承されます。)

System_CAPS_pubmethod ExecuteReportInCurrentAppDomain(Evidence)

互換性のために残されています。現在で実行される処理拡張機能と、レポート内の式と AppDomainです。

System_CAPS_pubmethod ExecuteReportInSandboxAppDomain()

互換性のために残されています。原因は拡張機能と権限の制限により、アプリケーション ドメインで実行する式を処理します。

System_CAPS_pubmethod GetDataSourceNames()

ローカル レポートで使用されているすべてのデータセットの名前を返します。

System_CAPS_pubmethod GetDefaultPageSettings()

ローカル レポートで指定したページの設定の既定値を取得します。(Report.GetDefaultPageSettings() をオーバーライドします。)

System_CAPS_pubmethod GetDocumentMap()

ローカル レポートの見出しマップの表示を返します。(Report から継承されます。)

System_CAPS_pubmethod GetHashCode()

(Object から継承されます。)

System_CAPS_pubmethod GetParameters()

レポートに対してレポート パラメーター プロパティを返します。(Report.GetParameters() をオーバーライドします。)

System_CAPS_pubmethod GetTotalPages()

レポート内のソフト ページの総数を返します。(Report から継承されます。)

System_CAPS_pubmethod GetTotalPages(PageCountMode)

レポート内のソフト ページの総数と現在のページ数モードを示す PageCountMode 列挙値を返します。(Report.GetTotalPages(PageCountMode) をオーバーライドします。)

System_CAPS_pubmethod GetType()

(Object から継承されます。)

System_CAPS_pubmethod ListRenderingExtensions()

ローカル レポートで使用可能なすべての表示拡張機能を返します。(Report.ListRenderingExtensions() をオーバーライドします。)

System_CAPS_pubmethod LoadReportDefinition(Stream)

Stream を使用して、処理するレポート定義を読み込みます。(Report から継承されます。)

System_CAPS_pubmethod LoadReportDefinition(TextReader)

TextReader を使用して、ローカル ファイル システムからレポート定義を読み込みます。(Report.LoadReportDefinition(TextReader) をオーバーライドします。)

System_CAPS_pubmethod LoadSubreportDefinition(String, Stream)

Stream を使用してサブレポート定義を読み込みます。

System_CAPS_pubmethod LoadSubreportDefinition(String, TextReader)

TextReader を使用してサブレポート定義を読み込みます。

System_CAPS_pubmethod Refresh()

ローカル レポートが新しいデータを使用して表示されます。(Report.Refresh() をオーバーライドします。)

System_CAPS_pubmethod ReleaseSandboxAppDomain()

により、 LocalReport オブジェクトをすぐにサンド ボックス アプリケーション ドメインへの参照を解放します。

System_CAPS_pubmethod Render(String)

レポートを処理し、指定された形式で表示します。(Report から継承されます。)

System_CAPS_pubmethod Render(String, String)

レポートを処理し、指定された形式で表示します。(Report から継承されます。)

System_CAPS_pubmethod Render(String, String, CreateStreamCallback, Warning[])

コールバック関数によって提供されたストリームを使用して、レポートを処理し、指定された形式で表示します。

System_CAPS_pubmethod Render(String, String, PageCountMode, CreateStreamCallback, Warning[])

コールバック関数によって提供されたストリームを使用して、指定のページ カウント モードでレポートを処理し、指定された形式で表示します。

System_CAPS_pubmethod Render(String, String, PageCountMode, String, String, String, String[], Warning[])

指定されたページ カウント モードでレポートを処理し、指定された形式で表示します。(Report.Render(String, String, PageCountMode, String, String, String, String[], Warning[]) をオーバーライドします。)

System_CAPS_pubmethod Render(String, String, String, String, String, String[], Warning[])

レポートを処理し、指定された形式で表示します。(Report から継承されます。)

System_CAPS_pubmethod SetBasePermissionsForSandboxAppDomain(PermissionSet)

指定された権限セットでサンド ボックス アプリケーション ドメインの基本アクセス許可を設定します。

System_CAPS_pubmethod SetParameters(IEnumerable<ReportParameter>)

ローカル レポートのレポート パラメーター プロパティを設定します。(Report.SetParameters(IEnumerable<ReportParameter>) をオーバーライドします。)

System_CAPS_pubmethod SetParameters(ReportParameter)

レポートのレポート パラメーター プロパティを設定します。(Report から継承されます。)

System_CAPS_pubmethod ToString()

(Object から継承されます。)

イベント

名前 説明
System_CAPS_pubevent SubreportProcessing

サブレポートが処理されるときに発生します。

明示的なインターフェイスの実装

名前 説明
System_CAPS_pubinterfaceSystem_CAPS_privmethod ISerializable.GetObjectData(SerializationInfo, StreamingContext)

備考

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.

使用例

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);
      }
}
Private Sub Button1_Click(ByVal sender As System.Object, _
   ByVal e As System.EventArgs) Handles Button1.Click
   Dim warnings As Warning() = Nothing
   Dim streamids As String() = Nothing
   Dim mimeType As String = Nothing
   Dim encoding As String = Nothing
   Dim extension As String = Nothing
   Dim deviceInfo as string
   Dim bytes As Byte()

   deviceInfo = "< deviceInfo ><SimplePageHeaders>True</SimplePageHeaders></DeviceInfo>"

   bytes = ReportViewer1.LocalReport.Render("Excel", Nothing, _
     mimeType,encoding, extension, streamids, warnings)

   Dim fs As New FileStream("c:\output.xls", FileMode.Create)
   fs.Write(bytes, 0, bytes.Length)

   MessageBox.Show("Report exported to output.xls", "Info")
End Sub

スレッド セーフ

この型のパブリック static (Visual Basic では Shared ) メンバーはスレッド セーフです。インスタンス メンバーの場合は、スレッド セーフであるとは限りません。

関連項目

Microsoft.Reporting.WinForms 名前空間

トップに戻る