kas*_*hif 4 devexpress parameter-passing xtrareport
我在Windows应用程序中使用Devexpress XtraReport进行报告.我在我的XtraReport1中设置了一个参数param1,其中包含string作为类型,并使用以下代码传递参数.
private void button1_Click(object sender, EventArgs e)
{
XtraReport1 report = new XtraReport1();
report.Parameters["param1"].Value = "kashif";
report.Print();
}
Run Code Online (Sandbox Code Playgroud)
当我按下按钮1时,下面的窗口出现并询问我已经在其中显示"kashif"的param1值,按钮"提交"和"重置"我的问题是:当我按下button1时我不希望打开这个窗口我想直接传递"kashif"而不提示我输入param1值.

Ste*_*eve 12
从他们的文档如何:静默传递参数值
Add a parameter to a report, set the parameter's Modifiers property to Public, and disable the parameter's Parameter.Visible property. When there are no visible parameters in a report, their values are passed "silently" (without exposing the Parameters UI to end-users).
private void button1_Click(object sender, EventArgs e)
{
// Create a report instance.
XtraReport1 report = new XtraReport1();
// Obtain a parameter, and set its value.
report.parameter1.Value = 30;
// Hide the Parameters UI from end-users.
report.parameter1.Visible = false;
// Show the report's print preview.
report.ShowPreview();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
17920 次 |
| 最近记录: |