Java水晶报表SDK - 报表& SubReport [英] Java Crystal Report SDK - Report & SubReport

查看:357
本文介绍了Java水晶报表SDK - 报表& SubReport的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用由主报表和子报表组成的Java中的Crystal Report SDK生成报表。



我想生成报表有一些返回由我的存储过程,为此,我手动执行proc并启动报告生成只有当我的ResultSet!= null。



但是,我的子报告




  • 我的主报表使用setTablesDatasource()方法来使用我的ResultSet

  • 对于我的子报表:



_我使用setTableslocation()获取值并通过crystal生成报表

_我设置了我的子报表的ParameterFieldController中需要的所有参数。



但是,


缺少参数值。错误代码:-2147217394错误代码
name:missingParameterValueError


即使子报表的参数设置正确。



没有子报表或报表和没有必要的参数,生成就好了。



我是否以错误的方式设置参数?

解决方案

在尝试了很多用于集成我的子报表而不使用另一个ResultSet的东西之后,下面是设置子报表的参数的方法:



你必须使用ParameterFieldController主报表,而不是子报表的一个...逻辑。


ParameterFieldController paramFieldController =
rptClientDoc.getDataDefController()。getParameterFieldController ();
paramFieldController.setCurrentValue(subreport_name,parameter_name,
parameter_value);


现在,


I'm trying to generate a report using Crystal Report SDK in Java composed by a main report and a subreport.

I do want to generate the report only if there is something returns by my stored procedure and for doing that I execute the proc manually and launch the report generation only if my ResultSet != null.

But, my subreport has to be generated through Crystal.

  • I use the setTablesDatasource() method for my main report for using my ResultSet
  • For my subreport:

_ I use the setTableslocation() for getting the values and generating the report through crystal

_ I set all the parameters needed in the ParameterFieldController of my subreport.

However, I'm getting this error in my console :

Missing parameter values.---- Error code:-2147217394 Error code name:missingParameterValueError

Even though the subreport's parameters are correctly setted.

If I generate my report with no subreport or with report and no needed parameter, the generation is just fine.

Am I setting my parameters in a wrong way ?

解决方案

After trying a lot of stuff for integrating my subreport without using another ResultSet, here is the way for setting the parameters for the subreport :

You have to use the ParameterFieldController of the main report and not the one of the subreport... Logic.

ParameterFieldController paramFieldController = rptClientDoc.getDataDefController().getParameterFieldController(); paramFieldController.setCurrentValue(subreport_name, parameter_name, parameter_value);

And now, it works just fine !

这篇关于Java水晶报表SDK - 报表& SubReport的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