Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How to set cell format type=text when opening bi publisher created html page in EXCEL

Question
95
Views
0
Comments

Summary

How to set cell format type=text when opening bi publisher created html page in EXCEL

Content

Hi,

We use the Oracle BI Publisher 11.1.1.6.0( mainly the oracle.xdo.template.FOProcessor class) to change xsl-fo file to html page. And then save the html page to an excel file.

We want to set the excel file with cell format 'text' to handle the value like '=cmd|'/C calc'!A0', which will open remote object if cell format is General in excel. Please check C8 in 'Output Html File Save to Excel.xls'.

If adding css style td{style=mso-number-format:"\@";} , we can open the html in excel with cell format 'text'.

As the html page was created by Oracle BI Publisher from xsl-fo file, how can I make the output html file with css style like td{style=mso-number-format:"\@";}? Or does there have any way Oracle BI Publisher can set the output html page with cell format 'text' if opened in excel?

Code to use BI Publisher:

FOProcessor processor = new FOProcessor();  //oracle.xdo.template.FOProcessor

processor.setData(xslFO); //xslFO is the input xsl-fo

processor.setTemplate((String) null);

processor.setOutput(outputStream);

processor.setOutputFormat(new Integer(printType).byteValue());

if (configuration != null)  //configuration is null

    processor.setConfig(configuration);

byte[] result;

try {

    // generating

    processor.generate();  //This is the place

    result = outputStream.toByteArray();

    outputStream.close();

    xslFO.close();

} catch (Exception e) {}

        e.printStackTrace();

        return new byte[0];

    }</code>

Attached:

Input xsl-fo file: data in xsl-fo.txt file

Final Output file from Oracle BI Publisher: Output Html File Save to Excel.xls. Please open the 'Output Html File Save to Excel.xls' with text  editor to see the html code.

BTW: the xsl-fo is generated with defined xsl stylesheet and data.

Thanks.