Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

Failed to load database information.

$
0
0

Hello...

 

I am using:

Window Server 2012 64bit

VS 2012

ASP.NET 4.5

Crystal Support Pack 8

 

I have pretty simple code below.  Just take DS Table merger with .RPT file and generate a PDF.

Works fantastic when run in VS in Debug.

But crashes when run through IIS via browser (Failed to load database information).

I attached the full error stream below my code.

Please help, no idea what's wrong...

 

CODE:

---------------------------------------------------------------------------

        public void reportPdf(DataSet DS, string rptFileName, string reportDsName)

        {

            ReportDocument crystalReport = new ReportDocument();

            crystalReport.Load(System.Web.HttpContext.Current.Server.MapPath("~/Crystal/" + rptFileName));

            crystalReport.SetDataSource(DS.Tables[0]);

           

            //crystalReport.ExportToStream(ExportFormatType.PortableDocFormat);

 

 

            HttpContext.Current.Response.Clear();

            HttpContext.Current.Response.ClearContent();

            HttpContext.Current.Response.ClearHeaders();

            HttpContext.Current.Response.ContentType = @"application/pdf";

            HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=Report.pdf");

            HttpContext.Current.Response.Charset = "utf-8";

            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("windows-1250");

            crystalReport.ExportToHttpResponse(ExportFormatType.PortableDocFormat, HttpContext.Current.Response, false, "");

            // HttpContext.Current.Response.BinaryWrite(bytes);

            HttpContext.Current.Response.Flush();

            HttpContext.Current.Response.End();       

        }

---------------------------------------------------------------------------

 

 

ERROR:

 

Line 45:             crystalReport.ExportToHttpResponse(ExportFormatType.PortableDocFormat, HttpContext.Current.Response, false, "");

 

[COMException (0x800002cd): Failed to load database information.

Error in File caiRptOrigination {89BCFF9A-7C39-4BFF-A4D5-E04FF98B9C59}.rpt:

Failed to load database information.]

   CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) +0

   CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +362

 

 

[DataSourceException: Failed to load database information.

Error in File caiRptOrigination {89BCFF9A-7C39-4BFF-A4D5-E04FF98B9C59}.rpt:

Failed to load database information.]

   CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) +901

   CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +471

   CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) +802

   CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options) +156

   CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToHttpResponse(ExportOptions options, HttpResponse response, Boolean asAttachment, String attachmentName) +124

   CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToHttpResponse(ExportFormatType formatType, HttpResponse response, Boolean asAttachment, String attachmentName) +172

   ddm.reportManager.reportPdf(DataSet DS, IDataReader DR, String rptFileName, String reportDsName) in c:\ddm\ddm\reportManager.cs:45

   ddm.caiRptOrigination.btnRunReport_Click(Object sender, EventArgs e) in c:\ddm\ddm\caiRptOrigination.aspx.cs:119

   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155

   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804


Viewing all articles
Browse latest Browse all 3636

Trending Articles