Symptom
- How do I stop group and page headers from repeating in CSV export?
- Group and page headers appear on every line when exporting to CSV.
Environment
Crystal Reports Java SDK (Crystal Reports for Eclipse 2.0)
Resolution
Use the following code to set the CSV options and isolate the group and page headers:
PrintOutputController poc = reportClientDocument.getPrintOutputController();
ExportOptions exportOptions = new ExportOptions();
ReportExportFormat exportFormat = ReportExportFormat.characterSeparatedValues;
CharacterSeparatedValuesExportFormatOptions csv = new CharacterSeparatedValuesExportFormatOptions();
csv.setGroupSectionsOption(CharacterSeparatedValuesExportFormatOptions.ExportSectionsOption.exportIsolated);
csv.setReportSectionsOption(CharacterSeparatedValuesExportFormatOptions.ExportSectionsOption.exportIsolated);
exportOptions.setExportFormatType(exportFormat);
exportOptions.setFormatOptions(csv);
byteArrayInputStream = (ByteArrayInputStream) poc.export(exportOptions);
Keywords
KBA , BI-DEV , Business Intelligence Software Development Kits (SDKs) , How To
Product
Crystal Reports for Java 1.0