locked
Crystal Reports dont work in IIS RRS feed

  • Question

  • Hello.

    I have an app w C# & MySQL using Crystal Reports. In my development environment, the app works using. But when I published, the app shows me this error:

    CrystalDecisions.CrystalReports.Engine.InternalException: No se pudo abrir la conexión. No se pudo abrir la conexión. {E403D116-A2DD-482D-947B-8D4BFFE851A8}.rpt ---> System.Runtime.InteropServices.COMException: No se pudo abrir la conexión. No se pudo abrir la conexión. Reporte {E403D116-A2DD-482D-947B-8D4BFFE851A8}.rpt at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions

    , RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase. ExportToStream(ExportRequestContext reqContext) --- End of inner exception stack trace --- at CrystalDecisions.ReportAppServer. ConvertDotNetToErom.ThrowDotNetException(Exception e) at CrystalDecisions.ReportSource. EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports. Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports. Engine.ReportDocument.ExportToStream(ExportOptions options) at CrystalDecisions.CrystalReports. Engine.ReportDocument.ExportToHttpResponse (ExportOptions options, HttpResponse response, Boolean asAttachment, String attachmentName) at CrystalDecisions.CrystalReports. Engine.ReportDocument. ExportToHttpResponse(ExportFormatType formatType, HttpResponse response, Boolean asAttachment, String attachmentName)

    I installed in the server this:

    Anyone can help me?

    Thanks.

    Ivo



    • Edited by shirivo Friday, December 19, 2014 9:21 PM
    • Moved by Kristin Xie Tuesday, December 23, 2014 10:05 AM
    Friday, December 19, 2014 9:12 PM

Answers

All replies

  • So what version on the Windows O/S is IIS running on and is it a 32bit or 64bit O/S? Is you solution a 32bit or 64bit  solution?
    Friday, December 19, 2014 9:28 PM
  • It's Windows Server 2012 Datacenter 64bit. My solution is for anycpu. 
    Friday, December 19, 2014 9:37 PM
  • Have you installed crystal reports on the server?

    If you're relying on just copying the crystal reports dll then I don't think that is sufficient.

    http://scn.sap.com/docs/DOC-7824

    I'm not 100% sure but I thought they fixed the issue which meant you had to target .net4.0

    But there's some info here:

    http://search.sap.com/ui/notes?id=0002007224&boj=/sap/bc/bsp/spn/scn_bosap/notes.do?access=69765F6D6F64653D3939382669765F7361706E6F7465735F6E756D6265723D30303032303037323234&ssocompatible

    http://wiki.scn.sap.com/wiki/display/BOBJ/Deploying+Crystal+Reports+for+Visual+Studio+2010+Runtime


    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

    Saturday, December 20, 2014 11:57 AM
  • It's Windows Server 2012 Datacenter 64bit. My solution is for anycpu. 

    If your development machine is a 32bit machine, then you are creating 32bit applications.  

    If the ODBC you are using is 32 bit, the application itself is 32bit  and IIS is running on a 64 bit O/S, then the IIS APP Pool that host the 32bit application must but be configured to use WOW64 to run the 32bit application. 

    https://help.webcontrolcenter.com/kb/a1114/how-to-enable-32-bit-application-pool-iis-7-dedicatedvps.aspx

    Saturday, December 20, 2014 4:19 PM
  • Thanks for your post.

    I had installed these:

    I tried to install the software that u said but it was the same runtime that I had already installed in the server.

    • Proposed as answer by horathor Tuesday, March 22, 2016 6:15 AM
    Monday, December 22, 2014 4:50 PM
  • Hi shirivo,

    If you are installing the Crystal Reports onto the webserver, then make sure your application is referencing the GAC assemblies and not any local assemblies in your project.  If your assemblies and version numbers are matching between your application and the GAC, then it could be application pool settings within IIS. To set this go to "Application Pools" in IIS under the server/host and go to advanced settings - enable 32 bit applications = true.  For a lot of the older apps at my job that still use Crystal, for our specific Crystal assemblies our apps require 32 bit applications to be enabled.  It may not fix your issue, but its worth a shot.

    Best of luck.

    Monday, December 22, 2014 4:58 PM
  • BTW, I reinstalled the runtime and the app is throwing a new error:

    System.Runtime.InteropServices
    .COMException (0x80004005):
     The system cannot find the 
    path specified. at CrystalDecisions.
    ReportAppServer.
    Controllers.ReportSourceClass.
    Export(ExportOptions pExportOptions, 
    RequestContext pRequestContext) at CrystalDecisions.ReportSource.
    EromReportSourceBase.ExportToStream
    (ExportRequestContext reqContext) at
     CrystalDecisions.CrystalReports.Engine.
    FormatEngine.ExportToStream(ExportRequestContext
     reqContext) at CrystalDecisions.CrystalReports.Engine
    .ReportDocument.ExportToStream(ExportOptions 
    options) at CrystalDecisions.CrystalReports.
    Engine.ReportDocument.ExportToHttpResponse(
    ExportOptions options, HttpResponse 
    response, Boolean asAttachment, String attachmentName) 
    at CrystalDecisions.CrystalReports.
    Engine.ReportDocument.ExportToHttpResponse(
    ExportFormatType formatType, HttpResponse 
    response, Boolean asAttachment, String 
    attachmentName) 


    • Edited by shirivo Monday, December 22, 2014 5:33 PM
    • Proposed as answer by horathor Tuesday, March 22, 2016 6:15 AM
    Monday, December 22, 2014 4:58 PM
  • It seems to me that you should be selecting a SAP 32bit  or 64bit solution. What is the one you have highlighted 32 or 64bit?  Again if the App Pool that host this solution is not setting at the right bit setting 32 or 64bit, I don't see how the solution is going to work,  and it's not working. That setting of the anycpu means nothing.

    What is the bit version 32 or 64 bit that you deployed to the Web server that is a 64bit machine? Do you even know? What is your development machine using a 32 or 64 bit O/S when you developed this solution on your machine?

    Monday, December 22, 2014 5:02 PM
  • There is a forum on the SAP site, by the way.

    I suggest you also post a question there.

    http://scn.sap.com/community/crystal-reports-for-visual-studio


    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

    • Proposed as answer by Kristin Xie Tuesday, December 23, 2014 9:55 AM
    • Marked as answer by Just Karl Tuesday, December 23, 2014 9:47 PM
    Monday, December 22, 2014 7:39 PM
  • I solved this problema in this way: 64bit solution, 64 bit apppool, 64 ODBC.

    Installing first the SAP Crystal Reports for Visual Studio.

    • Marked as answer by shirivo Friday, June 5, 2015 3:06 PM
    Friday, June 5, 2015 3:06 PM