Jump to content
Changes to the Jaspersoft community edition download ×

XLSX file missing excel formulas

Go to solution Solved by Rutuja Bhalchandra Shinde,

Recommended Posts



I'm working on a legacy project and I'm having an issue with exporting XLSX file format using Jasper Library, where the resulting XLSX file doesn't have any excel formulas.

I've tested changing the Java code to export to XLS and It works, the XLS file has the excel formulas.

The project I'm working on use the Jasper of version 3.7.3. 

But I really need to export XLSX instead of XLS.

XLSX file with missing formulas:

XLS file with formulas:

JRXML field:

            <textField isBlankWhenNull="true">
                <reportElement mode="Opaque" x="229" y="0" width="50" height="12" backcolor="#E6E6E5">
                    <propertyExpression name="net.sf.jasperreports.export.xls.formula"><![CDATA["=A1"]]></propertyExpression>
                    <bottomPen lineWidth="1.0" lineStyle="Solid"/>
                    <rightPen lineWidth="1.0" lineStyle="Solid"/>
                <textElement textAlignment="Center" verticalAlignment="Middle" lineSpacing="Single">
                    <font fontName="Monospaced" size="8" isBold="true" pdfFontName="Courier-Bold"/>

Java code:

            final var jasperPrint = JasperFillManager.fillReport(jasperTemplate, parameters, dataSource);

            final var xlsxExporter = new JRXlsExporter();
            //final var xlsxExporter = new JRXlsxExporter();
            xlsxExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
            xlsxExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, output);
            xlsxExporter.setParameter(JRXlsAbstractExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);


I'm also using: <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>


I've talked with my boss and between update the jasper version or using XLS they chose using XLS

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...