将多个参数传递给Crystal Reports [英] Passing more than 1 parameter into Crystal Reports

查看:71
本文介绍了将多个参数传递给Crystal Reports的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


本周早些时候,我问了一个有关将参数传递到Crystal报表中的问题.我在跟进以下问题.

我有2个字段,例如以VB形式分配到销售总额.
我有一份水晶报告,根据2个字段的标准将打印某些信息.

我已经输入

分配给:艾伦·史密斯
成交总额:500

在我的Crystal报表上,有2个参数字段?Allocated?SalesTotal.

我想要的是,使用2个字段的值自动填充Crystal Report参数字段.

如果我只是做一个参数,它将是这样,并且此代码有效

Hi,
Earlier this week I asked a question about passing parameters into a Crystal report. I am following up the question with the following.

I have 2 field e.g. Allocated To and Sales Total in a VB form.
I have a crystal report that depending on the criteria of the 2 fields prints certain information.

I have entered

Allocated To : Alan Smith
Sales Total : 500

On my crystal report has 2 parameters fields ?Allocated and ?SalesTotal.

What I want is that the crystal report parameter fields be automatically populated with the values of the 2 fields.

If I was just doing one parameter it would be like this and this code works

parParameterField.ParameterFieldName = "AllocatedTo"
parParameterValue.Value = "Alan Smith"
parParameterField.CurrentValues.Add(parParameterValue)
parParamFields.Add(parParameterField)

''Assign parameters
MycrRpt.SetParameterValue(parParameterField.ParameterFieldName, parParameterValue.Value)


问题,如何添加另一个参数,例如salestotal


Question, how do I add another parameter e.g. salestotal

推荐答案

由于您是通过代码执行此操作的,因此请查看
Since you are doing this via code, have a look here[^].




使用reportfilename.SetParameterValue(index,value)

例如

?已分配:如果它是第一个参数,则
reportfilename.SetParameterValue(0,Allocated_To)

?SalesTotal:是第二个

reportfilename.SetParameterValue(1,Sales_Total)

注意:索引从0开始

希望这对您有帮助...
Hi,

use reportfilename.SetParameterValue(index,value)

for example

?Allocated : if it is first parameter then
reportfilename.SetParameterValue(0,Allocated_To)

?SalesTotal : is Second then

reportfilename.SetParameterValue(1,Sales_Total)

note : index starts from 0

Hope this will help to u...


这篇关于将多个参数传递给Crystal Reports的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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