?
Solved

Crystal Report Memory Error

Posted on 2014-02-27
2
Medium Priority
?
1,182 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

771 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