将参数从Crystal Reports传递到VB.NET [英] Passing Parameters From Crystal Reports To VB.NET
本文介绍了将参数从Crystal Reports传递到VB.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我创建了一个表单,它可以加载Crystal Report(.rpt文件)并在屏幕上显示它。
Crystal报表有一个参数集提示输入一系列ID。
这意味着当我在Crystal中运行它时,系统会提示我选择一个起始ID和结束ID,并且报告仅针对此范围内的ID运行。
但是,在VB中显示报表时,它只是根据Crystal中选择的最后一组参数生成报表,并且不会让我选择每次选择不同的范围。
因此我想我可以设置一个带有文本框和组合框的表单,它将从.rpt文件中读取参数并相应地填充文本和组合框。
首先,这可能吗?
其次,我该怎么做?
干杯,
J.
我创建了一个表单,它可以加载Crystal Report(.rpt文件)并在屏幕上显示它。
Crystal报表有一个参数集提示输入一系列ID。
这意味着当我在Crystal中运行它时,系统会提示我选择一个起始ID和结束ID,并且报告仅针对此范围内的ID运行。
但是,在VB中显示报表时,它只是根据Crystal中选择的最后一组参数生成报表,并且不会让我选择每次选择不同的范围。
因此我想我可以设置一个带有文本框和组合框的表单,它将从.rpt文件中读取参数并相应地填充文本和组合框。
首先,这可能吗?
其次,我该怎么做?
干杯,
J.
Hello,
I have created a form which loads up a Crystal Report (.rpt file) and displays it on the screen.
The Crystal report has a parameter set up which prompts for a range of ID's.
This means that when I run it in Crystal, I get prompted to select a Start ID and and End ID, and the report runs for only the ID's in this range.
However, in VB when I display the report it simply produces the report based on the last set of parameters chosen in Crystal, and doesn't give me the option to select a different range each time.
Therefore I thought I could set up a form with text boxes and combo boxes on, that would read the parameters from the .rpt file and populate the text and combo boxes accordingly.
Firstly, is this possible ?
Secondly, how would I do this ?
Cheers,
J.
I have created a form which loads up a Crystal Report (.rpt file) and displays it on the screen.
The Crystal report has a parameter set up which prompts for a range of ID's.
This means that when I run it in Crystal, I get prompted to select a Start ID and and End ID, and the report runs for only the ID's in this range.
However, in VB when I display the report it simply produces the report based on the last set of parameters chosen in Crystal, and doesn't give me the option to select a different range each time.
Therefore I thought I could set up a form with text boxes and combo boxes on, that would read the parameters from the .rpt file and populate the text and combo boxes accordingly.
Firstly, is this possible ?
Secondly, how would I do this ?
Cheers,
J.
推荐答案
report.SetParameterValue(" ParameterName",value);
enu有帮助器评估参数:
report.SetParameterValue("ParameterName" ,value );
There are helper for enumerate the parameters:
foreach ( ParameterFieldDefinition param in report.DataDefinition .ParameterFields)
{
....
}
foreach( ParameterFieldDefinition param in report.DataDefinition.ParameterFields)
{
....
}
Dirk
这篇关于将参数从Crystal Reports传递到VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文