hello sir ,
i am creating web project in asp.net visual studio 2012
and use crystal report. i have done all work . this is my code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using ClassLibrary;
using CrystalDecisions.CrystalReports.Engine;
using System.Configuration;
using CrystalDecisions.Shared;
namespace myownsite.Statemgt
{
public partial class transferhistory : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ReportDocument rptdoc = new ReportDocument();
dsTestCrystal ds = new dsTestCrystal();
SqlConnection con = DALutil.getconnection();
DataTable dt = new DataTable();
dt.TableName = "Crystal Report Example";
SqlDataAdapter da = new SqlDataAdapter("select Stud_Name, Class, Subject, Marks from Stud_Detail ",con);
da.Fill(dt);
ds.Tables[0].Merge(dt);
rptdoc.Load(Server.MapPath("SimpleCrystal.rpt"));
rptdoc.SetDataSource(ds);
CrystalReportViewer1.ReportSource = rptdoc;
}
when execute my aspx page then following error was occured..
plz help me sir. i have worried about some days. and i dont solve this proble from few days.
Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.
Source Error:
Line 29: ds.Tables[0].Merge(dt);
Line 30:
Line 31: rptdoc.Load("SimpleCrystal.rpt");
Line 32: rptdoc.SetDataSource(ds);
Line 33: CrystalReportViewer1.ReportSource = rptdoc;
Source File: E:\my practis work in .net\myownsite\myownsite\Statemgt\transferhistory.aspx.cs Line: 31
Stack Trace:
[COMException (0x80041811): Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +90
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +259
[CrystalReportsException: Load report failed.]
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +322
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +851
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +78
myownsite.Statemgt.transferhistory.Page_Load(Object sender, EventArgs e) in E:\my practis work in .net\myownsite\myownsite\Statemgt\transferhistory.aspx.cs:31
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929
Bundle of thanks sir.