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.
Loading
Mariusz MazurekPosted Nov 26, 2011, 4:47 AM
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();
}