cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Corrupt Problem with Crystal report CRforVS_13_0_13

Former Member
0 Kudos

I am having Issue Running Crystal Report in Visual Studio 2010, Framework 4.0.

I Reinstall Crystal Report with CRforVS_13_0_13.exe

I am getting "An error occurred creating the form. See Exception.InnerException for details.  The error is: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Error.

Please provide solution for this Problem;

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I am also getting error "An error occurred creating the form. See Exception.InnerException for details.  The error is: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception."

Its very confusing first i get memory error and after sometimes i tried and it is giving me above error.

Answers (3)

Answers (3)

Former Member
0 Kudos

Does anyone has any answer for this problem?

former_member183750
Active Contributor
0 Kudos

So, what happens if you create a new one line app:

CrystalReportViewer1.ReportSource = <path to report>

When you run the above, the report will prompt for a database login. Fill that out. Does that work?

If it does, modify the app:

    Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
    crReportDocument.Load("C:\WindowsApplication5\test.rpt")
    CrystalReportViewer1.ReportSource = crReportDocument

Again, you will be prompted for a log on, but now you are using the report engine to run the report as opposed to the viewer above. If this works, add your logon code. Something like:

Dim crReportDocument As CrystalReport1
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo

    crConnectionInfo = New ConnectionInfo()
    With crConnectionInfo
        .ServerName = "escalade"'physical server name
        .DatabaseName = "Pubs"
        .UserID = "sa"
        .Password = "admin"
    End With

    'Get the table information from the report
    crDatabase = crReportDocument.Database
    crTables = crDatabase.Tables

    'Loop through all tables in the report and apply the connection
    'information for each table.
    For Each crTable In crTables
        crTableLogOnInfo = crTable.LogOnInfo
        crTableLogOnInfo.ConnectionInfo = crConnectionInfo
        crTable.ApplyLogOnInfo(crTableLogOnInfo)
    Next

If this is a critical issue, consider creating a phone case here:

Crystal Single Case Technical Support - SAP Business Objects US Online Store | SAP Online Store

- Ludek

Former Member
0 Kudos

The one line application did not ask for any user name or password, it is directly displaying the report.

Former Member
0 Kudos

I have added Blank report for this testing. do you want me to create it through wizard with database details?

former_member183750
Active Contributor
0 Kudos

There are only two instances where a report will not ask for db logon:

1) It has saved data

2) it is using trusted connection

In the 1st case, either remove the options "Save Data" with report or hit the refresh button in the viewer.

In the 2nd case, you do not need any logon code at all.

- Ludek

Former Member
0 Kudos

I created totally new report and used my original query in it, it is working fine now. i created seperate project for this. my original project uses .ttx and i guess thats the problem.

i will implement this report in my main project and see if it works or not.

I have two more question 1. my old project uses CRAXDDRT, i dont know how do i replace this in CR13 version for Parameters. Please guide me in this and

2. do i need to use Report.close, Report.Dispose and GC.collect ?

Thank you.

former_member183750
Active Contributor
0 Kudos

Ahhh - yeah. Mentioning ttx would have been good . TTX was retired a long, long time ago.

As for craxddrt.dll. This dll was part of the Report Designer Component (RDC) SDK. That SDK was retired in CR XI R2 (11.5.x), which has been out of support for a few years now.

And while you will find craxddrt.dll on your VS computer that has "CR13" on it, you are not licensed to use it. The file is there for internal purposes only. Additionally, even if you decide to forgo the licensing, you will never, ever be able to install the app on another computer as there are no runtime files for it (e.g.; no msm, msi, clickonce). And trust, you'll never ever figure out what dlls to deploy creating your own deployment package.

So. First thing to do is to get away from TTX files. Use the search term 'crystal ttx net' in the search box in the top right corner for more info. Then use the CR assemblies for .NET to build a new app.

- Ludek

Former Member
0 Kudos

Ludek,

What do you mean CR Assemblies? do i need to add this somewhere in my project or windows?

i am able to run the rport first time and still getting memory error second time.

former_member183750
Active Contributor
Former Member
0 Kudos

"TTX was retired a long, long time ago."  Sounds convenient for SAP, but what about us users?  I currently want to use the TTX functionality, and build my dataset within VB, just like I do for the screen, then pass the dataset to the Crystal Report.  One advantage of this is it will allow me to see (in debugger) when data retrieval completes, and when report rendering begins.  We had a crystal report a while back that hung on a users machine, and there isn't much of a way to debug in Crystal's "black box" DB implementation.


