Example #1
0
        private void ExportToExcelAll_Click(object sender, EventArgs e)
        {
            RPT.RPT_ALL_CATEGORIES myreport = new RPT.RPT_ALL_CATEGORIES();

            //Create Export Options    خاص باعدادات التقرير
            ExportOptions export = new ExportOptions();

            //Create object for Destination    خاص بمكان حفظ التقرير
            DiskFileDestinationOptions dfdoptions = new DiskFileDestinationOptions();

            PdfFormatOptions pdfformat = new PdfFormatOptions();

            //set the path of destination      رابط المسار الذى نريد وضع الملف فيه
            dfdoptions.DiskFileName = "E:\\Categorieslist.pdf";

            export = myreport.ExportOptions;

            export.ExportDestinationType = ExportDestinationType.DiskFile;

            export.ExportFormatType = ExportFormatType.PortableDocFormat;

            export.ExportFormatOptions = pdfformat;

            export.ExportDestinationOptions = dfdoptions;

            myreport.Refresh();

            myreport.Export();

            MessageBox.Show("List Exported Successfuly ! ", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        private void buttonX8_Click(object sender, EventArgs e)
        {
            try
            {
                RPT.RPT_ALL_CATEGORIES myreport = new RPT.RPT_ALL_CATEGORIES();


                ExportOptions CrExportOptions;



                DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();

                PdfFormatOptions CrFormatTypeOptions = new PdfFormatOptions();

                CrDiskFileDestinationOptions.DiskFileName = "D:\\تقرير الاصناف.pdf";

                CrExportOptions = myreport.ExportOptions;

                CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;

                CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;

                CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;

                CrExportOptions.FormatOptions = CrFormatTypeOptions;

                myreport.Export();
                MessageBox.Show("تم تصدير الملف بنجاح ", "تصدير الملف", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }