Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 VS2010 installer setup , +
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 **************
mscorlib
Assembly Version: 2.0.0.0
 

................................................................................................................................................. "
 
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()
        {
            InitializeComponent();
        }
 
        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

            paramField.CurrentValues.Add(paramDiscreteValue);
 
 
 
            //add the parameter in the ParameterFields object

            paramFields.Add(paramField);
 
            //set the parameterfield information in the crystal report

           // crystalReportViewer1.ParameterFieldInfo = paramFields;
            rptvFbc.ParameterFieldInfo = paramFields;
 
 
            //preparing root for preview

            reportDocument.Load("FBCReport.rpt");              
            rptvFbc.ReportSource = reportDocument;
 
                            
        }
    }
}
 
 
If someone can please help me to solve my problem.
Posted 6-Jun-13 6:40am

1 solution

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

Solution 1

This Error is due to static file path given on the code
reportDocument.Load("FBCReport.rpt");
 
you can change your declaretion
 //creating an object of Report Document class
 ReportDocument reportDocument = new ReportDocument();
to
//creating a new Report (FBCReport.rpt)
ReportDocument reportDocument = new FBCReport.rpt;
 
then remove
 
  //preparing root for preview
reportDocument.Load("FBCReport.rpt"); // remove this 
  Permalink  
v2

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

  Print Answers RSS
0 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 OriginalGriff 120
3 PIEBALDconsult 110
4 BillWoodruff 85
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 7 Jun 2013
Copyright © CodeProject, 1999-2014
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