Free Support Forum - aspose.com

Problem with font-size of TextField in generated Word files

Hello,


I evaluate Aspose for Jasper Reports. I have a Jasper template with a textField element that defines the size of font that will be inside.

XML Code is the following :


Then, I use AWDocExporter to export my jasper template to doc file.

In generated doc file, size in textField area is setted to 5 and police to Times New Roman.

Is there any way to fix that problem ? or perhaps this is a limitation of evaluation version that I use ?

Thanks by advance for your help.

Sylvain.



Hi Sylvain,


Thanks for your inquiry. Please use the latest version of Aspose.Words for JasperReports 1.7.0 and use the AWExporterParameter.POSITIONED_STYLE parameter as described below:

  1. Create style form Styles sub-tree (in iReports Designer) e.g “style1” and use this style in text field.
  2. Use the AWExporterParameter.POSITIONED_STYLE as highlighted in following code snippet.

AWDocxExporter exporter = new AWDocxExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(AWExporterParameter.POSITIONED_STYLE, “style1”);

exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, output);

exporter.exportReport();


If you still face problem, please share your jrxml file along with data source for investigation purposes.


Thanks for your reply.


I created a style named style1 for my report then I applied that style on the textField. The style has a police SansSerif and a size to 14.

Finally, I added the parameter POSITIONED_STYLE to the exporter.

Unfortunately, the result is the same. In my generated doc file, the police in the textField is Times New Roman and the size is setted to 5.

I use the last version of Aspose.Words for JasperReports and I use jasper reports 4.7.1 .

Do you have any others ideas ?

Sylvain

Hi Sylvain,


Thanks for the details. Could you please attach your JRXML file along with data source (if required) here for testing? I will investigate the issue on my side and provide you more information.