Complete dearth of documentation on this, thanks SAP.  Obviously, SAP doesn't want to support this functionality, as they would rather force you to do everything using Crystal's DB engine.  I saw that you recommended to a user to go with an XML format - I find no documentation whatsoever on doing a TTX type implementation with an XML file.


But, as far as your comment about not supporting TTX, this is from the Crystal Reports 2013 online PDF user guide (page 623):

========================================================

25.2.4.14 Active Data

Crystal Reports can be used to report off ActiveX data sources, including ActiveX Data Objects (ADO), Remote Data Objects (RDO), and Data Access Objects (DAO). Reports created off these data sources can be used in Visual Basic applications that use these ActiveX data sources. Visual Basic applications, Crystal Reports also supports Crystal Data Objects (CDO), which are sets of relational data created at runtime using Visual Basic

arrays.

Crystal Reports also offers the ability to create reports without specifying an actual data source. This is supported through the use of a Data Definition file, which is an ASCII text file with placeholders to represent database fields. By using reports created off a Data Definition File, an application developer has the flexibility of specifying the actual data source at runtime.

========================================================



Again, dearth of information regarding details of the 2013 implementation, but I did see somewhere that the Data Definition File mentioned above is still actually a TTX file.


So, anybody have any details on TTX type functionality for Crystal Reports 2011/2013?  And please, I need some concrete details, not "try an XML implementation..."

Former Member
0 Kudos

Do we simply use an XSD file instead of a .TTX file????  The XSD is clearly more of a "standard", but definitely seems like overkill just to define report placeholders...

ido_millet
Active Contributor
0 Kudos

Please move the the CRVS forum.

Former Member
0 Kudos

What do you mean move the CRVS forum>

former_member183750
Active Contributor
0 Kudos

Hi Ketan

I moved your post to SAP Crystal Reports, version for Visual Studio

As for the error:

Confirm this is happening on your development computer?

Does the report work in the CR designer?

What database are you using?

How are you connecting to the database?

At what point in your code do you get the 1st error? The 2nd error?

What is the app doing? Printing, viewing, exporting? Batch processing?

Web or win app?

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter

Former Member
0 Kudos

Ludek,

Here are the details you need.

Confirm this is happening on your development computer? - Yes Development Machine

Does the report work in the CR designer? Yes

What database are you using? SQL Server

How are you connecting to the database? ADODB Connection

At what point in your code do you get the 1st error? The 2nd error? When i am trying to show the Report form, it is going to the crystal report.vb and try to load  MyBase.New and gives me error there. if i do debug then it works and try to load the report and throw exception when i am trying to get the top value of the report, and load only blank report. second time it gives me Memory usage error.

What is the app doing? Printing, viewing, exporting? Batch processing? Right now it only fetches data from database and display in report. it was old Vb6 report which i am using it is Vb.Net 2010

Web or win app? Windows App.

former_member183750
Active Contributor
0 Kudos

A  question &/ suggestion:

What CR files are you referencing in your app?

For MS SQL, follow this:

For OLE DB use:

MS SQL 2005 - OLE DB Provider

MS SQL 2008 - SQL Native 10

MS SQL 2012 - SQL Native 11

MS SQL 2013 - SQL Native 11

- Ludek

Former Member
0 Kudos

Ludek,

I am using

CrystalDecisions.CrystalReports.Engine

CrystalDecisions.Shared

CrystalDecisions.ReportSource

CrystalDecisions.Windows.Forms

do you mean when i am trying to connect the database, do i need to use the way you mentioned?

former_member183750
Active Contributor
0 Kudos

Yes. You must have the client for the DB installed. Now, you mention that the report works in the Designer. Is this in the Designer that is part of the VS IDE, or a stand-alone version of CR?

- Ludek

Former Member
0 Kudos

Its a part of IDE, and I have sQL Server installed on my machine.

Former Member
0 Kudos

Hi,

See this: c# - Attempted to read or write protected memory. This is often an indication that other memory is c...

This issue was thrown by some unknown DLL or missing DLL.

--DJ

Former Member
0 Kudos

I tried everything from the link you send me but still not working.