スポンサーリンク
スポンサーリンク

GrapeCity ActiveReports for .NET 16.0J のセクションレポート(SectionReport) 開発手順 v4

.NET Core.NET FrameworkActiveReportsC#GrapeCityVisual Studioデザイン帳票

前回作成したサンプルは、セクションレポートを Viewer画面で表示していましたが、Viewer画面を表示せずに PDFファイル出力するサンプルを作成しました。
ソースコードは GitHub で公開しています。

 

リリース用 .Net Core系統のプロジェクト

ソースコード変更内容を解説。

 

/WinFormsApp1/WinFormsApp1.csproj

GrapeCity.ActiveReports.Export.Pdf.ja Nugetパッケージをインストール。

GrapeCity.ActiveReports.Export.Pdf.ja 16.1.0 Nugetパッケージは、Nugetパッケージの「参照」からインストールできます。

 

/WinFormsApp1/Form2.Designer.cs

PDFファイル出力する「PDF」ボタンを追加。

 

/WinFormsApp1/Form2.cs

PDFファイル出力する「PDF」ボタンのイベントハンドラを追加しています。
GrapeCity.ActiveReports.Export.Pdf.ja Nugetパッケージを using GrapeCity.ActiveReports.Export.Pdf.Section; で参照し、button2_Clickイベントハンドラ内では、 前回作成したサンプルと同じ処理でセクションレポートのデータを作成し、new SectionReport1(reportDataModel); でセクションレポートのインスタンスを作成し、sectionReport1.Run(); でビルドし、export.Export(sectionReport1.Document, @”C:\temp\sample4.pdf”); でPDFファイル出力しています。

 

関連記事

GrapeCity ActiveReports for .NET 16.0J のセクションレポート(SectionReport) 開発手順 v1
GrapeCity ActiveReports for .NET 16.0J のセクションレポート(SectionReport) 開発手順 v2
GrapeCity ActiveReports for .NET 16.0J のセクションレポート(SectionReport) 開発手順 v3
GrapeCity ActiveReports for .NET 16.0J のセクションレポート(SectionReport) 開発手順 v4
GrapeCity ActiveReports for .NET 16.0J のセクションレポート(SectionReport) 開発手順 v5
GrapeCity ActiveReport よく使う機能
GrapeCity.ActiveReports.SectionReportの CanGrow/CanShrinkプロパティを使う場合
ActiveReports開発でデザイナが「値を Null にすることはできません。パラメーター名:instance」エラーになる場合

 

コメント

タイトルとURLをコピーしました