last day (15 days later) » 

10:47 PM
0
A: Crystalreportviewer fails to load anything with no exceptions

Douglas TimmsWhen you are in Visual Studio, and click on the properties of the Crystal Report, what is the value for "Build Action". Depending on how you are interacting with the report object, setting it to "Content" may help. Also, to make troublshooting easier, use a simple report with no subreports. Here...

 
I've tried changing the build action to content which was Embedded Resource previously but nothing changed. I have made up a simplest report possible with a dummy list as datasource and just one field on report. I don't even have a clue right now of what next can be done.
If i see the html through Inspect element in chrome, I see crystalreportviewer loading up an iframe with source set to as empty.html, Don't know why viewer doing that. Can you give anymore suggestions? I've added IIS_User/Network Service/Local Service in the permissions as well..
 
Is "Copy to Output Directory" set to "Always"?
OK another question just to clarify: when you run your aspx application locally, does the crystal report generate ok? Is this only a problem on the deployed application?
 
Yeah "Copy to Output Directory" set to always. No, its not even showing up locally. I get the same screen. (Attached Image):(
 
In Visual Studio, are you able to generate the report OK just by running the Crystal Designer?
 
I've a sample crystal reports project that I downloaded from here: link and surprisingly it compiles and executes successfully so it clearifies there isn't an issue setting up crystal reports on the machine.
Hi
 
10:48 PM
yes Crystal may be running fine on your dev machine, but does the crystal designer produce any output (or is the report always blank)?
 
I can see the report in the crystal designer
 
and when you go "Main Report Preview" it produces something?
 
There can be anything to do with the web.config?
Yes indeed!! It produces the expected report.
 
hmmm. my web.config has stuff like this (keep in mind im running aspx not MVC):
    <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
    <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
    <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
    <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
<add key="crystalUser" value="xxx" />
<add key="crystalPwd" value="yyy" />
<add key="crystalServer" value="111.111.111.111" />
<add key="crystalDB" value="myDB" />
  <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
That is it.
 
I've added all these assemblies and handlers in my config too. Also for reporting I'm using aspx (inside mvc)
The name of my handler in web.config was CrystalImageHandler.aspx and I see you have CrystalImageHandler.aspx_GET.
That's the only thing i see different
 
10:56 PM
Here's what I have on my aspx side:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CrystalViewer.aspx.cs" Inherits="cps2_dev2.App_Pages.Secure.CrystalViewer" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
Really nothing different from yours.
Then on the server side:
CrystalReportSource1 = CrystalRptHelpers.Crystal_SetDataSource("Voucher.rpt", txtDate, null, null);
CrystalReportViewer1.ReportSource = CrystalReportSource1;
 
Yeah and what's really hurting me is, I've a same sample project and its running successfully there.
CrystalRptHelpers?
 
THat's just my class that has a collection of Crystal helper methods. I provided the "SetDataSource" method previously in the answer.
 
Yeah I see..
 
If you tried out a completely incorrect file path, does it produce the same output?
 
Even when i run in debug mode, the report loads successfully .. I have try catch attached and i tried debugging through F10, it produces no exceptions.
I haven't tried it, just give me 5 minutes
 
11:06 PM
sorry gotta go.
 
Ok Douglas, thanks very much for the time!! I will update you..
Anyways, if i type the path wrongly, it throws an exception CrystalDecisions.Shared.CrystalReportsException: Load report failed
 

last day (15 days later) »