如何在命令行中将参数传递给Crystal报表...? [英] How to pass parameters to a crystal report at command line......?

查看:87
本文介绍了如何在命令行中将参数传递给Crystal报表...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI ..

我使用vb6.0创建了一个exe文件,以便在命令行中运行Crystal报告文件.
它的工作正常.但是我想在命令行中将参数传递给Crystal报表文件.

有人可以在这方面帮助我吗?

请参阅以下快照以获取参考.

VB代码

< img src ="http://www.freeimagehosting.net/t/xtuko.jpg">


命令提示符检查

< img src ="http://www.freeimagehosting.net/newuploads/wb2oo.jpg">

报告输出
< img src ="http://www.freeimagehosting.net/newuploads/57a4a.jpg">

HI..

I created an exe file using vb6.0 to run a crystal report file at command-line.
Its working fine. But i want to pass the parameters to the crystal report file at command-line.

Can anybody help me in this regards...

Please see the following snaps for references.

VB code

<img src="http://www.freeimagehosting.net/t/xtuko.jpg">


Command Prompt check

<img src="http://www.freeimagehosting.net/newuploads/wb2oo.jpg">

Report Output
<img src="http://www.freeimagehosting.net/newuploads/57a4a.jpg">

推荐答案

可以传递其他参数,这仅取决于查询和报告的设计方式(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.


这篇关于如何在命令行中将参数传递给Crystal报表...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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