[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Crystal Report Memory Error

Posted on 2014-02-27
2
Medium Priority
?
1,194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 1500 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

649 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