本文介绍了显示Crystal Report时加载报告失败!!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在在线服务器上显示Crystal Report时加载报告失败

但在本地运行良好且没有显示其他错误消息,因为我已经为显示加载报告路径和ControlNo添加了额外标签但未显示任何只有一个错误消息msg加载报告失败任何解决方案请帮助我!!!!



ReportDocument Rel = new ReportDocument();

Rel.Load(Server.MapPath(CallLetter.rpt));

Rel.SetDatabaseLogon(rrccr_com_dbarrc,db @ Rrcpa $$,WIN -0QBUPD9U1G2,rrccr_com_db);

Rel.SetDataSource(ds.Tables [0]);

Rel.SetParameterValue(ControlNo,ControlNo);

CrystalReportViewer1.ReportSource = Rel;

CrystalReportViewer1.DataBind();

CrystalReportViewer1.Visible = true;



BinaryReader stream = new BinaryReader( Rel.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat));

Response.ClearContent();

Response.ClearHeaders();

Response.ContentType =application / pdf;

Response.BinaryWrite(stream.ReadBytes(Convert.ToInt32(stream.BaseStream.Length)));

Response.Flush ();

Rel = null;

CrystalReportViewer1.Dispose();

CrystalReportSource1.Dispose();

Load Report Failed at Displaying Crystal Report at online server
but works well at local well and no other error message displaying as i have put extra label for displaying load report path and ControlNo but not displaying any thing only one error msg Load Report Failed any solution please help me !!!!

ReportDocument Rel = new ReportDocument();
Rel.Load(Server.MapPath("CallLetter.rpt"));
Rel.SetDatabaseLogon("rrccr_com_dbarrc", "db@Rrcpa$$", "WIN-0QBUPD9U1G2", "rrccr_com_db");
Rel.SetDataSource(ds.Tables[0]);
Rel.SetParameterValue("ControlNo", ControlNo);
CrystalReportViewer1.ReportSource = Rel;
CrystalReportViewer1.DataBind();
CrystalReportViewer1.Visible = true;

BinaryReader stream = new BinaryReader(Rel.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat));
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.BinaryWrite(stream.ReadBytes(Convert.ToInt32(stream.BaseStream.Length)));
Response.Flush();
Rel = null;
CrystalReportViewer1.Dispose();
CrystalReportSource1.Dispose();

推荐答案



这篇关于显示Crystal Report时加载报告失败!!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 23:13