为什么Crystal Reports没有在IIS中加载? [英] why Crystal Reports not loading in IIS?

查看:79
本文介绍了为什么Crystal Reports没有在IIS中加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Crystal Reports没有在IIS中加载?许可已经给出。 cRYSTAL报告版本是10.2和VS 2005.查看报告在页面下调用Load.Load报告失败问题。

我们在页面加载下绑定报告如下:

private void ViewReport()

{

试试

{

//设置水晶报告控件。

CrystalReportCtrlSettings(CRVActiveCardsDetails);

string corporateId = string.Empty;

string reportPath = string.Empty;

corporateId = ddlCorporate .SelectedItem.Value;



//检查从日期< =到目前为止的函数

bool validateDates = ValidationDate();

if(!validateDates)

{

Common.showMessage(From Date应小于或等于To Date,这个);

返回;

}



//设置报告路径

reportPath = Server.MapPath(〜// Reports // AllActiveCardsDetails.rpt);



/ /获取填充报告的搜索条件

int startMonth = Convert.ToInt32(ddlFromMonth.SelectedValue);

int startYear = Convert.ToInt32(ddlFromYear.SelectedValue);

int endMonth = Convert.ToInt32(ddlToMonth.SelectedValue);

int endYear = Convert.ToInt32(ddlToYear.SelectedValue);



//由Seena为C3Observer中的reportDocument更改添加<​​br />
DataSet ds = new DataSet();

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



{

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

}

其他
{

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

} < br $>




DataTable dt = new DataTable();

if(ds.Tables [0] .Rows。计数> 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();

Common.UserPageAudit(Session [User]。ToString(),Active Cards Details,Session [ ROLE]。ToString(),活动卡详情查看报告);



}

catch(Exception ex)

{

Response.Redirect(../ CustomError.aspx?Err =+ ex.Message.ToString(),false);

}

}

解决方案

Quote:

查看报告在页面加载下调用。加载报告失败问题

检查此提示/技巧

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


why Crystal Reports not loading in IIS?. Permission already given. cRYSTAL Report version is 10.2 and VS 2005. View Report called under page Load.Load Report failed issue.
We are binding the report under page load as follows:
private void ViewReport()
{
try
{
//Setting the crystal report controls.
CrystalReportCtrlSettings(CRVActiveCardsDetails);
string corporateId = string.Empty;
string reportPath = string.Empty;
corporateId = ddlCorporate.SelectedItem.Value;

//Function to check whether from date <= to date
bool validateDates = ValidationDate();
if (!validateDates)
{
Common.showMessage("From Date should be less than or equal to To Date", this);
return;
}

//set the report path
reportPath = Server.MapPath("~//Reports//AllActiveCardsDetails.rpt");

//get the search criteria for populating report
int startMonth = Convert.ToInt32(ddlFromMonth.SelectedValue);
int startYear = Convert.ToInt32(ddlFromYear.SelectedValue);
int endMonth = Convert.ToInt32(ddlToMonth.SelectedValue);
int endYear = Convert.ToInt32(ddlToYear.SelectedValue);

//added by Seena for reportDocument change in C3Observer
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();
Common.UserPageAudit(Session["User"].ToString(), "Active Cards Details", Session["ROLE"].ToString(), "Active Cards Details Report Viewed");

}
catch (Exception ex)
{
Response.Redirect("../CustomError.aspx?Err=" + ex.Message.ToString(), false);
}
}

解决方案

Quote:

View Report called under page Load.Load Report failed issue.

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


这篇关于为什么Crystal Reports没有在IIS中加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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