| PowerTools ActiveReports for .NET 9.0J > ActiveReportsユーザーガイド > クイックスタート > レポートを表示する > Webで表示する > WebViewerコントロールの使用 |
WebViewerコントロールは、Webアプリケーション上でレポートを表示するための機能です。
WebViewerには4種類の表示形式が用意されています。これらの表示形式はWebViewerコントロールのViewerTypeプロパティで設定します。
![]() |
メモ: セクションレポート(XML)の場合、ReportNameプロパティをコード上からも設定できます。 VB コード: WebViewer.ReportName="YourReport.rpx" C# コード: WebViewer.ReportName="YourReport.rpx"; |
ページレポートまたはRDLレポート(Visual Basic)
| Visual Basicコード(Page_Loadイベントに貼り付けます) |
コードのコピー
|
|---|---|
Dim rpt As New GrapeCity.ActiveReports.PageReport()
rpt.Load(New System.IO.FileInfo(Server.MapPath("")+"\invoice.rdlx"))
WebViewer1.Report = rpt
|
|
ページレポートまたはRDLレポート(C#)
| C#コード(Page_Loadイベントに貼り付けます) |
コードのコピー
|
|---|---|
GrapeCity.ActiveReports.PageReport rpt = new GrapeCity.ActiveReports.PageReport();
rpt.Load(new System.IO.FileInfo(Server.MapPath("")+"\\invoice.rdlx"));
WebViewer1.Report = rpt;
|
|
セクションレポート(コード)(Visual Basic)
|
Visual Basicコード(Page_Loadイベントに貼り付けます)
|
コードのコピー
|
|---|---|
Dim rpt As New MyInvoiceReport() WebViewer1.Report = rpt |
|
セクションレポート(コード)(C#)
|
C#コード(Page_Loadイベントに貼り付けます) |
コードのコピー
|
|---|---|
MyInvoiceReport rpt = new MyInvoiceReport(); WebViewer1.Report = rpt; |
|
セクションレポート(XML)(Visual Basic)
| Visual Basicコード(Page_Loadイベントに貼り付けます) |
コードのコピー
|
|---|---|
Dim sr As New SectionReport()
sr.LoadLayout(Server.MapPath("") + "\Invoice.RPX")
WebViewer1.Report = sr
|
|
C#(セクションレポート(XML))
| C#コード(Page_Loadイベントに貼り付けます) |
コードのコピー
|
|---|---|
SectionReport sr = new SectionReport();
sr.LoadLayout(Server.MapPath("") + "\\Invoice.RPX");
WebViewer1.Report = sr;
|
|
![]() |
メモ: ReportNameプロパティとReportプロパティの両方を設定すると、エラーが発生します。どちらか片方のみを設定してください。 |