private void btn_sauvgarder_Click(object sender, EventArgs e)
        {
            if (txt_save_name.Text != "")
            {
                RPT.RPT_ALL_PRODUCTS       report      = new RPT.RPT_ALL_PRODUCTS();
                DiskFileDestinationOptions Destination = new DiskFileDestinationOptions();
                Destination.DiskFileName = @"C:\Users\Hamza's Laptop\OneDrive\Documents\" + txt_save_name.Text + ".xls";
                ExcelFormatOptions excelFormat = new ExcelFormatOptions();

                ExportOptions export = new ExportOptions();
                export = report.ExportOptions;
                export.ExportDestinationType    = ExportDestinationType.DiskFile;
                export.ExportFormatType         = ExportFormatType.Excel;
                export.ExportDestinationOptions = Destination;
                export.ExportFormatOptions      = excelFormat;
                report.Export();
                MessageBox.Show("raport est Sauvgarder avec succée !!");
                txt_save_name.Text = "";
            }
            else
            {
                MessageBox.Show("Veuiller saisie le nom de fichier a sauvgarder !!");
                return;
            }
        }
 private void btn_imprimer_Click(object sender, EventArgs e)
 {
     RPT.FRM_REPORTS      frm = new RPT.FRM_REPORTS();
     RPT.RPT_ALL_PRODUCTS pro = new RPT.RPT_ALL_PRODUCTS();
     frm.crystalReportViewer1.ReportSource = pro;
     frm.ShowDialog();
 }
Exemplo n.º 3
0
 private void button5_Click(object sender, EventArgs e)
 {
     RPT.RPT_ALL_PRODUCTS myreport = new RPT.RPT_ALL_PRODUCTS();
     RPT.FRM_RPT_PRODUCT  myform   = new RPT.FRM_RPT_PRODUCT();
     myform.crystalReportViewer1.ReportSource = myreport;
     myform.ShowDialog();
 }
Exemplo n.º 4
0
        private void button7_Click(object sender, EventArgs e)
        {
            RPT.RPT_ALL_PRODUCTS myreport = new RPT.RPT_ALL_PRODUCTS();

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

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

            ExcelFormatOptions excelformat = new ExcelFormatOptions();

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

            export = myreport.ExportOptions;

            export.ExportDestinationType = ExportDestinationType.DiskFile;

            export.ExportFormatType = ExportFormatType.Excel;

            export.ExportFormatOptions = excelformat;

            export.ExportDestinationOptions = dfdoptions;

            myreport.Export();

            MessageBox.Show("List Exported Successfuly ! ", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Exemplo n.º 5
0
        private void button7_Click(object sender, EventArgs e)
        {
            RPT.RPT_ALL_PRODUCTS My_Report = new RPT.RPT_ALL_PRODUCTS();
            ExportOptions        export    = new ExportOptions();

            DiskFileDestinationOptions dfoption = new DiskFileDestinationOptions();

            //PdfFormatOptions pdfformat = new PdfFormatOptions();
            ExcelFormatOptions excelformatt = new ExcelFormatOptions();

            //set destination of file to save in
            dfoption.DiskFileName = @"D:\ProductList.xls";
            export = My_Report.ExportOptions;
            export.ExportDestinationType = ExportDestinationType.DiskFile;

            //export.ExportFormatType = ExportFormatType.PortableDocFormat;
            export.ExportFormatType    = ExportFormatType.Excel;
            export.ExportFormatOptions = excelformatt;
            //export.ExportFormatOptions = pdfformat;
            export.ExportDestinationOptions = dfoption;

            My_Report.Export();
            MessageBox.Show("تم الحفظ ", "حفظ", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }