Exemplo n.º 1
0
 /// <summary>
 /// Exports RadGridView data to .pdf extension file
 /// </summary>
 /// <param name="element">UIElement</param>
 /// <param name="stream">Stream</param>
 private static void ExportRadGridViewPDF(UIElement element, Stream stream, List <int> skipColumnDisplayIndex = null
                                          , Func <int, int, object, object, object> cellValueOverwrite        = null, Func <int, int, string> columnAggregateOverWrite = null
                                          , Func <Block> initialHeaderBlock = null)
 {
     PDFExporter.btnExportPDF_Click(element as RadGridView, stream: stream, skipColumnDisplayIndex: skipColumnDisplayIndex
                                    , cellValueOverwrite: cellValueOverwrite, columnAggregateOverWrite: columnAggregateOverWrite, initialHeaderBlock: initialHeaderBlock);
 }
Exemplo n.º 2
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (ExportOption.ExportFilterOption == RadExportFilterOption.RADGRIDVIEW_PRINT_FILTER)
            {
                Dispatcher.BeginInvoke((Action)(() =>
                {
                    ExportOption.RichTextBox.Document = PDFExporter.CreateDocument(ExportOption.Element as RadGridView
                                                                                   , ExportOption.SkipColumnDisplayIndex, ExportOption.CellValueOverwrite, ExportOption.ColumnAggregateOverwrite
                                                                                   , ExportOption.InitialHeaderBlock);
                }));

                ExportOption.RichTextBox.Document.SectionDefaultPageOrientation = PageOrientation.Landscape;
                ExportOption.RichTextBox.Print(ExportOption.ElementName, Telerik.Windows.Documents.UI.PrintMode.Native);

                this.DialogResult = true;
            }
            else if (ExportOption.ExportFilterOption == RadExportFilterOption.RADCHART_PRINT_FILTER)
            {
                Dispatcher.BeginInvoke((Action)(() =>
                {
                    ExportOption.RichTextBox.Document = PDFExporter.PrintChart(ExportOption.Element as RadChart);
                }));

                ExportOption.RichTextBox.Document.SectionDefaultPageOrientation = PageOrientation.Landscape;
                ExportOption.RichTextBox.Print(ExportOption.ElementName, Telerik.Windows.Documents.UI.PrintMode.Native);
                this.DialogResult = true;
            }
            else
            {
                SaveFileDialog dialog = new SaveFileDialog()
                {
                    DefaultExt = ".xls",
                    Filter     = RadExportFilterOptionDesc.GetEnumDescription(ExportOption.ExportFilterOption)
                };

                if (dialog.ShowDialog() == true)
                {
                    RadGridView_ElementExport.ExportElementOptions = ExportElementOptionsInfo;
                    RadExport.ExportStream(dialog.FilterIndex, ExportOption, dialog.OpenFile(), ExportOption.SkipColumnDisplayIndex
                                           , ExportOption.CellValueOverwrite, ExportOption.ColumnAggregateOverwrite, initialHeaderBlock: ExportOption.InitialHeaderBlock);
                    this.DialogResult = true;
                }
                else
                {
                    this.DialogResult = false;
                }
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Exports RadChart image to .pdf extension file
 /// </summary>
 /// <param name="element">UIElement</param>
 /// <param name="stream">Stream</param>
 private static void ExportRadChartPDF(UIElement element, Stream stream)
 {
     PDFExporter.btnExportChartPDF_Click(element as RadChart, stream: stream);
 }