Ejemplo n.º 1
0
        private void OnExportGraphCommand()
        {
            var filename = string.Format("{0}_{1}_Report_{2}_{3}_{4}_{5}.pdf", SelectedGraphType, CurrentFilterText,
                                         DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Millisecond);
            var completePath = Path.Combine(_resultSet.GetAnalyzedFolder(), filename);

            try
            {
                using (var stream = File.Create(completePath))
                {
                    var pdfExporter = new PdfExporter {
                        Width = 600, Height = 400
                    };
                    pdfExporter.Export(_plotModel, stream);
                }
            }
            catch (Exception)
            {
                ExportText = string.Format("{0} not exported, an error occured", completePath);
            }
            ExportText = string.Format("{0} Exported succesfuly", completePath);
            System.Diagnostics.Process.Start(completePath);
        }