Arm0geddon
Arm0geddon

Reputation: 484

Crystal Reports will not render correctly

I am trying to deploy a web application to a Windows 2012 Server, but the Crystal Report Viewer will not render correctly on the server; but it works just fine locally.

enter image description here

My web.config file has the correct crystal tags:

<configSections>
    <sectionGroup name="businessObjects">
        <sectionGroup name="crystalReports">
            <section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null"/>
            <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler"></section>
        </sectionGroup>
    </sectionGroup>
</configSections>

<businessObjects>
    <crystalReports>
        <rptBuildProvider>
            <add embedRptInResource="true" />
        </rptBuildProvider>
        <crystalReportViewer>
            <add key="ResourceUri" value="/crystalreportviewers13" />
        </crystalReportViewer>
    </crystalReports>
</businessObjects>

I am using:

Upvotes: 3

Views: 6551

Answers (3)

David Gourde
David Gourde

Reputation: 3914

The problem is that Crystal Reports, by default, uses your local printer settings to generate the report and the server might have different default page settings (I have no idea why this option is by default).

To correct the situation, open Crystal Reports, in the upper left hand corner select File, then Page Setup. You will see a section called "Printer Options", check the box "No Printer".

You will then see the page as it printed on server. Correct it and it will print identically on any server.

I hope it helps.

PS: You can open Crystal Reports directly from your IDE, like Visual Studio, by opening the report file (.rpt) and selecting this menu (see picture).

Crystal Reports

PPS: It is possible I did not understand correctly the question. I searched the web and found a good and accepted answer that solved a similar problem that many persons had. The name of the topic was Crystal Reports not rendering when webpage is served outside of network. Everything worked well locally but would not render when not local: http://www.codeproject.com/Answers/361109/Crystal-Reports-not-rendering-when-webpage-is-serv#answer2

The solution explained in the link is:

Crystal report viewer is dependent upon the runtime engine installation files for .NET Framework 4 (32 & 64 bit installs). These assembly files don't get included in your .NET project.

  1. Go to the C\inetpub\wwwroot folder on any machine that has either/or crystal report runtime engine installations. For my purposes, I just went to the one on the 2008 server I'm installing on.
  2. Copy the aspnet_client folder in the wwwroot directory.
  3. Paste this folder in the website directory folder. I assume this would work with a web application that was created from a virtual directory as well, just paste it into the virtual directory.

(See full source on CodeProject.com by following the link)

Maybe this link could help you, the problem seems to involve the same technologies you specified. Is that your problem? If yes, did the answer on the provided in the link worked for you?

If none of those anwers helped you, it is possible this problem is generated by a CSS conflict between yours and the Crystal Reports CSS. If that's the case (you could try by using only CR CSS and see if the problem persist), it's possible to correct it simply by finding the conflicting CSS and remove it from your CSS.

If not, could you please be more specific about your problem, any new information would help me find the right answer for you.

Thank you, have a nice day.

Upvotes: 7

Arm0geddon
Arm0geddon

Reputation: 484

OK, so after weeks of head scratching, bounty offering, and Googling, I finally figured out the problem. The Crystal Runtime was working fine, it was a browser-compatibility-CSS issue. I added the follow meta tag to the page, and now it renders just fine in IE.

<meta http-equiv="X-UA-Compatible" content="IE=9">

Unfortunately, it still does not render properly in Chrome, but that's a whole-nother problem.

Upvotes: 0

Tharif
Tharif

Reputation: 13971

One of the possible cause of the problem may be Crystal Reports runtime is installed, but your application is not running under default web site.

Work around for the issues is to Copy aspnet_client folder from c:\inetpub\wwwroot folder to the new website root folder.

Entire Steps are discussed below :

Crystal Report Issue with IIS - ( bobj is undefined , Crystal report not displaying )

More Reference :

Crystal report not working outside the network

Upvotes: 2

Related Questions