报告崩溃
您好,我正在尝试提供一份主详细报告。但当我点击预览的下一页时,报告总是崩溃。这两个查询在查询编辑器中都运行良好。
主报告查询
select a.Name,a.ftid,a.instno from testschema.ViewA a where a.ftid={?ftid}
在主报告中单独声明的共享变量
shared numbervar instno;
instno:={Command.INSTNO}
shared stringVar gnpidesc;
gnpidesc:={Command.Name}
子报告查询
select a.TOTALAMT,b.Name from testschema.ViewB a CROSS JOIN testschema.View3 b where a.ftid={?ftid} AND b.ftid=a.ftid AND b.instno={?instno} AND a.Name='{?gnpidesc}' ORDER BY a.GENGNPIDESC
在子报告标题中单独声明的共享变量
shared numbervar instno;
shared stringVar gnpidesc;
我已经定义了3个同名的参数字段。子报告仅显示主报告中的第一行,如果我单击下一页应用程序崩溃。
编辑 子报表在子报表标题部分包含一个交叉表报表。 报告布局
Main Report
- Details Section (Main report query)
- Details Section2 (Sub report)
- Cross-tab (Sub report Footer- Query 2)
Main Report
Hi I am trying to have a master detail report. But the report always crashes as i hit the next page on the preview. Both the queries work fine in the query editor.
Main report query
select a.Name,a.ftid,a.instno from testschema.ViewA a where a.ftid={?ftid}
Shared variables declared in main report separately
shared numbervar instno;
instno:={Command.INSTNO}
shared stringVar gnpidesc;
gnpidesc:={Command.Name}
Sub report query
select a.TOTALAMT,b.Name from testschema.ViewB a CROSS JOIN testschema.View3 b where a.ftid={?ftid} AND b.ftid=a.ftid AND b.instno={?instno} AND a.Name='{?gnpidesc}' ORDER BY a.GENGNPIDESC
Shared variables declared inside subreport header separately
shared numbervar instno;
shared stringVar gnpidesc;
I have delcared 3 parameters fields also with the same name.Sub report only shows for first row in master, if I click next page the application crashes.
Edit
The Sub report contains a cross-tab report in the sub report head section.
Report Layout
Main Report
- Details Section (Main report query)
- Details Section2 (Sub report)
- Cross-tab (Sub report Footer- Query 2)
Main Report
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我确信我以前在自己的报告中见过这种情况。您可能存在一些数据质量/一致性问题。
您的连接字段是否有空值?只需 1 条记录即可;)
您是否有引用空值字段的公式?
我不知道您的数据源是什么,但是这些视图中是否有 Crystal 无法识别的自定义公式?例如,我经常从 MS Access 查询中提取数据,但如果我使用 nz() 函数,Crystal 会抛出错误。
找到罪魁祸首的一种方法是滚动预览,直到找到无法显示并崩溃的页面。查看那里会显示哪些数据。
您必须在数据到达 Crystal 之前修复数据或重新设计函数。祝你好运。
I'm certain I've seen this before with my own reports. You probably have some data quality/consistency issues.
Do any of your joining fields have a null value? All it takes is 1 record ;)
Do you have a formulae that references a field with a null value?
I don't know what your data source is, but do any of those views have custom formulae that Crystal wouldn't recognize? For example, I often pull data from MS Access queries, but Crystal throws an error if I use the nz() function.
One way to find your culprit is to scroll through your preview until you find the page that can't display and crashes. See what data would have displayed on there.
You'll have to either fix the data before it gets to Crystal or rework a function. Good luck.