Link to home
Start Free TrialLog in
Avatar of kamlesh lalwani
kamlesh lalwani

asked on

crystal report problem

when i print crystal report more then 75 times then it give error
Avatar of Raghavendra Hullur
Raghavendra Hullur
Flag of India image

Hi,

What is the error message you get?
Can you share the screenshot of the error?
Avatar of kamlesh lalwani
kamlesh lalwani

ASKER

User generated image
When i open more then 75 times then it give error
Few points to check are:

The heap memory set for the underlying application as that might be an issue and report execution might have run out of memory when it was run for more than 75 times.

Couple of other things to check are:

1. Whether there is any permission issue to run the report. I think this is unlikely as you are able to run the report for 75 times.
2. To check whether there is any issue with the given path for the report and I guess this is also not an issue with your report since it is being executed.
It will also be helpful if you can copy and share the full error message from log file
do you properly close & dispose your report?
Here's relevant information from Ludek Uher at SAP:
-------------------------------------------------------------------------------
Crystal Reports Maximum Report Processing Jobs Limit
Developers using Crystal Reports in Visual Studio .NET web applications occasionally encounter the preset 75 print job limit. This article discusses possible solutions and work-arounds.

https://archive.sap.com/documents/docs/DOC-21533
https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/f053713e-3e3d-2c10-2a81-f79259e54023&overridelayout=true
also check your temp folder and PrintJobLimit registry value as shown in https://remiware.co/2015/07/08/solving-the-load-report-failed-error/
Are you doing this from the Crystal designer or from a viewing application?

Are you printing from the print Icon or is it printing directly from code?

What version of Crystal?

mlmcc
I DO ALL THINGS OF ABOVE BUT STILL THEIR IS A PROBLEM

This code create a problem if i open this crystal report more then 75 times..

MY CODE IS :





        Try
            cmd = New MySqlCommand("select * from bill_tbl", con)
       

            sqlda = New MySqlDataAdapter(cmd)
            sqlda.Fill(ds, "bill_tbl")
            crystalReport.Load("E:\universal\software\hotel rainbo\restaurent\restaurent\report_bill.rpt")

            crystalReport.SetDataSource(ds)
            CrystalReportViewer1.ReportSource = crystalReport




            CrystalReportViewer1.Refresh()



        Catch ex As Exception
            Dim msg As String = ex.Message

        End Try

        crystalReport.PrintToPrinter(1, True, 0, 0)

        ds.Dispose()
   
        cmd.Dispose()
        crystalReport.Clone()
        crystalReport.Close()
        crystalReport.Dispose()
        GC.Collect()

        ds.Clear()
        Me.Close()
why are you calling the Clone method (just before the Close)?

You have modified the registry?

You are clearing the temp folder?
Yes i do.. but still probem
are you printing your reports in a loop? I would try to clean the temp folder in that loop. Add a counter to your loop (or use the modulo operator) and at 50 reports, cal this method:
Public Shared Sub DeleteCrystalTempFiles()
    Dim strPath As String = IO.Path.GetTempPath

    For Each f As String In IO.Directory.GetFiles(strPath, "*}.rpt")
        Try
            IO.File.Delete(f)
            Trace.WriteLine("Crystal Report temp file " + f + " deleted.")
        Catch ex As Exception
            Trace.WriteLine("Failed to delete Crystal Report temp file " +
                            f + " (" + ex.ToString + ".")
        End Try
    Next
    For Each f As String In IO.Directory.GetFiles(strPath, "~cpe{*}.tmp")
        Try
            IO.File.Delete(f)
            Trace.WriteLine("Crystal Report temp file " + f + " deleted.")
        Catch ex As Exception
            Trace.WriteLine("Failed to delete Crystal Report temp file " +
                            f + " (" + ex.ToString + ".")
        End Try
    Next
End Sub

Open in new window

Is E: a mapped drive or a local drive?

Are there multiple copies of the report file?

mlmcc
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.