Exemple #1
0
        private void button12_Click(object sender, EventArgs e)
        {
            RPT.rpt_singl_categories myreport2 = new RPT.rpt_singl_categories();
            //creat export options
            ExportOptions export = new ExportOptions();

            //creat object for destination
            DiskFileDestinationOptions Pdfoptions = new DiskFileDestinationOptions();

            PdfFormatOptions PDFformat = new PdfFormatOptions();

            //
            Pdfoptions.DiskFileName = @"D:\CATEGORIESlistdetales.PDF";

            export = myreport2.ExportOptions;

            export.ExportDestinationType = ExportDestinationType.DiskFile;

            export.ExportFormatType = ExportFormatType.PortableDocFormat;

            export.ExportFormatOptions = PDFformat;

            export.ExportDestinationOptions = Pdfoptions;

            myreport2.Refresh();
            myreport2.SetParameterValue("@ID", Convert.ToInt32(txtID.Text));

            myreport2.Export();

            MessageBox.Show("list exported successfully !", "export", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
        }
Exemple #2
0
        private void button10_Click(object sender, EventArgs e)
        {
            RPT.rpt_singl_categories rpt = new RPT.rpt_singl_categories();
            RPT.FRM_RPT frm = new RPT.FRM_RPT();
            rpt.SetParameterValue("@ID", Convert.ToInt32(txtID.Text));
            frm.crystalReportViewer1.ReportSource = rpt;

            frm.ShowDialog();
        }