Hi,
I’m evaluating Aspose for JasperReports and we found two small problems. I think, that these may be solved easily.
- The default locale of the generated Word docx is ‘en-US’, but we need to change that to ‘de-DE’. I found this entry Set locale in Aspose.Words for Java/JasperReports, which didn’t work for us.
The sample code looks like this:
JasperPrint jasperPrint = createReport();
jasperPrint.setLocaleCode("de_DE");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
JRAbstractExporter exporter = new AWDocxExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(baos));
exporter.exportReport();
byte[] generatedWord = baos.toByteArray();
// write byte[] to file or stream via http
- The default font should be ‘Arial’, but the default is New Times Roman. How can we change this?
The default JRStyle in my JasperReports template uses Arial as the default font, like
<style name="default" isDefault="true" isBlankWhenNull="true" fontName="Arial" fontSize="12"/>
The generate styles.xml looks like this:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<w:styles xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:docDefaults>
<w:rPrDefault>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:eastAsia="Times New Roman" w:hAnsi="Times New Roman"
w:cs="Times New Roman"/>
<w:lang w:val="en-US" w:eastAsia="en-US" w:bidi="ar-SA"/>
</w:rPr>
</w:rPrDefault>
<w:pPrDefault/>
</w:docDefaults>
...
Thanks for any help