Jump to content
JasperReports Library 7.0 is now available ×

Unmerge two cells in Jasper report when it is downloaded as XLSX


minschka

Recommended Posts

Hey guys!

Currently I am working with Jaspersoft Studio 6.2.

Right now I want to seperate two columns which are merged when I download the report as XLSX.

E.g. the column "margin" appears seperately in the report but as sonn as I download the report as XLSX, two cells, e.g. B and C, are merged in Excel (which should not be the case).

Any suggestions how to fix this issue?

Thanks in advance!

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

align all the fields in grid lines of your report layout. it will eliminate the merging of cells in xlsx.

sample jrxml

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0  --><!-- 2017-02-27T09:34:54 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="conditional" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="db6c00f0-db29-49f5-8e70-22e8b82b00ea">    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>    <queryString>        <![CDATA[select 2017as year,700000as figure1,390000 as figure2,98000 as figure3,50000 as figure4 from dual unionselect 2018as year,250000as figure1,85000 as figure2,70000 as figure3,160000 as figure4 from dual unionselect 2019as year,21149.43as figure1,9252.87 as figure2,0 as figure3,0 as figure4 from dual]]>    </queryString>    <field name="YEAR" class="java.math.BigDecimal"/>    <field name="FIGURE1" class="java.math.BigDecimal"/>    <field name="FIGURE2" class="java.math.BigDecimal"/>    <field name="FIGURE3" class="java.math.BigDecimal"/>    <field name="FIGURE4" class="java.math.BigDecimal"/>    <variable name="Sum" class="java.math.BigDecimal" incrementType="Column" calculation="Sum">        <variableExpression><![CDATA[$F{FIGURE1}.add($F{FIGURE2}).add($F{FIGURE3}).add($F{FIGURE4})]]></variableExpression>    </variable>    <background>        <band splitType="Stretch"/>    </background>    <columnHeader>        <band height="20" splitType="Stretch">            <staticText>                <reportElement x="0" y="0" width="80" height="20" uuid="46953091-95ae-45a0-824a-c6349193ff95"/>                <text><![CDATA[YEAR]]></text>            </staticText>            <staticText>                <reportElement x="180" y="0" width="100" height="20" uuid="c6dc70ef-2c28-4d64-9df8-c42816c01f31"/>                <text><![CDATA[FIGURE1]]></text>            </staticText>            <staticText>                <reportElement x="280" y="0" width="100" height="20" uuid="e9585303-7fe5-4507-a3c7-644f754e679f"/>                <text><![CDATA[FIGURE2]]></text>            </staticText>            <staticText>                <reportElement x="380" y="0" width="100" height="20" uuid="8239325a-b107-4454-81ed-e39d9514bb26"/>                <text><![CDATA[FIGURE3]]></text>            </staticText>            <staticText>                <reportElement x="480" y="0" width="100" height="20" uuid="e514dc9e-41e3-4d5b-945f-8075a4e15f55"/>                <text><![CDATA[FIGURE4]]></text>            </staticText>            <staticText>                <reportElement x="80" y="0" width="100" height="20" uuid="4f52ebc9-80bc-4db2-8dc5-50e49bb2ade5"/>                <text><![CDATA[sum]]></text>            </staticText>        </band>    </columnHeader>    <detail>        <band height="20" splitType="Stretch">            <textField>                <reportElement x="0" y="0" width="80" height="20" uuid="d50a5931-7d89-4975-a885-18f1449986e1"/>                <textFieldExpression><![CDATA[$F{YEAR}]]></textFieldExpression>            </textField>            <textField pattern="¤#,##0.##;¤-#,##0.00">                <reportElement x="180" y="0" width="100" height="20" uuid="3767ad7c-044a-48b2-85fe-884d4a721517"/>                <textFieldExpression><![CDATA[$F{FIGURE1}]]></textFieldExpression>            </textField>            <textField pattern="¤#,##0.##;¤-#,##0.00">                <reportElement x="280" y="0" width="100" height="20" uuid="949b7196-f620-4a45-a0a2-ebfc97016ae3"/>                <textFieldExpression><![CDATA[$F{FIGURE2}]]></textFieldExpression>            </textField>            <textField pattern="¤#,##0.##;¤-#,##0.00">                <reportElement x="380" y="0" width="100" height="20" uuid="bd1411b1-1326-43bb-a42c-ec8f91a30170"/>                <textFieldExpression><![CDATA[$F{FIGURE3}]]></textFieldExpression>            </textField>            <textField pattern="¤#,##0.##;¤-#,##0.00">                <reportElement x="480" y="0" width="100" height="20" uuid="304de87a-d1d9-4c65-82b1-20d3a5f54a06"/>                <textFieldExpression><![CDATA[$F{FIGURE4}]]></textFieldExpression>            </textField>            <textField pattern="¤#,##0.##;¤-#,##0.00">                <reportElement x="80" y="0" width="100" height="20" uuid="e8c5c029-32dd-47c6-8f6a-d623645f3f4c"/>                <textFieldExpression><![CDATA[$V{Sum}]]></textFieldExpression>            </textField>        </band>    </detail></jasperReport>[/code]

 

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...