且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在命令行中将参数传递给Crystal报表...?

更新时间:2022-01-14 00:39:54

可以传递其他参数,这仅取决于查询和报告的设计方式(Peoplesoft提供了每种设计类型的一些报告).建议的一种方法是创建运行控制记录,将其连接到查询中的记录,然后仅将OPERID和RUN_CONTROL传递给Crystal报表.

对于财务系统中的一个示例(不确定您拥有的模块),请查看提供的APY1011-的水晶报表(及相关页面)(这是AP系统的控制组寄存器),它传递OPERID和RUN_CONTROL到参数行末尾的Crystal报表(HANSBERK和KARRIEH_AP分别是传递的值):
C:\ fs \ fs850 \ BIN \ CLIENT \ WINX86 \ PSCRRUN.EXE -CTORACLE -CDFSPRD -COHANSBERK -CPOPRPSWD -I741559 -RP"APY1011-" -OT6 -OP"C:\ fs \ FS850CFG \ appserv \ prcs \ FSPRD \ log_outp ut \ CRW_APY1011-_741559"-LGENG -OF2 -ORIENTL" HANSBERK" KARRIEH_AP"

另一种设计是跳过运行控制记录/页面的概念,仅将参数直接传递给查询/晶体报告,以这种方法为例,签出GLC7501-报告(从日记帐打印下拉菜单中的日记帐分录打印"中调用).日记帐行选项卡),它将业务单位,日记帐ID和日期传递到查询/晶体报表(参数行中的最后3个值:分别为CWUID,0000235667和2010-12-30):
C:\ fs \ fs850 \ BIN \ CLIENT \ WINX86 \ PSCRRUN.EXE -CTORACLE -CDFSPRD -COAUXSTUD1 -CPOPRPSWD -I741607 -RP"GLC7501-" -OT6 -OP"C:\ fs \ FS850CFG \ appserv \ prcs \ FSPRD \ log_outp ut \ CRW_GLC7501-_741607"-LGENG -OF2" ENG"-ORIENTL" CWUID" 0000235667" 2010-12-30"

因此,应该能够将所需的任何参数传递给基础查询/水晶报表,这仅取决于您如何设计和构建查询/报表以及所需传递的信息类型.如果将许多值传递给报表,则运行控制选项可能会更好,因为可能会出现命令行太长而被截断的问题,并且我们已经看到,当命令行太长时会丢弃某些参数,这会导致奇怪的结果.
It is possible to pass other parameters, it just depends on how your query and report are designed (Peoplesoft delivers some reports of each design type). The suggested method of creating a run control record, joining to that record in your query, then passing just the OPERID and RUN_CONTROL to the Crystal report is one method.

For an example of this in the Financial system (not sure which modules you have) look at the delivered crystal report (and associated pages) for APY1011- (this is a control group register from the AP system), it passes the OPERID and RUN_CONTROL to the crystal report at the end of the parameter line (HANSBERK, and KARRIEH_AP are the passed values respecively):
C:\fs\fs850\BIN\CLIENT\WINX86\PSCRRUN.EXE -CTORACLE -CDFSPRD -COHANSBERK -CPOPRPSWD -I741559 -RP"APY1011-" -OT6 -OP"C:\fs\FS850CFG\appserv\prcs\FSPRD\log_outp ut\CRW_APY1011-_741559" -LGENG -OF2 -ORIENTL "HANSBERK" "KARRIEH_AP"

The other design is to skip the run control record/page concept and just pass the parameters directly to the query/crystal report, for an example of this method check out the GLC7501- report (Journal Entry Print called from the dropdown process box on the Journal Lines tab), it passes the business unit, Journal ID, and Date to the query/crystal report (last 3 values in the parameter line: CWUID, 0000235667, & 2010-12-30 respectively):
C:\fs\fs850\BIN\CLIENT\WINX86\PSCRRUN.EXE -CTORACLE -CDFSPRD -COAUXSTUD1 -CPOPRPSWD -I741607 -RP"GLC7501-" -OT6 -OP"C:\fs\FS850CFG\appserv\prcs\FSPRD\log_outp ut\CRW_GLC7501-_741607" -LGENG -OF2 "ENG" -ORIENTL "CWUID" "0000235667" "2010-12-30"

So there should be the ability to pass any parameters you want to the underlying query/crystal report, it just depends on how you design and build the query/report as to what type of info you need to pass it. If passing many values to the report, the run control option would probably be better, as there can be issues with excessively long command lines getting truncated and we have seen some parameters get dropped when the command line gets too long which can cause strange results.