void Export(bool saveAs)
        {
            ASPxPivotGridExporter1.OptionsPrint.PrintHeadersOnEveryPage = checkPrintHeadersOnEveryPage.Checked;
            ASPxPivotGridExporter1.OptionsPrint.PrintFilterHeaders      = checkPrintFilterHeaders.Checked ? DefaultBoolean.True : DefaultBoolean.False;
            ASPxPivotGridExporter1.OptionsPrint.PrintColumnHeaders      = checkPrintColumnHeaders.Checked ? DefaultBoolean.True : DefaultBoolean.False;
            ASPxPivotGridExporter1.OptionsPrint.PrintRowHeaders         = checkPrintRowHeaders.Checked ? DefaultBoolean.True : DefaultBoolean.False;
            ASPxPivotGridExporter1.OptionsPrint.PrintDataHeaders        = checkPrintDataHeaders.Checked ? DefaultBoolean.True : DefaultBoolean.False;

            //ASPxPivotGridExporter1.Response.Buffer = false;
            //ASPxPivotGridExporter1.Response.AddHeader("Connection", "Keep-Alive");

            string fileName = fileNameToExport;

            switch (listExportFormat.SelectedIndex)
            {
            case 0:
                ASPxPivotGridExporter1.ExportXlsxToResponse(fileName, DevExpress.XtraPrinting.TextExportMode.Text, saveAs);      // see excel bug custom totals:  http://www.devexpress.com/Support/Center/p/B93134.aspx
                break;

            case 1:
                ASPxPivotGridExporter1.ExportCsvToResponse(fileName, saveAs);
                break;

            case 2:
                ASPxPivotGridExporter1.ExportHtmlToResponse(fileName, "utf-8", fileNameToExport, true, saveAs);
                break;
            }
        }
Example #2
0
 protected void ASPxButton1_Click(object sender, EventArgs e)
 {
     ASPxPivotGridExporter1.ExportXlsxToResponse("test", new XlsxExportOptionsEx
     {
         AllowGrouping = DevExpress.Utils.DefaultBoolean.False,
         AllowFixedColumnHeaderPanel = DevExpress.Utils.DefaultBoolean.False
     });
 }
Example #3
0
        protected void ASPxButton1_Click(object sender, EventArgs e)
        {
            var exportOptions = new PivotXlsxExportOptions();

            exportOptions.CustomizeCell +=
                new CustomizePivotCellEventHandler(exportOptions_CustomizeCell);
            ASPxPivotGridExporter1.ExportXlsxToResponse("PivotGrid", exportOptions);
        }
Example #4
0
    protected void ASPxButton1_Click(object sender, EventArgs e)
    {
        PivotXlsxExportOptions options = new PivotXlsxExportOptions();

        options.CustomizeSheetHeader += options_CustomizeSheetHeader;
        options.CustomizeSheetFooter += options_CustomizeSheetFooter;
        ASPxPivotGridExporter1.ExportXlsxToResponse("Pivot", options);
    }
 protected void DataAwareExportButton_Click(object sender, EventArgs e)
 {
     // Exports using the Data-Aware type.
     ASPxPivotGridExporter1.ExportXlsxToResponse("ASPxPivotGrid", new XlsxExportOptionsEx
     {
         AllowFixedColumns = DefaultBoolean.False,
         SheetName         = "Pivot Grid Export"
     },
                                                 true);
 }
        public void Export(bool saveAs)
        {
            foreach (PivotGridField field in pivotGrid.Fields)
            {
            }
            const string        fileName = "RtmPlaningProjects";
            XlsxExportOptionsEx options;

            switch (listExportFormat.SelectedIndex)
            {
            case 0:
                options = new XlsxExportOptionsEx()
                {
                    ExportType = ExportType.WYSIWYG
                };
                ASPxPivotGridExporter1.ExportXlsxToResponse(fileName, options, saveAs);
                break;
            }
        }
Example #7
0
 protected void ASPxButton1_Click(object sender, EventArgs e)
 {
     ASPxPivotGridExporter1.ExportXlsxToResponse("OrderPivot.xlsx");
 }
Example #8
0
        protected void buttonSaveAs_Click(object sender, EventArgs e)
        {
            foreach (DevExpress.Web.ASPxPivotGrid.PivotGridField field in ASPxPivotGrid1.Fields)
            {
                if (field.ValueFormat != null && !string.IsNullOrEmpty(field.ValueFormat.FormatString))
                {
                    field.UseNativeFormat = checkCustomFormattedValuesAsText.Checked ? DefaultBoolean.False : DefaultBoolean.True;
                }
            }

            ASPxPivotGridExporter1.OptionsPrint.PrintColumnAreaOnEveryPage = checkPrintColumnAreaOnEveryPage.Checked;
            ASPxPivotGridExporter1.OptionsPrint.PrintRowAreaOnEveryPage    = checkPrintRowAreaOnEveryPage.Checked;
            ASPxPivotGridExporter1.OptionsPrint.MergeColumnFieldValues     = checkMergeColumnFieldValues.Checked;
            ASPxPivotGridExporter1.OptionsPrint.MergeRowFieldValues        = checkMergeRowFieldValues.Checked;

            ASPxPivotGridExporter1.OptionsPrint.PrintFilterHeaders = checkPrintFilterFieldHeaders.Checked ? DefaultBoolean.True : DefaultBoolean.False;
            ASPxPivotGridExporter1.OptionsPrint.PrintColumnHeaders = checkPrintColumnFieldHeaders.Checked ? DefaultBoolean.True : DefaultBoolean.False;
            ASPxPivotGridExporter1.OptionsPrint.PrintRowHeaders    = checkPrintRowFieldHeaders.Checked ? DefaultBoolean.True : DefaultBoolean.False;
            ASPxPivotGridExporter1.OptionsPrint.PrintDataHeaders   = checkPrintDataFieldHeaders.Checked ? DefaultBoolean.True : DefaultBoolean.False;

            const string        fileName = "PivotGrid";
            XlsxExportOptionsEx options;

            switch (listExportFormat.SelectedIndex)
            {
            case 0:
                ASPxPivotGridExporter1.ExportPdfToResponse(fileName);
                break;

            case 1:
                options = new XlsxExportOptionsEx()
                {
                    ExportType = ExportType.WYSIWYG
                };
                ASPxPivotGridExporter1.ExportXlsxToResponse(fileName, options);
                break;

            case 2:
                ASPxPivotGridExporter1.ExportMhtToResponse(fileName, "utf-8", "ASPxPivotGrid Printing Sample", true);
                break;

            case 3:
                ASPxPivotGridExporter1.ExportRtfToResponse(fileName);
                break;

            case 4:
                ASPxPivotGridExporter1.ExportTextToResponse(fileName);
                break;

            case 5:
                ASPxPivotGridExporter1.ExportHtmlToResponse(fileName, "utf-8", "ASPxPivotGrid Printing Sample", true);
                break;

            case 6:
                options = new XlsxExportOptionsEx()
                {
                    ExportType                  = ExportType.DataAware,
                    AllowGrouping               = allowGroupingCheckBox.Checked ? DefaultBoolean.True : DefaultBoolean.False,
                    TextExportMode              = exportCellValuesAsText.Checked ? TextExportMode.Text : TextExportMode.Value,
                    AllowFixedColumns           = allowFixedColumns.Checked ? DefaultBoolean.True : DefaultBoolean.False,
                    AllowFixedColumnHeaderPanel = allowFixedColumns.Checked ? DefaultBoolean.True : DefaultBoolean.False,
                    RawDataMode                 = exportRawData.Checked
                };
                ASPxPivotGridExporter1.ExportXlsxToResponse(fileName, options);
                break;
            }
        }