如果没有安装打印机,Rave 会报告出现问题
我一直在虚拟机上使用 Rave 报告测试一些 D2006 代码,发现如果没有安装打印机,当我生成 PDF 报告时应用程序会挂起。挂起发生在这里:
exception message : The application seems to be frozen.
main thread ($108):
005c5e62 +106 MyApp.exe RpRPTF SimpleTextWidth
006198f7 +31b MyApp.exe RpMemo TMemoBuf.GetLine
0061a44a +086 MyApp.exe RpMemo TMemoBuf.MemoLinesLeft
005cba28 +014 MyApp.exe RpBase TBaseReport.MemoLines
00672e8e +072 MyApp.exe MyAppReports PrintReportParagraph
00677f73 +acb MyApp.exe MyAppReports PrintSummaryReportBody
0066b208 +010 MyApp.exe MyAppMainForm TMainForm.RvSystemSummaryReportPrint
005c6f35 +015 MyApp.exe RpBase TBaseReport.PrintEvent
005c8066 +03a MyApp.exe RpBase TBaseReport.Execute
0060a299 +125 MyApp.exe RpSystem TRvSystem.GenerateReport
0060a52a +07e MyApp.exe RpSystem TRvSystem.Execute
0067d364 +0ac MyApp.exe MyAppReports DoPrintSummaryReport
0067d64d +1d5 MyApp.exe MyAppReports ProduceReports
0066e966 +1e6 MyApp.exe MyAppProcessing ProcessMyAppData
0066ab9b +0d7 MyApp.exe MyAppMainForm TMainForm.DoProcessData
毫无疑问,与页面宽度为零有关,混淆了计算页面可以容纳多少行或类似内容的代码。
问题是我正在编写 PDF - 而不是打印 - 所以我不明白为什么没有打印机会导致此代码出错(已安装 Acrobat Reader)。如果我安装打印机,它就会正常工作。为什么我需要安装打印机(该应用程序可以安装在没有安装打印机的工作站上 - 出现一条错误消息:“除非安装打印机,否则无法生成 PDF 报告”似乎有点笨拙)?
I've been testing some D2006 code using Rave reports on a virtual machine and have found the app hangs when I generate a PDF report if there is no printer installed. The hang occurs here:
exception message : The application seems to be frozen.
main thread ($108):
005c5e62 +106 MyApp.exe RpRPTF SimpleTextWidth
006198f7 +31b MyApp.exe RpMemo TMemoBuf.GetLine
0061a44a +086 MyApp.exe RpMemo TMemoBuf.MemoLinesLeft
005cba28 +014 MyApp.exe RpBase TBaseReport.MemoLines
00672e8e +072 MyApp.exe MyAppReports PrintReportParagraph
00677f73 +acb MyApp.exe MyAppReports PrintSummaryReportBody
0066b208 +010 MyApp.exe MyAppMainForm TMainForm.RvSystemSummaryReportPrint
005c6f35 +015 MyApp.exe RpBase TBaseReport.PrintEvent
005c8066 +03a MyApp.exe RpBase TBaseReport.Execute
0060a299 +125 MyApp.exe RpSystem TRvSystem.GenerateReport
0060a52a +07e MyApp.exe RpSystem TRvSystem.Execute
0067d364 +0ac MyApp.exe MyAppReports DoPrintSummaryReport
0067d64d +1d5 MyApp.exe MyAppReports ProduceReports
0066e966 +1e6 MyApp.exe MyAppProcessing ProcessMyAppData
0066ab9b +0d7 MyApp.exe MyAppMainForm TMainForm.DoProcessData
and no doubt is something to do with a page width of zero confusing the code that is calculating how many lines it can fit across the page or some such.
The thing is I'm writing a PDF - not printing - so I can't see why not having a printer should trip this code up (Acrobat Reader is installed). If I install a printer it behaves. Why do I need a printer installed (the app could be installed on a workstation without a printer installed - having an error message that says: "You can't generate a PDF report unless you install printer" seems a bit clunky) ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 Rave Reports 中长期存在的错误。这与未安装默认打印机有关。我将查找旧的 Borland/CodeGear 论坛帖子的链接(CodeNewsFast 现在似乎没有响应) 。假设打印机存在时存在问题。我不知道最新版本的 Rave 中是否已修复该问题。 (D2006 是很久以前的事了。)
如果我没记错的话,解决方案是将文本驱动程序安装到“模拟”打印机上。这使得 Rave 能够继续运作。
This is a long-standing bug in Rave Reports. It has to do with no default printer being installed. I'll look for links to old Borland/CodeGear forum posts (CodeNewsFast doesn't seem to be responding right now). There was a problem with it making an assumption about a printer being present. I don't know if it's been fixed in the most recent versions of Rave. (D2006 was quite a while back.)
If I remember correctly, the solution was to install the text driver to a "mock" printer. This allows Rave to continue to function.