当通过c#
连接到水晶报告时,显示以下错误{"加载报告失败"}
在进一步检查后,我根据主题行有一个内部例外。
我正在运行visual studio并尝试连接到* .rpt报告,其中包含所有查询等以显示报告,我需要做的就是传递ID。这是一个使用firebird的桌面应用程序。例外情况发生在' myDataReport.Load(reportPath);'。
string reportPath = "..\\..\\..\\layouts\\tillreceipt.rpt";
public void passParamReport(int pIDF, int pIDT, int pRID)
{
if (File.Exists(reportPath))
{
Console.WriteLine("file exists");
ReportDocument myDataReport = new ReportDocument();
myDataReport.Load(reportPath);
myDataReport.SetParameterValue("InvIDF", pIDF);
myDataReport.SetParameterValue("InvIDT", pIDT);
myDataReport.SetParameterValue("RptID", pRID);
}
else
{
Console.WriteLine("file does NOT exist");
}
}
报告的代码在c ++中,不确定这是否意味着什么?对不起,所有这些报告genaration东西新。我已经检查了其他人有相同的问题,通常他们的情况是文件路径,但正如你可以看到我的代码,文件必须存在的加载位运行。
我已经使用CrystalDecisions.CrystalReports.Engine插入了扩展名''但是我没有使用visual studio 2010 express来创建报告,有一个单独的程序。
感谢您阅读..