簡體   English   中英

Visual Studio 2019 和 Winforms 的 Crystal 報告太慢

[英]Crystal report too slow from Visual Studio 2019 and Winforms

我有一個表格可以打印一些使用 Crystal Report (13.030) 和 Visual Studio 2019 創建的報告。每個報告的打印大約需要 5/8 秒。 我已經嘗試了在 google 上找到的所有建議,但沒有解決任何問題。 由於報告在10m左右,客戶必須等待很長時間才能繼續。

我已經讀到這是一個已知問題,但我不知道如何解決它。 我一直在考慮在 BackgroundWorker 中進行打印,但我不確定這是否是個好主意。

我檢查了報告框中沒有打印機。 這是我的一份報告,它們都非常相似。 我錯了嗎?

ReportDocument myReport = new ReportDocument();                           
myReport.Load("myreport.rpt");
PrintLayoutSettings PrintLayout = new PrintLayoutSettings();
PrinterSettings printerSettings = new PrinterSettings();
printerSettings.PrinterName = "PDF Creator"; // Any;
PageSettings pSettings = new PageSettings(printerSettings);

myReport.SetParameterValue("var1", "123"); 
myReport.SetParameterValue("var2", "ABC"); 
myReport.SetParameterValue("var3", "DEF"); 

myReport.PrintToPrinter(printerSettings, pSettings, false, PrintLayout);

myReport.Close();

我將打印件移動到盡可能多的 BackgroundWorkers,顯然一切都非常快,即使我不知道這是否是最佳解決方案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM