Esempio n. 1
0
        public static void ExportToPagedFile(FrameworkElement element, Stream stream, bool lanscaped)
        {
            RadFixedDocument  document = PDFExportHelper.CreatePagedDocument(element, lanscaped);
            PdfFormatProvider provider = new PdfFormatProvider {
                ExportSettings = { ImageQuality = ImageQuality.High }
            };

            provider.Export(document, stream);
        }
Esempio n. 2
0
        public static void ExportToFile(FrameworkElement element, Stream stream)
        {
            //((System.Windows.Controls.Border)element).BorderBrush = new SolidColorBrush(Colors.Transparent);

            RadFixedDocument document = PDFExportHelper.CreateDocument(element);

            if (element.GetType().Name != "RadPivotGrid")
            {
                document.Pages.FirstOrDefault().Size = new Size(element.ActualWidth + 48, element.ActualHeight + 48);
            }
            else
            {
                PrepareForExport(element);
            }
            PdfFormatProvider provider = new PdfFormatProvider {
                ExportSettings = { ImageQuality = ImageQuality.High }
            };

            provider.Export(document, stream);
        }
Esempio n. 3
0
        private void ExportToPdfViaPdfProcessing()
        {
            PrepareForExport(this.pivot);

            var dialog = new SaveFileDialog
            {
                DefaultExt = "pdf",
                Filter     = "Pdf files|*.pdf|All Files (*.*)|*.*",
            };

            if (dialog.ShowDialog() == true)
            {
                using (var stream = dialog.OpenFile())
                {
                    // Use a normal TextBlock instead of the internal LightTextBlock that the RadPivotGrid uses
                    this.pivot.CellTemplate = this.Resources["CellTemplate"] as DataTemplate;
                    ExpandGrid();

                    PDFExportHelper.ExportToFile(this.pivot, stream);
                    this.pivot.CellTemplate = null;
                    ResetGrid();
                }
            }
        }