You must Sign In to post a response.
  • Category: ASP.NET

    Crystal Report has an blank some times.

    I have One Problem in Long Time.I using crystal report 13.Report has been running Perfect.but sum times the page has blank.I don't know how to over come this problem.
    any one tel me am waiting very urggent
  • #751127
    Hi kirubaharan,

    It is not clear when you are getting blank crystal report. Is it the time when there is no data to display? If yes, pls refer below code:

    if (reader3.HasRows)
    {
    PayrollSystem.Report.frmReportShow myobj1 = new PayrollSystem.Report.frmReportShow();
    PayrollSystem.Report.Reports.rptPaySlip report = new PayrollSystem.Report.Reports.rptPaySlip();
    if (conn1.State != ConnectionState.Open)
    conn1.Open();
    DataTable table = new DataTable();
    SqlDataAdapter adapter = new SqlDataAdapter(Cmd3);
    reader3.Close();
    adapter.Fill(table);
    report.SetDataSource(table);
    if (conn1.State != ConnectionState.Closed)
    conn1.Close();
    myobj1.crystalReportViewer.ReportSource = report;
    myobj1.Show();
    this.Cursor = Cursors.Default;
    }
    else
    {
    this.Cursor = Cursors.Default;
    MessageBox.Show("Record(s) not found...", "Record Status", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }

    Hope this will help you.

    Thanks,
    Ram Prasad

  • #751134
    Hi,

    First of all please check the links in the datasets. SOme time blank report comes due to unused links from the data sets. Also you may try the below code to generate the report-

    private void button3_Click(object sender, EventArgs e)
    {
    SqlConnection dbconnect = new SqlConnection();
    string sql = null;

    dbconnect.ConnectionString = @"Data Source=JP-PC\SQLEXPRESS;Initial Catalog=FTSSCRIBETECH;Integrated Security=True;";
    try
    {
    dbconnect.Open();
    CrystalReport13 CR;
    CR = new CrystalReport13();
    sql = "SELECT 'TRUSTID','SUM(UPLOADLNCNT)' FROM DCLIVEJOBS GROUP BY TRUSTID";

    SqlDataAdapter sda = new SqlDataAdapter(sql, dbconnect);

    DataSet ds = new DataSet();
    sda.Fill(ds, "DataSet1");
    CR.SetDataSource(ds);



    crystalReportViewer1.ReportSource = CR;
    crystalReportViewer1.Refresh();


    dbconnect.Close();
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message);
    }
    }

    Thanks,
    Ashutosh Jha
    http://tricksroad.com

  • #751148
    Hi,

    While design the crystal report you have to placed the all filed properly in "Details" section. If you entered more space there, it may cause the blank page while running the program.

    Please cross check it once.

    -----------------------------------------------------------------------------
    Regards,
    Gopi A.
    +91 9894315571
    Skype:gopi.net
    http://asaigopi-dotnet.blogspot.in/

  • #751235
    Right click on the Details section and go to the
    Property and then select this option.


    suppress if Blank

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM


  • Sign In to post your comments