Click here to Skip to main content
13,090,678 members (44,624 online)
Rate this:
Please Sign up or sign in to vote.
I have created a solution using C# and MS Access and in the application I have built 2 crystal reports. There are no any errors in the application either semantic, syntax or logical errors. I can successfully run the application within the VS 2010 Ultimate. But after creating the setup file I cannot generate the crystal report because the following error is displaying.

"Unhandled exception has occurred in your application..................................

Load report faild.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
CrystalDecisions.Shared.CrystalReportsException: Load report failed. ---> System.Runtime.InteropServices.COMException (0x80041811): Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.
at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
--- End of inner exception stack trace ---
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
at LankaLab.rptFbcView.rptFbcView_Load(Object sender, EventArgs e) in C:\Users\Administrator\Documents\Visual Studio 2010\Projects\LankaLab\LankaLab\rptFbcView.cs:line 82
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
Assembly Version:

................................................................................................................................................. "

and so on. To the setup solution I have added all the forms, .rpt files, .mdb i.e. the database file and other necessary files too.

Before the application is being installed I have installed the .netframework 4.0, Crystalreports runtime for x86 32 bit and so on.

If someone can please help me to solve my problem.

One of the forms that use to view the crystal report is as the following

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
namespace LankaLab
    public partial class rptFbcView : Form
        public rptFbcView()
        private void rptFbcView_Load(object sender, EventArgs e)
             //creating an object of Report Document class
            ReportDocument reportDocument = new ReportDocument();
            //creating an object of ParameterField class
            ParameterField paramField = new ParameterField();
            //creating an object of ParameterFields class
            ParameterFields paramFields = new ParameterFields();
            //creating an object of ParameterDiscreteValue class
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
            //set the parameter field name
            paramField.Name = "ParaPatID";
            //set the parameter value
            paramDiscreteValue.Value = CommonVariables.StrSuperPatID;
            //add the parameter value in the ParameterField object
            //add the parameter in the ParameterFields object
            //set the parameterfield information in the crystal report
           // crystalReportViewer1.ParameterFieldInfo = paramFields;
            rptvFbc.ParameterFieldInfo = paramFields;
            //preparing root for preview
            rptvFbc.ReportSource = reportDocument;

If someone can please help me to solve my problem.
Posted 6-Jun-13 5:40am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This Error is due to static file path given on the code

you can change your declaretion
//creating an object of Report Document class
ReportDocument reportDocument = new ReportDocument();

//creating a new Report (FBCReport.rpt)
ReportDocument reportDocument = new FBCReport.rpt;

then remove
  //preparing root for preview
reportDocument.Load("FBCReport.rpt"); // remove this 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 7 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100