cancel
Showing results for 
Search instead for 
Did you mean: 

Using Crystal Reports 2008 causes System.AccessViolationException

Former Member
0 Kudos

The SAP OEM team has been engaged to help solve this problem as it is a high priority issue.

We are attempting to use Crystal Report 2008 with a 32-bit .NET (3.5) C# application in VS2008. When running the initial report in the Crystal Viewer there are no exceptions. However, when I try to use the viewer in any way like paging, using the group tree, exporting, or even zooming (basically anything that causes the page_load to run again), then I get the following exception:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.get_ProductLocaleID()

at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.get_ProductLocaleID()

at CrystalDecisions.ReportSource.CachedObjectReportSource.GetReport(RequestContext context, Boolean bAddToCacheWhenCreated)

at CrystalDecisions.ReportSource.CachedObjectReportSource.InternalGetReport(RequestContext context, Boolean bAddToCacheWhenCreated)

at CrystalDecisions.Web.CrystalReportSource.get_ReportDocument()

at EyeQ.AppointmentResultsReport.Page_Load(Object sender, EventArgs e) in f:\VHT\Code\Workspaces\Crystal2008Testing\WebProjects\TestApp\Report.aspx.cs:line 173

The line of code that it is referring to is attempting to access a TextObject in the report that is in the page_load

TextObject to = ((CrystalDecisions.CrystalReports.Engine.TextObject)Report.ReportDocument.ReportDefinition.ReportObjects["Text72"]);

If i remove any access to TextObject's in the report then I get the same exception when I attempt to set report parameters

Report.ReportDocument.SetParameterValue("StartDate", StartDate);

Or when I connect the report to the database...and so on and so forth. Basically, any other time the page_load runs and the report document is accessed for any reason, the same exception is thrown.

The Page Load does:

- localizing (getting text objects from the report)

- connects report tables

- sets report name (name of the report file)

- sets parameter values

A very simple report with no other manipulation work fine but the page_load MUST do these things.

This issue is seen on the development environment and on the test servers. Note that it seems that this issue has been seen by others before in varying degrees and has been reported on this forum. Any ideas as to why this is occurring and how to approach a solution would be great.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

I suggest that whom ever you are working with on the OEM sales team, creates a support case and discusses the issue with technical support. Reading over this issue, I do not think a solution will be easily found and since this is a "high priority issue" creating a phone case will be the way to go.

- Ludek

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks for your reply,

I understand what you are saying. I am simply following the instructions of the OEM team. It is important to get this resolved for business reasons.

former_member183750
Active Contributor
0 Kudos

Understood. These forums really do not lend them selves to a resolution of critical issues. These are best worked on via phone, so let's get the people you are working with on the horn.

- Ludek

eric_ocampo
Member
0 Kudos

Hi Ludek,

I am working with Arleen and her team with this. A potential OEM partnership hangs in the balance on whether or not their issue can be solved.

They do not have a support contract so this is their only option for support. Their deadline is tight to find a solution.

They do not yet have a support contract. I am on the OEM sales team and they engaged me last week. Is there anything that I can do on my side to get assistance for them?

Thanks,

Eric Ocampo

former_member183750
Active Contributor
0 Kudos

Well, for now, we'll see what we can do here. I have a few feelers out to see what else we can do, so stand by for that.

1) We want to be sure we are on the latest Service Pack:

https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe

2) Let me know if this is happening on the dev computer or after the app is deployed

3) If after the app is deployed, how is the CR runtime deployed?

4) What OS are we working with?

5) Seeing as this is a web app, does a simple win app work?

6) Can you get a sample app to work? See the sample apps here:

https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples

I'd recommend vbnet_win_simplepreviewreport.zip for a win app, vbnet_web_simplepreviewreport for a web app.

- Ludek

former_member183750
Active Contributor
0 Kudos

One other thing I was going to mention.

Rename your class called u201CReportu201D

CrystalDecisions.Web also has a class called u201CReportu201D which handles Filename changes, Datasources, Parameters and report changes. It may very well be that your class is conflicting with this class.

- Ludek

Former Member
0 Kudos

That was just an example because i was afraid that the message would be meaningless...the actual exception is

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.get_ProductLocaleID()

at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.get_ProductLocaleID()

at CrystalDecisions.ReportSource.CachedObjectReportSource.GetReport(RequestContext context, Boolean bAddToCacheWhenCreated)

at CrystalDecisions.ReportSource.CachedObjectReportSource.InternalGetReport(RequestContext context, Boolean bAddToCacheWhenCreated)

at CrystalDecisions.Web.CrystalReportSource.get_ReportDocument()

at EyeQ.AppointmentResultsReport.Page_Load(Object sender, EventArgs e) in f:\VHT\Code\Workspaces\Crystal2008Testing\WebProjects\EyeQ\AppointmentResultsReport.aspx.cs:line 173

Former Member
0 Kudos

Thanks for your reply,

1) I am on the latest service pack

2) This happens on both the development computer and after deployment

3) The runtime is being deployed through InstallShield while the application is being installed.

4) The development box is running Windows 7, the only test server we tried was Windows Server 2003 but Windows server 2008 needs to work as well.

Im in the process of getting an app to work now. Ill let you know how that goes.

Former Member
0 Kudos

I should mention that we can get a very simple report to run in the viewer with no issues (If we just need to pull data). The issue is when we need to actually modify the report in some way in the code (Set the parameters, connections, set text objects, etc), and we use the viewer in some way that we see an issue.

-- Arleen

former_member183750
Active Contributor
0 Kudos

When I was refering to:

Rename your class called u201CReportu201D

I was specifically looking at this line of code:

Report.ReportDocument.SetParameterValue("StartDate", StartDate);

E.g.; change the Report part...

Just to double check, what is the version of the crpe32.dll in c:\program files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 on both the dev box and the deployed box?

- Ludek

Former Member
0 Kudos

Ludek,

Yes Im sorry, that is what I was talking about. Any reference to Report that I made was to AppointmentResultsSource.

As for the versions, my dev box is version 12.3.3.812 (the runtime version I see in my program files is listed as SP3). The version on the deploy box is 12.3.3.812 as well.

--Arleen

Edited by: AMWVHT on Feb 10, 2011 10:46 PM

Former Member
0 Kudos

I have tried to make a sample report and I have tried to get your apps to work as well and I continue to get the following error:

An error has occurred while attempting to load the Crystal Reports runtime.

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.

Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) that contains the version of the Crystal runtime (x86, x64, or Itanium) that is required. Please go to http://www.buisnessobjects.com/support for more information.

This is definitely an interesting error. I'm going home fore the night, but we can start again in the morning.