converting XLS to PDF

hello All,
I am using YARG to generate reports. In the cuba platform report generator has been written that one should set the path to the openoffice in the reporting.properties, but i can not find any information about the folder in which this file has to be put.
Would you please tell me where i need to put the properties file? Is there possible to pass the path information as parameter in some method?

This is my xml:


<templates>
        <template code="DEFAULT" 
        documentName="breakdown.xls" 
        documentPath="reportInputs/breakdown.xls" 
        outputType="pdf" 
        outputNamePattern="breakdown.pdf"/>

And this the related code in java class:


ReportOutputDocument reportOutputDocument = reporting.runReport(new RunParams(report), new FileOutputStream("reportOutputs/breakdown.pdf"));

I get this error after running
Could not convert xls files to pdf because Open Office connection params not set. Please check, that “cuba.reporting.openoffice.path” property is set in properties file.
regards
Iman

Hello.

If you use YARG’s Java API, you should setup the connection to Open Office programmatically.
You can do it with setOfficeIntegration method of the DefaultFormatterFactory class.


        DefaultFormatterFactory defaultFormatterFactory = new DefaultFormatterFactory();
        defaultFormatterFactory.setOfficeIntegration(new OfficeIntegration(openOfficePath, 8100));

The openOfficePath parameter should point to program directory of the Open Office installation.
If you use Windows it would be like the following: “C:/Program Files (x86)/OpenOffice.org 3/program”.

1 Like