klaytoncbrito Posted April 3, 2023 Share Posted April 3, 2023 Hello, 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> </reportElement> <box> <bottomPen lineWidth="1.0" lineStyle="Solid"/> <rightPen lineWidth="1.0" lineStyle="Solid"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Monospaced" size="8" isBold="true" pdfFontName="Courier-Bold"/> </textElement> </textField> 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); xlsxExporter.exportReport(); I'm also using: <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>UPDATEI'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 More sharing options...
Mehak Rajkumar Posted April 4, 2023 Share Posted April 4, 2023 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 More sharing options...
Solution Rutuja Bhalchandra Shinde Posted April 4, 2023 Solution Share Posted April 4, 2023 Hi,Looks like you are using a very old version of the JRS which is out of support. Could you please use the latest version of the JRS and then tried the same?Let us know how it works in the latest version. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now