Skip to content

How to print without going to crystal Report Viewer

Rethinam prasath

Asked Nov 24, 2011, 3:29 AM EST1 answer
Share
LinkedInX
Hi


I am create one Medical Projects.In this project i have used billing report (Crystal Report).I have used one button that is Print button,When i am clicking the print button  directly go to printer(without going to crystal report)

It is possible or not.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi

    Yes, its possible.

    Try like this :

    FROM 1 - CRViewer
    ---------------------------------------------------------------
    public void printReport()
    {

    ReportDocument repLoad = new ReportDocument();
    repLoad.Load("C:\\crreport.rpt");

    DialogResult dr = new DialogResult();


    if (dr != DialogResult.OK)
    {

    crViewer.ReportSource = repLoad; // crViewer is CrystalReportViewer
    crViewer.PrintReport();

    }

    else
    {

    MessageBox.Show("Error printing", "Info");

    }


    }
    -----------------------------------------------------------------
    FORM2

    private void crPB(object sender, EventArgs e)
    {
    FORM1 frmB = new FORM1();
    FORM1.printReport();
    frmB.MdiParent = this;
    frmB.Show();
    }
    0