【发布时间】:2009-02-09 17:08:52
【问题描述】:
我正在尝试将水晶报表导出为 pdf,然后通过电子邮件发送,但每次执行导出命令时,都会收到 ParameterFieldCurrentValue 异常。
我已经在 ReportDocument 中跟踪了 Parameter 集合的值,并且正在那里设置这些值。此外,所有四个参数都是字符串。第一个设置为允许多个值以及离散值或范围值。我调用的对话框为该参数的可选选项设置值。没有其他参数字段。但是,报告中有公式字段。
我的代码是:
SelectionDialog sd = new SelectionDialog(null, null,
@"\\er1\common\bfi_apps\ReportMasterTwo\eds\custno.csv", true, false);
DialogResult dr = sd.ShowDialog();
string filename = @"c:\documents and settings\aap\desktop\salesanalysis.pdf";
if (dr == DialogResult.OK && sd.selectedVals != null)
{
for (int i = 0; i < sd.selectedVals.Count; i++)
{
ar100SalesABC_edcustom1.Parameter_Customer_Number.CurrentValues.AddValue
(sd.selectedVals[i]);
}
ar100SalesABC_edcustom1.Parameter_Fiscal_period.CurrentValues.AddValue("1");
ar100SalesABC_edcustom1.Parameter_Fiscal_year.CurrentValues.AddValue("2007");
ar100SalesABC_edcustom1.Parameter_Product_Type.CurrentValues.AddValue("F");
ar100SalesABC_edcustom1.ExportToDisk
(ExportFormatType.PortableDocFormat, filename); // ERROR HAPPENS HERE
// .. emailing code and other stuff
}
我做错了什么?还有其他更好的方法吗?我已经尝试过导出选项,我已经尝试过 SetParameter,但我一直收到该错误。
【问题讨论】:
标签: c# pdf crystal-reports