locked
Resolved problem showing Crystal Report 12 reports for VS 2010 and IE9, Firefox, Chrome RRS feed

  • Question

  • User1057349292 posted

    Another thread here has highlighted all sorts of problems folks have had trying to get the CR viewer to display reports in IE9 and other contexts.  After a great deal of dissection, I have discovered that when the report frame loads, inside it, it wants to resolve CR javascript files that live at the relative location "..\aspnet_client\system_web\4_0_30319\crystalreportviewers12\js" .  However, by default, there is no such crystalreportviewers12 directory created by the Crystal install process.  Copying the contents of C:\inetpub\wwwroot\aspnet_client\system_web\2_0_50727\crystalreportviewers12 to C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers12 and setting the permissions for Everyone to Read provides all the js files that the viewer needs to use when it generates a report.  These are just REGULAR DIRECTORIES under the website, NOT VIRTUAL DIRECTORIES.  Do not create them as VDs.

    When the same problem occurs in Visual Studio, it is because the directory C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETClientFiles\crystalreportviewers12   does not exist at all after Crystal install.  Copy the contents of C:\Windows\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\crystalreportviewers12 to the new parallel location  intact and then Visual Studio can resolve the stuff as well and show reports in debug or whatever mode within the  IDE.

    For release 11 of Crystal (XIR2), you should, umm, set 12 in these names to be 11, but you knew that, right?

    Within web.config for your web application, be sure you are referencing the correct assemblies. 

    My system.web section (partial) looks like this:

    <system.web>
        <compilation debug="true" targetFramework="4.0">
          <assemblies>
            <add assembly="CrystalDecisions.CrystalReports.Engine, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
            <add assembly="CrystalDecisions.ReportSource, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
            <add assembly="CrystalDecisions.Shared, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
            <add assembly="CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
            <add assembly="CrystalDecisions.Enterprise.Framework, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
            <add assembly="CrystalDecisions.Enterprise.Desktop.Report, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
            <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
            <add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
            <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
            <add assembly="CrystalDecisions.Enterprise.Viewing.ReportSource, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
          </assemblies>
        </compilation>

    You will note that these references are for CR 12.  Also, since I have developer, my assemblies may be different, but generally speaking yours should match these names and only differ by rev #.  Here is my section from an earlier version of my application that used CR 11.5 (XIR2) - in fact in this case the developer was actually running CR 10 in Visual Studio but we deployed CR 11.5 so these rev # were updated.  There are only 3 files here and it may be that is all that is needed but frankly I am so sick of figuring this out Cry that I am letting sleeping dogs lie.

    <system.web>
            <compilation debug="true" targetFramework="4.0">
                <assemblies>
                    <add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                    <add assembly="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                    <add assembly="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/></assemblies></compilation>

    For CR 12, SAP has made EXPORT not functional in the viewer as far as I can tell.  It relies on an enterprise dll (read 'Report Server') that is just not part of the standard runtimes and cannot be redistributed AFAICT.  My application does not need this functionality anyway, nor is it a great idea to permit data export from a website that the public cna access (in my situation).

    Hence, my code to generate the report has a snippet below to turn off the export button in the crystalReportViewer control on the web page:

    ...

    ...

       crystalReportViewer.HasExportButton = (allowExport == "Y");    /// NOT ON MY SITE.  DOES NOT WORK.
                        crystalReportViewer.PrintMode = CrystalDecisions.Web.PrintMode.Pdf;
                        crystalReportViewer.HasPrintButton = true;

    You will also note that the only print allowed is to PDF.  COnsider the implications of permitting a 10000 page print out to a real printer from the CRViewer in your web app.  Does not sound so nice, so we only permit PDF generation and view for 'printing'.

    All of the other witchcraft related to DLL registration and what not seemed to have NO benefit but making the js files available worked true magic.

    My Environment:

    Win 7 Ultimate

    IIS7

    VS 2010

    CR 12 SP5 (2008)

    Thursday, July 19, 2012 8:10 AM

Answers

  • User1057349292 posted

    That is the point.  Up until I did all this the reports did not show up in VS 2010.  Now they do.   I have disabled the Export button however programmatically as shown above.  Export is now an Enterprise functionality apparently.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 31, 2012 8:13 AM

All replies

  • User1196771204 posted

    hi there

    Are you able to run your report properly? 

    Tuesday, July 24, 2012 1:00 AM
  • User1057349292 posted

    That is the point.  Up until I did all this the reports did not show up in VS 2010.  Now they do.   I have disabled the Export button however programmatically as shown above.  Export is now an Enterprise functionality apparently.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 31, 2012 8:13 AM