如何避免加载报告失败IIS 7中的水晶报告问题? [英] How to avoid Load Report failed Issue in crystal report in IIS 7?

查看:115
本文介绍了如何避免加载报告失败IIS 7中的水晶报告问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何避免加载报告失败在IIS 7中的水晶报表中出现问题。这里使用的Crystal Report版本是10.2.3600.0,Visual Studio版本是2005.在本地它很好,但在服务器负载报告中看到了失败的问题。



我们正在使用以下内容:

在页面加载后调用ViewReport函数回传和功能代码如下所示:SP $ / $


DataSet ds = new DataSet();

if(Session [ROLE]。ToString()==C3O)



{

ds =新的ActiveCardsDetails()。FetchAllActiveCardsDetails(startMonth,startYear,endMonth,endYear,corporateId,C3O);

}

else

{

ds = new ActiveCardsDetails()。FetchAllActiveCardsDetails(startMonth,startYear,endMonth,endYear,corporateId,C3) ;

}





DataTable dt = new Da taTable();

if(ds.Tables [0] .Rows.Count> 0)

dt = ds.Tables [0];

else

{

Common.showMessage(没有找到记录,这个);

返回;

}



// - 初始化CrystalReport

reportDocument = new ReportDocument();

reportDocument.Load(reportPath);

reportDocument.SetDataSource(dt);



//设置ParameterValues报告

reportDocument.SetParameterValue(@ p_FromMonth,startMonth);

reportDocument.SetParameterValue(@ p_ToMonth,endMonth);

reportDocument.SetParameterValue(@ p_FromYear,startYear);

reportDocument.SetParameterValue(@ p_ToYear,endYear);



// - 使用CrystalReportViewer绑定报告

CRVActiveCardsDetails.R eportSource = reportDocument;

CRVActiveCardsDetails.DataBind();

解决方案

检查此提示/技巧

Crystal Reports:修复加载报告失败错误。 [ ^

How to avoid Load Report failed Issue in crystal report in IIS 7. Here Crystal Report Version used is 10.2.3600.0 and Visual Studio Version is 2005.In local its fine but in Server Load Report failed issue seen.

We are using follows:
Calling the function ViewReport under Page Load post back and function code is as follows from an SP

DataSet ds = new DataSet();
if(Session["ROLE"].ToString()=="C3O")

{
ds = new ActiveCardsDetails().FetchAllActiveCardsDetails(startMonth, startYear, endMonth, endYear, corporateId,"C3O");
}
else
{
ds = new ActiveCardsDetails().FetchAllActiveCardsDetails(startMonth, startYear, endMonth, endYear, corporateId,"C3");
}


DataTable dt = new DataTable();
if (ds.Tables[0].Rows.Count > 0)
dt = ds.Tables[0];
else
{
Common.showMessage("No Records Found", this);
return;
}

//--Initializing CrystalReport
reportDocument = new ReportDocument();
reportDocument.Load(reportPath);
reportDocument.SetDataSource(dt);

//Setting ParameterValues to report
reportDocument.SetParameterValue("@p_FromMonth", startMonth);
reportDocument.SetParameterValue("@p_ToMonth", endMonth);
reportDocument.SetParameterValue("@p_FromYear", startYear);
reportDocument.SetParameterValue("@p_ToYear", endYear);

//--Binding report with CrystalReportViewer
CRVActiveCardsDetails.ReportSource = reportDocument;
CRVActiveCardsDetails.DataBind();

解决方案

Check this Tip/Trick
Crystal Reports: Fix for "Load report failed" error.[^]


这篇关于如何避免加载报告失败IIS 7中的水晶报告问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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