private void Viewer_ToolClick(object sender, DataDynamics.ActiveReports.Toolbar.ToolClickEventArgs e)
 {
     if (e.Tool.Id == 42)
     {
         SaveFileDialog dlg = new SaveFileDialog();
         dlg.Filter = "Archivos PDF|*.pdf";
         dlg.Title  = "Guardar reporte como ...";
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             DataDynamics.ActiveReports.Export.Pdf.PdfExport pdf = new DataDynamics.ActiveReports.Export.Pdf.PdfExport();
             pdf.Export(this.Viewer.Document, dlg.FileName.ToString());
         }
     }
     if (e.Tool.Id == 43)
     {
         SaveFileDialog dlg = new SaveFileDialog();
         dlg.Filter = "Archivos Excel|*.xls";
         dlg.Title  = "Guardar reporte como ...";
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             DataDynamics.ActiveReports.Export.Xls.XlsExport xls = new DataDynamics.ActiveReports.Export.Xls.XlsExport();
             xls.Export(this.Viewer.Document, dlg.FileName.ToString());
         }
     }
 }
Exemple #2
0
 private void viewer_ToolClick(object sender, DataDynamics.ActiveReports.Toolbar.ToolClickEventArgs e)
 {
     if (e.Tool.Id == 777)
     {
         saveFileDialogForExcelExport.FileName = "";
         if (saveFileDialogForExcelExport.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             var xlsExport = new DataDynamics.ActiveReports.Export.Xls.XlsExport();
             xlsExport.Export(viewer.Document, saveFileDialogForExcelExport.FileName);
             helper.MsgBox.Info(Properties.Resources.MsgSucceeded);
         }
     }
 }
Exemple #3
0
 private void viewer1_OnToolClick(object sender, DataDynamics.ActiveReports.Toolbar.ToolClickEventArgs e)
 {
     if (e.Tool.Caption == "&Print...")
     {
         if (_TaskName == "SWAT Agenda")
         {
             VWA4Common.UtilitiesInstance utils = new VWA4Common.UtilitiesInstance();
             utils.setTaskCheck(DateTime.Parse(VWA4Common.GlobalSettings.StartDateOfSelectedWeek), true, "printswatform");
         }
         else if (_TaskName == "Staff Mtg. Agenda")
         {
             VWA4Common.UtilitiesInstance utils = new VWA4Common.UtilitiesInstance();
             utils.setTaskCheck(DateTime.Parse(VWA4Common.GlobalSettings.StartDateOfSelectedWeek), true, "printmeetingscript");
         }
     }
 }
Exemple #4
0
        private void arvMainViwer_ToolClick(object sender, DataDynamics.ActiveReports.Toolbar.ToolClickEventArgs e)
        {
            if (e.Tool.Id == 25)
            {
                SaveFileDialog saveFileDialog = new SaveFileDialog();

                Object RutaDir = Convert.ToString(Environment.CurrentDirectory);
                saveFileDialog.Filter = "Microsoft Excel (*.xls)|*.xls|Acrobat Reader (*.pdf)|*.pdf|Página Web (*.html)|*.htm";
                saveFileDialog.Title  = "Exportar a archivo";
                saveFileDialog.ShowDialog();
                if (saveFileDialog.FileName != "")
                {
                    try
                    {
                        string Extfile = (saveFileDialog.FileName.Substring(saveFileDialog.FileName.Length - 3, 3));

                        switch (Extfile.ToUpper())
                        {
                        case "XLS":
                            DataDynamics.ActiveReports.Export.Xls.XlsExport MyEx = new DataDynamics.ActiveReports.Export.Xls.XlsExport();
                            MyEx.RemoveVerticalSpace = false;
                            MyEx.DisplayGridLines    = true;
                            MyEx.UseCellMerging      = false;
                            MyEx.AutoRowHeight       = true;
                            MyEx.MinRowHeight        = (float)0.1;
                            MyEx.MultiSheet          = false;
                            MyEx.Export(this.arvMainViwer.Document, saveFileDialog.FileName);
                            MyEx.Dispose();
                            break;

                        case "PDF":
                            DataDynamics.ActiveReports.Export.Pdf.PdfExport MyPd = new DataDynamics.ActiveReports.Export.Pdf.PdfExport();
                            MyPd.Export(this.arvMainViwer.Document, saveFileDialog.FileName);
                            MyPd.Dispose();
                            break;

                        case "TML":
                            DataDynamics.ActiveReports.Export.Html.HtmlExport MyHtml = new DataDynamics.ActiveReports.Export.Html.HtmlExport();
                            MyHtml.Export(this.arvMainViwer.Document, saveFileDialog.FileName);
                            MyHtml.Dispose();
                            break;
                        }
                    }
                    catch (Exception Ex) { throw new Exception(Ex.Message, Ex.InnerException); }
                }
            }
        }
Exemple #5
0
        private void _viewer_ToolClick(object sender, DataDynamics.ActiveReports.Toolbar.ToolClickEventArgs e)
        {
            try
            {
                switch (e.Tool.Id)
                {
                case 5001:

                    this.ExportDocument();
                    break;
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.ToString());
            }
        }