Crystal Report viwer Problem
I am New In Crystal Report. I created One Crystal report in asp.net with backend c# and add charts int it.everything is gng properly b开发者_如何学编程ut when i run application . it shows only report viwer bar and gives error that the
The Report Application Server Failed
Please Help Me Out.
Thanks in Advance
There's not much detail in your question.
Anyway I found an interesting post on MSDN : http://social.msdn.microsoft.com/Forums/en/vscrystalreports/thread/a6e12469-2bf1-4c4f-b291-0cf06465b740.
Many solutions were provided there, since we have no more information from you, try them all.
- Temporary files : delete the temporary files from temp folder. And restart the system.
Cause : it happened when system was abnormal shutdown. Crystal report has temp report files in Temp folder which were not washed out. Due to this it caused Load Report failed error.
- Registry : change the PrintJobLimit from 75 to -1 in;
HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\10.2\Report Application Server\Server\PrintJobLimit
- Programmatically :
If you haven't found a solution for this yet, here is the last one. This C# example works perfectly. Here a snippit of the code below. It highlights the stuff that wasn't readily apparent from anything else one could read on the web.
private ReportDocument CrystalRpt;
//Declaring these here and disposing in the Page_Unload event was the key. Then the only other issue was the
// limitations of Crystal 11 and simultaneous access to the rpt file. I make a temp copy of the file and use that in the
// method. Then I delete the temp file in the unload event.
private ReportDocument mySubRepDoc;
private ReportClass ReportObject;
private string tmpReportName;
protected void Page_UnLoad(object sender, EventArgs e)
{
Try
{
CrystalReportViewer1.Dispose();
CrystalReportViewer1 = null;
CrystalRpt.Close();
CrystalRpt.Dispose();
CrystalRpt = null;
mySubRepDoc.Close();
mySubRepDoc.Dispose();
mySubRepDoc = null;
ReportObject.Close();
ReportObject.Dispose();
ReportObject = null;
GC.Collect();
File.Delete(tmpReportName);
}
catch
{ ...Error Handler }
}
protected void Page_Load(object sender, EventArgs e)
{
CrystalRpt = new ReportDocument();
ConnectionInfo CrystalConn = new ConnectionInfo();
TableLogOnInfo tblLogonInfo = new TableLogOnInfo();
ReportObject = new ReportClass();
TableLogOnInfo CrystalLogonInfo = new TableLogOnInfo();
ParameterField CrystalParameter = new ParameterField();
ParameterFields CrystalParameters = new ParameterFields();
ParameterDiscreteValue CrystalParameterDV = new ParameterDiscreteValue();
TableLogOnInfo ConInfo = new TableLogOnInfo();
SubreportObject mySubReportObject;
mySubRepDoc = new ReportDocument();
//Report name is sent in querystring.
string ReportName = Request.QueryString["ReportName"];
// I did this because Crystal 11 only supports 3 simultaneous users accessing the report and
// we have up to 60 at any time. This copies the actual rpt file to a temp rpt file. The temp rpt
// file is used and then is deleted in the Page_Unload event
Random MyRandomNumber = new Random();
tmpReportName = ReportName.Replace(".rpt", "").Replace(".ltr", "") + MyRandomNumber.Next().ToString() +".rpt";
File.Copy(ReportName, tmpReportName, true);
CrystalRpt.Load(tmpReportName);
精彩评论