FastReportPrinter
v1.0.0
FastRePortPrinterは、マルチスレッドおよび非GUI(グラフィカルユーザーインターフェイス)環境向けの高速レポートの印刷ライブラリです。
Delphi Languageで実装されており、Fluent Interface Conceptを使用して、Print Spoolerを使用してグラフィカルユーザーインターフェイスにレポートを印刷するように設計されたライブラリの使用をガイドします。
環境
fastReportPrinterを使用するには、高速レポートコンポーネントをインストールする必要があります。
ボス(Delphiの依存マネージャー)を使用すると、ライブラリを自動的にインストールすることができます。
boss install github.com/antoniojmsjr/FastReportPrinter
手動でインストールすることを選択した場合は、プロジェクトに次のフォルダーを追加するだけで、プロジェクト>オプション> Delphiコンパイラ>ターゲット>すべての設定>検索パス
..FastReportPrinterSource
データセットは、コンポーネントを介してデータベースとの通信のためにライブラリが使用するインターフェイスです。
| クラス | 成分 |
|---|---|
| 伝票 | ネイティブ |
| tfrxdbdataset | 高速レポート |
ライブラリの使用を例示するために、IbgeのAPIデータがレポートのレポートと印刷に使用されました。
ファイルの印刷:locationsibge.pdf
例は、プロジェクトフォルダーで入手できます。
..FastReportPrinterSamples
例データベース
..FastReportPrinterSamplesDB
レポートの例
..FastReportPrinterSamplesReport
例
uses FRPrinter, FRPrinter.Types; var
lPrinted: Boolean;
begin
// CLASSE DE IMPRESSÃO
try
lPrinted := TFRPrinter.New.
DataSets.
SetDataSet(qryEstadosBrasil, ' EstadosBrasil ' ).
SetDataSet(frxdbMunicipioEstado).
SetDataSet(frxdbMunicipioRegiao).
SetDataSet(qryEstadoRegiao, ' EstadoRegiao ' ).
SetDataSet(qryMunicipios, ' Municipios ' ).
& End .
Print.
SetPrinter( ' Microsoft Print to PDF ' ). // QUANDO NÃO INFORMADO UTILIZA A IMPRESSORA CONFIGURADA NO RELATÓRIO *.fr3
SetFileReport(TUtils.PathAppFileReport). // LOCAL DO RELATÓRIO *.fr3
Report(procedure(pfrxReport: TfrxReport) // CONFIGURAÇÃO DO COMPONENTE DE RELATÓRIO DO FAST REPORT
var
lfrxComponent: TfrxComponent;
lfrxMemoView: TfrxMemoView absolute lfrxComponent;
begin
// CONFIGURAÇÃO DO COMPONENTE
pfrxReport.ReportOptions. Name := ' API de localidades IBGE ' ; // NOME PARA IDENTIFICAÇÃO NA IMPRESSÃO DO RELATÓRIO
pfrxReport.ReportOptions.Author := ' Antônio José Medeiros Schneider ' ;
// PASSAGEM DE PARÂMETRO PARA O RELATÓRIO
lfrxComponent := pfrxReport.FindObject( ' mmoProcess ' );
if Assigned(lfrxComponent) then
begin
lfrxMemoView.Memo.Clear;
lfrxMemoView.Memo.Text := Format( ' Aplicativo de Exemplo: %s ' , [ ' VCL ' ]);
end ;
end ).
Execute; // PROCESSAMENTO DO RELATÓRIO/IMPRESSÃO
except
on E: Exception do
begin
if E is EFRPrinter then
ShowMessage( ' Erro de impressão: ' + E.ToString)
else
ShowMessage( ' Erro de impressão: ' + E.Message);
Exit;
end ;
end ;
if lPrinted then
ShowMessage( ' Impresso ' )
else
ShowMessage( ' Falha de impressão ' );
end ;観察
コンパイルされた例
ダウンロード:demo.zip
jmeterを使用したWebアプリケーションのパフォーマンステスト:
..FastReportPrinterSamplesJMeter
FastReportPrinterは、無料でオープンソースソフトウェアがライセンスされています