private void prnt_Curr_Click(object sender, EventArgs e) { RPRT.CrystalReport_Sngle_Cat SNcat = new RPRT.CrystalReport_Sngle_Cat(); RPRT.PRNT_SNGL_PRD frm = new RPRT.PRNT_SNGL_PRD(); SNcat.Refresh(); SNcat.SetParameterValue("@ID", int.Parse(textBox_CatID.Text)); frm.crystalReportViewer1.ReportSource = SNcat; frm.Text = "Print Current Category"; frm.Show(); }
private void sveCatWprd_Click(object sender, EventArgs e) { RPRT.CrystalReport_Sngle_Cat cat = new RPRT.CrystalReport_Sngle_Cat(); cat.SetParameterValue("@ID", int.Parse(textBox_CatID.Text)); ExportOptions export = new ExportOptions(); DiskFileDestinationOptions Dist = new DiskFileDestinationOptions(); PdfFormatOptions pdf = new PdfFormatOptions(); Dist.DiskFileName = @"C: \Users\hima\Desktop\\PDF_Cat.pdf"; export = cat.ExportOptions; export.ExportDestinationType = ExportDestinationType.DiskFile; export.ExportFormatType = ExportFormatType.PortableDocFormat; export.ExportFormatOptions = pdf; export.ExportDestinationOptions = Dist; cat.Refresh(); cat.SetParameterValue("@ID", int.Parse(textBox_CatID.Text)); cat.Export(); MessageBox.Show("File Exported on Desktop Successfully", "INFO", MessageBoxButtons.OK); }