コード例 #1
0
        private void butPdf_Click(object sender, EventArgs e)
        {
            string tenfile = ReportFile.ToLower().Replace(".rpt", "");

            tenfile = ExportPath + tenfile + ".pdf";
            crDiskFileDestinationOptions = new DiskFileDestinationOptions();
            crExportOptions = oRpt.ExportOptions;
            crDiskFileDestinationOptions.DiskFileName = tenfile;
            crExportOptions.DestinationOptions        = crDiskFileDestinationOptions;
            crExportOptions.ExportDestinationType     = ExportDestinationType.DiskFile;
            crExportOptions.ExportFormatType          = ExportFormatType.PortableDocFormat;
            oRpt.Export();
            try
            {
                string filerun = "AcroRd32.exe", arg = tenfile;

                if (System.IO.File.Exists(arg))
                {
                    LibBaocao.run f = new LibBaocao.run(filerun, arg, true);
                    f.Launch();
                }
            }
            catch
            {
                MessageBox.Show("Tập tin :" + tenfile);
            }
        }
コード例 #2
0
 private void s_mess(string s_loi)
 {
     if (s_bien1 != "")
     {
         MessageBox.Show(d.s_ThieuReport(s_loi + "^" + ReportFile) + "\n Vui lòng copy report này vào thư mục Report ngang hàng với chương trình chạy !", d.Msg, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if (s_bien != "")
     {
         DialogResult dlg = MessageBox.Show(d.s_FormulaFields(s_bien + "^" + ReportFile + "\n Bạn có muốn sửa report " + ReportFile + " không ?"), d.Msg, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dlg == DialogResult.Yes)
         {
             try
             {
                 LibBaocao.run f = new LibBaocao.run("devenv", s_dirreport, false);
                 f.Launch();
             }
             catch
             {
             }
         }
     }
 }