Solved

Crystal Report Memory Error

Posted on 2014-02-27
2
1,121 Views
Last Modified: 2014-03-21
Hi,

I`m running an application built in vb.net 2010, there's a form with a crystal report that's giving my some trouble. The program is installed on 5 PC's and only 1 of them is randomly giving me this error when I open up the form : attempted to read or write protected memory. this is often an indication that other memory is corrupt. - the program then crashes! The log describes that crystal report crashed because of this memory error.

There all running windows 7 pro 64bit...

I have no idea what's triggering it, and why only on this one computer! No one else gets this error!

Any help would be appreciated!
0
Comment
Question by:FCapo
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39893735
I assume you are using the version of Crystal for VS2010?

WHat code are you usig to run the report?

Do all machines have the memory configuration?

Are these single user machines or are they shared among several users?

Is it the same user with the issue?
If so does the user have the problem if they run from one of the other machines?

mlmcc
0
 

Author Comment

by:FCapo
ID: 39894980
Hi Mlmcc,

Thank you for the help!

It turns out actually that everyone has this problem, I only realized it after I reset their computers!

I know what provokes the issue, please allow me to explain:

I've attached a screen capture just to explain better,

It's a timesheet program I built for my employees, allowing them to enter their hours and see a report of the hours they've entered!

In the screen capture (01.jpg), when they click on a day of the calendar, it filters the bindingsource in the datagridview to show only the hours of the employee for that particular day; then in the datagridview they can add/modify/delete records and proceed to save their changes.

The problem occurs when I click on the "Rapport" button, which opens up the form with the crystal report, of course the report and the program are both connecting to the same database and table.

The problem happens based on a sequence of events :
If when I first open the program I click on "Rapport", the report loads without any problems! But if when I first open the program, I click on the calendar and then click on "Rapport" then everything crashes with that memory error!

The code taking place when a user clicks the calendar is :
    Private Sub MonthCalendar1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MonthCalendar1.MouseDown
        FeuillesDeTempsDataGridView.AllowUserToAddRows = True
        If NCLDataSet.FeuillesDeTemps.GetChanges(DataRowState.Added + DataRowState.Modified + DataRowState.Deleted) IsNot Nothing Then
            If MessageBox.Show("Des changements ont été éffectués sur une feuille de temps sans les sauvegarder, voulez-vous sauvegarder les changements?", "Feuille De Temps", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) = Windows.Forms.DialogResult.Yes Then
                Button1.PerformClick()
            End If
        End If

        Dim t As String = MonthCalendar1.SelectionStart.ToShortDateString
        Me.FeuillesDeTempsTableAdapter.FillBy(NCLDataSet.FeuillesDeTemps, empName, t)
        Total()
        Label6.Text = ""
        findProjet()

    End Sub

Open in new window

The Total() is used to calculate the totals at the bottom of the datagridview, the code is :

    Private Sub Total()

        Dim heures, km, heuresP, dep As Double

        For i = 0 To FeuillesDeTempsDataGridView.RowCount - 1
            If FeuillesDeTempsDataGridView.Rows(i).Cells(3).Value Is DBNull.Value = True Then
                FeuillesDeTempsDataGridView.Rows(i).Cells(3).Value = 0
            Else
                heures += FeuillesDeTempsDataGridView.Rows(i).Cells(3).Value

            End If

        Next

        For i = 0 To FeuillesDeTempsDataGridView.RowCount - 1
            If FeuillesDeTempsDataGridView.Rows(i).Cells(6).Value Is DBNull.Value = True Then
                FeuillesDeTempsDataGridView.Rows(i).Cells(6).Value = 0
            Else
                km += FeuillesDeTempsDataGridView.Rows(i).Cells(6).Value
            End If
        Next

        For i = 0 To FeuillesDeTempsDataGridView.RowCount - 1
            If FeuillesDeTempsDataGridView.Rows(i).Cells(4).Value Is DBNull.Value = True Then
                FeuillesDeTempsDataGridView.Rows(i).Cells(4).Value = 0
            Else

                heuresP += FeuillesDeTempsDataGridView.Rows(i).Cells(4).Value
            End If
        Next

        For i = 0 To FeuillesDeTempsDataGridView.RowCount - 1
            If FeuillesDeTempsDataGridView.Rows(i).Cells(5).Value Is DBNull.Value = True Then
                FeuillesDeTempsDataGridView.Rows(i).Cells(5).Value = 0
            Else

                dep += FeuillesDeTempsDataGridView.Rows(i).Cells(5).Value
            End If

        Next     

        txtHeures.Text = heures
        txtHeuresP.Text = heuresP
        txtKilo.Text = km
        txtDep.Text = FormatCurrency(dep)

    End Sub

Open in new window

I'm coding the application on my PC, which has win7 32bit installed, the app is being installed on 64bit win7 computers,

In the project settings, I set target CPU to x86 with .net framework 3.5

the form that has the crystal report has this code :
Public Class weeklyReport

    Private Sub weeklyReport_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        weeklyRpt1.Dispose()
    End Sub

    Private Sub weeklyReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


        Dim param1Fileds As New CrystalDecisions.Shared.ParameterFields
        Dim param1Field As New CrystalDecisions.Shared.ParameterField
        Dim param1Range As New CrystalDecisions.Shared.ParameterDiscreteValue

        param1Field.ParameterFieldName = "paraName"
        param1Range.Value = My.Settings.empName
        param1Field.CurrentValues.Add(param1Range)
        param1Fileds.Add(param1Field)
        CrystalReportViewer1.ParameterFieldInfo = param1Fileds

    End Sub
End Class

Open in new window


Also on each of their computers, I installed CRforVS_redist_install_32bit_13_0_8

I tried installing the 64bit version of CRforVS but it gives me a different set of errors!

I really appreciate any help you can give me!

Thank you!
01.jpg
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now