none
Crystal Report generation problem RRS feed

  • Question

  • Crystal report generating blank report after generating 5 report in correct way. Again, when server is restarted it has been displaying correct report but the same problem is occurred after generating 5 reports.
    Monday, July 2, 2012 7:44 AM

All replies

  • what's your procedure for generate report.................
    Monday, July 2, 2012 11:45 AM
  • have you disposed your report document correctly?

    I think you can add following code if u r from asp.net

    protected void Page_Unload(object sender, EventArgs e)
            {
                if (rd != null)
                {
                    rd.Close();
                    rd.Dispose();
                    CrystalReportViewer1.ReportSource = null;
                    GC.Collect();
    
                }
            }


    Hasibul Haque,MCC,MCPD hasibulhaque.com

    Wednesday, July 4, 2012 9:55 AM
  • no I am not disposing

    Sorry, for long break of our communication, due to my illness

    my procedure of creating Report is:

    1.create one dataset that is connected by web.config file

    2. after creating dataset, design one .rpt file with the help of dataset

    3. then calling one method in which, load the report specifying .rpt file location and  I set the  server,database, userid and password info and then set the tablelogin info of the particular dataset

    this is the generalised procedure

    Friday, July 6, 2012 11:00 AM
  • Sorry, for long break of our communication, due to my illness

    my procedure of creating Report is:

    1.create one dataset that is connected by web.config file

    2. after creating dataset, design one .rpt file with the help of dataset

    3. then calling one method in which, load the report specifying .rpt file location and  I set the  server,database, userid and password info and then set the tablelogin info of the particular dataset

    this is the generalised procedure

    Sunday, July 8, 2012 7:42 AM
  • Have you added following line on your crystal report viewer page

    protected void Page_Unload(object sender, EventArgs e)
            {
                if (rd != null)
                {
                    rd.Close();
                    rd.Dispose();
                    CrystalReportViewer1.ReportSource = null;
                    GC.Collect();
    
                }
            }

    Here rd is report document object. You have to declare report document rd as a global variable so that you can dispose it.

    Have you loaded crystal report using Report document?

    If not first you have to add following namespace

    using CrystalDecisions.CrystalReports.Engine;

    Then you can declare ReportDocument as global variable in following way

    ReportDocument rd = null; 

    Optional

    how to load report on report document

    rd = new ReportDocument();
    rd.Load(Server.MapPath("~/Rpts/" + ReportName));

    

    Hasibul Haque,MCC,MCPD hasibulhaque.com

    Monday, July 9, 2012 3:49 AM
  • yes, I am using in the same way but not in C#.net; I am using vb.net I have added namespace

    Imports CrystalDecisions.CrystalReports.Engine

    Imports CrystalDecisions.Shared

    Imports CrystalDecisions.Shared.SearchDirection

    Imports CrystalDecisions.Web

    Imports System.Drawing

    Imports System.Data.SqlClient

    Imports System.IO

    Imports System.Web.HttpApplicationState

    Imports System.Data

    I have defined variable

    Dim rd As New ReportDocument()

    Dim aPath11 As String = System.AppDomain.CurrentDomain.BaseDirectory()

    and in a method I am defining

    rd.Load(aPath11 & Reportpaths)

    rd.SetDataSource(OutputDataSet1)

    but I am not using

    Protected Sub Page_Unload(sender As Object, e As EventArgs)

    If rd IsNot Nothing Then

    rd.Close()

    rd.Dispose()

    CrystalReportViewer1.ReportSource = Nothing

    GC.Collect()

    End If

    End Sub

    Monday, July 9, 2012 7:38 AM