Jump to content
Changes to the Jaspersoft community edition download ×

Why is a column missing when exporting to an xls(x) file?


rinse

Recommended Posts

I have got a report. When I run the preview all columns are visible in the preview.
But when I save it to a xls/xlsx file, one of the columns is missing the data. Do you have got any idea's why or how to fix that?

All related project files can be downloaded from here: myreports.zip

saldo_report.jpg.0aa7322d0f277a115a829db907d5b9f9.jpg

Thanks

saldo_report.jpg.9d8298c483783af29542402846281069.jpg

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Its not missing, its hidden. 

In your screenshot, see the Column names in excel. after J, L column is hidden and then is showing M column.

This is happening because of the alignement in the grid lines of JRXML. 

If you want a clean, unmerged excel sheet, then you need to use a Single Field per Grid Block. (each Grid block is 100 pixels except for the first one which is 80 pixels)

Link to comment
Share on other sites

check ths jrxml

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.4.2.final using JasperReports Library version 6.4.1  --><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="Saldo" pageWidth="595"              pageHeight="842" columnWidth="555"              leftMargin="20" rightMargin="20"              topMargin="30" bottomMargin="30"              uuid="ecf54744-a704-47f2-89ed-acbcaff6f1df">    <property name="com.jaspersoft.studio.data.defaultdataadapter"              value="OwnhelperTimeWriterDataAdapter.xml"/>    <import value="xso.report.utils.*"/>    <style name="Font_Normal" isDefault="true" fontName="Arial"           fontSize="10" pdfFontName="Helvetica" pdfEncoding="Cp1252"           isPdfEmbedded="false">        <box leftPadding="3" rightPadding="3"/>    </style>    <style name="Font_Bold" fontName="Arial" fontSize="10"           isBold="true" pdfFontName="Helvetica-Bold"           pdfEncoding="Cp1252" isPdfEmbedded="false">        <box leftPadding="3" rightPadding="3"/>    </style>    <style name="Font_Italic" fontName="Arial" fontSize="10"           isItalic="true" pdfFontName="Helvetica-Oblique"           pdfEncoding="Cp1252" isPdfEmbedded="false">        <box leftPadding="3" rightPadding="3"/>    </style>    <style name="Font_Balance" style="Font_Normal"           fontName="Arial" fontSize="10">        <conditionalStyle>            <conditionExpression>                <![CDATA[$V{SALDO} < 0]]>            </conditionExpression>            <style forecolor="#FF0000"/>        </conditionalStyle>    </style>    <style name="Font_Balance_Italic" style="Font_Balance"           fontName="Arial" fontSize="10" isItalic="true"/>    <style name="Font_Running_Balance" style="Font_Italic"           fontName="Arial" fontSize="10">        <conditionalStyle>            <conditionExpression>                <![CDATA[$V{SALDO_TOTAL} < 0]]>            </conditionExpression>            <style forecolor="#FF0000"/>        </conditionalStyle>    </style>    <parameter name="DECIMAL_SEPARATOR" class="java.lang.Character"               isForPrompting="false">        <defaultValueExpression>            <![CDATA[',']]>        </defaultValueExpression>    </parameter>    <parameter name="TITLE" class="java.lang.String"               isForPrompting="false"/>    <parameter name="DATE_PATTERN" class="java.lang.String"               isForPrompting="false">        <defaultValueExpression>            <![CDATA["dd-MM-yyyy"]]>        </defaultValueExpression>    </parameter>    <parameter name="TIME_PATTERN" class="java.lang.String"               isForPrompting="false">        <defaultValueExpression>            <![CDATA["H:mm"]]>        </defaultValueExpression>    </parameter>    <parameter name="COMPANY_LOGO" class="java.lang.String"               isForPrompting="false"/>    <parameter name="FOOTER_LABEL_GROUP" class="java.lang.String"               isForPrompting="false"/>    <parameter name="FOOTER_LABEL_FILTER" class="java.lang.String"               isForPrompting="false"/>    <field name="SALDO_IT_MED" class="java.lang.String"/>    <field name="SALDO_WEEK" class="java.lang.String"/>    <field name="SALDO_DUUR_TIJD" class="java.lang.Long"/>    <field name="SALDO_REFERENTIE_TIJD" class="java.lang.Long"/>    <field name="SALDO_DAGEN" class="java.lang.Long"/>    <variable name="SALDO_IT_MED_DAGEN_SUM" class="java.lang.Long"              resetType="Group" resetGroup="SALDO_IT_MED__TOTAAL"              calculation="Sum">        <variableExpression>            <![CDATA[$F{SALDO_DAGEN}]]>        </variableExpression>    </variable>    <variable name="SALDO_DAGEN_SUM_SUMMARY" class="java.lang.Long"              calculation="Sum">        <variableExpression>            <![CDATA[$F{SALDO_DAGEN}]]>        </variableExpression>    </variable>    <variable name="SALDO_IT_MEDSALDO_DUUR_TIJD__SUM"              class="java.lang.Long" resetType="Group"              resetGroup="SALDO_IT_MED__TOTAAL" calculation="Sum">        <variableExpression>            <![CDATA[$F{SALDO_DUUR_TIJD}]]>        </variableExpression>    </variable>    <variable name="SALDO_IT_MEDSALDO_REFERENTIE_TIJD__SUM"              class="java.lang.Long" resetType="Group"              resetGroup="SALDO_IT_MED__TOTAAL" calculation="Sum">        <variableExpression>            <![CDATA[$F{SALDO_REFERENTIE_TIJD}]]>        </variableExpression>    </variable>    <variable name="SALDO_DUUR_TIJD__SUM__SUMMARY"              class="java.lang.Long" calculation="Sum">        <variableExpression>            <![CDATA[$F{SALDO_DUUR_TIJD}]]>        </variableExpression>    </variable>    <variable name="SALDO_REFERENTIE_TIJD__SUM__SUMMARY"              class="java.lang.Long" calculation="Sum">        <variableExpression>            <![CDATA[$F{SALDO_REFERENTIE_TIJD}]]>        </variableExpression>    </variable>    <variable name="SALDO" class="java.lang.Long">        <variableExpression>            <![CDATA[$F{SALDO_DUUR_TIJD} - $F{SALDO_REFERENTIE_TIJD}]]>        </variableExpression>    </variable>    <variable name="SALDO_TOTAL" class="java.lang.Long"              resetType="Group" resetGroup="SALDO_IT_MED__TOTAAL"              calculation="Sum">        <variableExpression>            <![CDATA[$V{SALDO}]]>        </variableExpression>    </variable>    <group name="SALDO_IT_MED__TOTAAL"           isReprintHeaderOnEachPage="true"           minHeightToStartNewPage="40">        <groupExpression>            <![CDATA[$F{SALDO_IT_MED}]]>        </groupExpression>        <groupHeader>            <band height="15">                <textField isStretchWithOverflow="true">                    <reportElement style="Font_Bold"                                   mode="Opaque" x="0" y="0"                                   width="555" height="15"                                   backcolor="#BDD5EC"                                   uuid="72a5f48c-fd84-4b2e-9704-1350fd1e87a2"/>                    <textElement textAlignment="Left" verticalAlignment="Middle"/>                    <textFieldExpression>                        <![CDATA[string.valueOf($F{SALDO_IT_MED})]]>                    </textFieldExpression>                </textField>            </band>        </groupHeader>        <groupFooter>            <band height="21">                <frame>                    <reportElement mode="Opaque" x="0" y="0"                                   width="555" height="15" backcolor="#BDD5EC"                                   uuid="09d4a27b-0cb7-4cdf-ba7b-5f6805174188"/>                    <box padding="0">                        <topPen lineWidth="1.0" lineStyle="Double"                                lineColor="#0D62B2"/>                    </box>                    <textField isStretchWithOverflow="true">                        <reportElement style="Font_Italic" x="0" y="0"                                       width="130" height="15"                                       uuid="70d5281b-c79b-43bd-abcb-2023365e699d">                            <property name="com.jaspersoft.studio.unit.width"                                      value="pixel"/>                        </reportElement>                        <textFieldExpression>                            <![CDATA[string.valueOf($F{SALDO_IT_MED})]]>                        </textFieldExpression>                    </textField>                    <textField isStretchWithOverflow="true">                        <reportElement style="Font_Italic" x="130" y="0"                                       width="100" height="15"                                       uuid="64bdba19-0771-49d4-aa4a-d99e894d84f2">                            <property name="local_mesure_unitwidth" value="pixel"/>                            <property name="local_mesure_unitx" value="pixel"/>                            <property name="com.jaspersoft.studio.unit.x" value="pixel"/>                            <property name="local_mesure_unity" value="pixel"/>                            <property name="com.jaspersoft.studio.unit.y" value="px"/>                            <property name="com.jaspersoft.studio.unit.width" value="pixel"/>                        </reportElement>                        <textElement textAlignment="Right" verticalAlignment="Middle"/>                        <textFieldExpression>                            <![CDATA[$V{SALDO_IT_MEDSALDO_DUUR_TIJD__SUM}]]>                        </textFieldExpression>                    </textField>                    <textField isStretchWithOverflow="true">                        <reportElement style="Font_Italic" x="230" y="0"                                       width="75" height="15"                                       uuid="7386087a-4bd1-41d8-b01c-05759e959eed">                            <property name="local_mesure_unity" value="pixel"/>                            <property name="local_mesure_unitwidth" value="pixel"/>                            <property name="local_mesure_unitx" value="pixel"/>                            <property name="com.jaspersoft.studio.unit.x" value="pixel"/>                            <property name="com.jaspersoft.studio.unit.width" value="pixel"/>                        </reportElement>                        <textElement textAlignment="Right" verticalAlignment="Middle"/>                        <textFieldExpression>                            <![CDATA[$V{SALDO_IT_MEDSALDO_REFERENTIE_TIJD__SUM}]]>                        </textFieldExpression>                    </textField>                    <textField isStretchWithOverflow="true">                        <reportElement style="Font_Italic" x="305" y="1"                                       width="75" height="15"                                       uuid="d4144d42-c12f-4534-893e-6908bd58744c">                            <property name="local_mesure_unitx" value="pixel"/>                            <property name="com.jaspersoft.studio.unit.x" value="pixel"/>                        </reportElement>                        <textElement textAlignment="Right" verticalAlignment="Middle"/>                        <textFieldExpression>                            <![CDATA[$V{SALDO_IT_MED_DAGEN_SUM}]]>                        </textFieldExpression>                    </textField>                    <textField isStretchWithOverflow="true">                        <reportElement style="Font_Balance_Italic" x="380" y="1"                                       width="75" height="15"                                       uuid="b6e3a998-4b62-44fc-bb3d-1fd10acb8c68">                            <property name="local_mesure_unity" value="pixel"/>                            <property name="local_mesure_unitx" value="pixel"/>                            <property name="com.jaspersoft.studio.unit.x" value="pixel"/>                            <property name="com.jaspersoft.studio.unit.width" value="pixel"/>                        </reportElement>                        <textElement textAlignment="Right" verticalAlignment="Middle"/>                        <textFieldExpression>                            <![CDATA[$V{SALDO_TOTAL}]]>                        </textFieldExpression>                    </textField>                </frame>            </band>        </groupFooter>    </group>    <background>        <band height="782">            <rectangle radius="4">                <reportElement stretchType="RelativeToBandHeight"                               x="0" y="0" width="555" height="782"                               forecolor="#0D62B2"                               uuid="2394b119-07cb-4be2-884c-269c62df3838"/>                <graphicElement>                    <pen lineWidth="1.0"/>                </graphicElement>            </rectangle>        </band>    </background>    <pageHeader>        <band height="36">            <textField isStretchWithOverflow="true">                <reportElement style="Font_Bold" x="0" y="8"                               width="555" height="26" forecolor="#0D62B2"                               uuid="76157a5d-a308-412a-aa72-e67f9708db25"/>                <box leftPadding="40"/>                <textElement>                    <font size="16"/>                </textElement>                <textFieldExpression>                    <![CDATA[$P{TITLE}]]>                </textFieldExpression>            </textField>            <line>                <reportElement x="535" y="12" width="8" height="8"                               forecolor="#0D62B2"                               uuid="a0898faf-870f-49fc-832e-2a2320907592"/>            </line>            <line direction="BottomUp">                <reportElement x="535" y="12" width="8" height="8"                               forecolor="#0D62B2"                               uuid="ac2d6d48-d623-4f66-aa59-b7c6a0a7ac2a"/>            </line>        </band>    </pageHeader>    <columnHeader>        <band height="23">            <frame>                <reportElement mode="Opaque" x="0" y="0" width="555" height="23"                               forecolor="#FFFFFF" backcolor="#FFFFFF"                               uuid="85350719-9e1f-41f0-bf10-53bbdf3b36fe"/>                <box padding="0">                    <topPen lineWidth="1.0" lineColor="#0D62B2"/>                    <leftPen lineWidth="0.0"/>                    <bottomPen lineWidth="1.0" lineColor="#0D62B2"/>                    <rightPen lineWidth="0.0"/>                </box>                <staticText>                    <reportElement style="Font_Bold" x="0" y="0" width="130"                                   height="23"                                   uuid="8ab1affc-dee0-438f-8882-c89e11feba68">                        <property name="com.jaspersoft.studio.unit.width"                                  value="pixel"/>                        <property name="com.jaspersoft.studio.unit.x"                                  value="pixel"/>                    </reportElement>                    <text><![CDATA[Week]]></text>                </staticText>                <textField isStretchWithOverflow="true">                    <reportElement style="Font_Bold" mode="Transparent"                                   x="130" y="0" width="100" height="23"                                   forecolor="#000000" backcolor="#FFFFFF"                                   uuid="9402fc18-db35-4969-9fb2-2964cab5ea43">                        <property name="com.jaspersoft.studio.unit.width"                                  value="pixel"/>                        <property name="local_mesure_unitx" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.x" value="px"/>                        <property name="local_mesure_unity" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.y" value="px"/>                    </reportElement>                    <box padding="0" topPadding="0" leftPadding="3"                         bottomPadding="0" rightPadding="3"/>                    <textElement textAlignment="Right" verticalAlignment="Middle"                                 rotation="None" markup="none">                        <paragraph lineSpacing="Single" lineSpacingSize="1.0"                                   firstLineIndent="0" leftIndent="0" rightIndent="0"                                   spacingBefore="0" spacingAfter="0" tabStopWidth="40"/>                    </textElement>                    <textFieldExpression>                        <![CDATA["%Duration%"]]>                    </textFieldExpression>                </textField>                <textField isStretchWithOverflow="true" hyperlinkType="">                    <reportElement style="Font_Bold" mode="Transparent"                                   x="230" y="0" width="75" height="23"                                   forecolor="#000000" backcolor="#FFFFFF"                                   uuid="07d9daa6-3847-495b-9f8d-06f90d11745c">                        <property name="com.jaspersoft.studio.unit.width"                                  value="pixel"/>                        <property name="local_mesure_unitx" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.x" value="px"/>                        <property name="local_mesure_unitwidth" value="pixel"/>                    </reportElement>                    <box padding="0" topPadding="0" leftPadding="3"                         bottomPadding="0" rightPadding="3"/>                    <textElement textAlignment="Right" verticalAlignment="Middle"                                 rotation="None" markup="none">                        <paragraph lineSpacing="Single" lineSpacingSize="1.0"                                   firstLineIndent="0" leftIndent="0" rightIndent="0"                                   spacingBefore="0" spacingAfter="0"                                   tabStopWidth="40"/>                    </textElement>                    <textFieldExpression><![CDATA["RefHours"]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true">                    <reportElement style="Font_Bold" mode="Transparent"                                   x="380" y="1" width="75" height="23"                                   forecolor="#000000" backcolor="#FFFFFF"                                   uuid="140bef68-7215-40f3-a842-776ea2b13635">                        <property name="local_mesure_unitwidth" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.width"                                  value="pixel"/>                        <property name="local_mesure_unitx" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.x" value="pixel"/>                        <property name="local_mesure_unity" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.y" value="px"/>                    </reportElement>                    <box padding="0" topPadding="0" leftPadding="3"                         bottomPadding="0" rightPadding="3"/>                    <textElement textAlignment="Right" verticalAlignment="Middle"                                 rotation="None" markup="none">                        <paragraph lineSpacing="Single" lineSpacingSize="1.0"                                   firstLineIndent="0" leftIndent="0" rightIndent="0"                                   spacingBefore="0" spacingAfter="0"                                   tabStopWidth="40"/>                    </textElement>                    <textFieldExpression><![CDATA["%Balance%"]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true">                    <reportElement style="Font_Bold" mode="Transparent"                                   x="305" y="1" width="75" height="23"                                   forecolor="#000000" backcolor="#FFFFFF"                                   uuid="8eaf3bef-756f-4502-8258-36435bc2e783">                        <property name="local_mesure_unitx" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.x"                                  value="pixel"/>                        <property name="com.jaspersoft.studio.unit.width"                                  value="pixel"/>                    </reportElement>                    <box padding="0" topPadding="0" leftPadding="3"                         bottomPadding="0" rightPadding="3"/>                    <textElement textAlignment="Right" verticalAlignment="Middle"                                 rotation="None" markup="none">                        <paragraph lineSpacing="Single" lineSpacingSize="1.0"                                   firstLineIndent="0" leftIndent="0" rightIndent="0"                                   spacingBefore="0" spacingAfter="0" tabStopWidth="40"/>                    </textElement>                    <textFieldExpression>                        <![CDATA["%Days%"]]>                    </textFieldExpression>                </textField>                <textField isStretchWithOverflow="true">                    <reportElement key="" style="Font_Italic" mode="Transparent"                                   x="455" y="0" width="100" height="23"                                   forecolor="#000000" backcolor="#FFFFFF"                                   uuid="71e4886b-79d8-4cc8-9eba-8f3da3ba1d16">                        <property name="com.jaspersoft.studio.unit.width"                                  value="pixel"/>                        <property name="local_mesure_unitx" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.x"                                  value="pixel"/>                    </reportElement>                    <box padding="0" topPadding="0" leftPadding="3"                         bottomPadding="0" rightPadding="3"/>                    <textElement textAlignment="Right" verticalAlignment="Middle"                                 rotation="None" markup="none">                        <paragraph lineSpacing="Single" lineSpacingSize="1.0"                                   firstLineIndent="0" leftIndent="0" rightIndent="0"                                   spacingBefore="0" spacingAfter="0" tabStopWidth="40"/>                    </textElement>                    <textFieldExpression>                        <![CDATA["%RunningBalance%"]]>                    </textFieldExpression>                </textField>            </frame>        </band>    </columnHeader>    <detail>        <band height="15">            <textField isStretchWithOverflow="true">                <reportElement style="Font_Normal" x="0" y="0"                               width="130" height="15"                               uuid="897b6282-0fa5-4974-8901-db6273c00efa">                    <property name="com.jaspersoft.studio.unit.width"                              value="pixel"/>                </reportElement>                <textElement verticalAlignment="Middle"/>                <textFieldExpression>                    <![CDATA[$F{SALDO_WEEK}]]>                </textFieldExpression>            </textField>            <textField isStretchWithOverflow="true">                <reportElement style="Font_Normal" x="130" y="0"                               width="100" height="15"                               uuid="4774fec8-f59b-4e4f-88b5-94c662b841ae">                    <property name="local_mesure_unitwidth" value="pixel"/>                    <property name="local_mesure_unitx" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.x"                              value="pixel"/>                    <property name="com.jaspersoft.studio.unit.width"                              value="pixel"/>                </reportElement>                <textElement textAlignment="Right"                             verticalAlignment="Middle"/>                <textFieldExpression>                    <![CDATA[$F{SALDO_DUUR_TIJD}]]>                </textFieldExpression>            </textField>            <textField isStretchWithOverflow="true">                <reportElement style="Font_Normal" x="230" y="0"                               width="75" height="15"                               uuid="ffb7e711-a8e9-4f37-866e-82983c91a5dd">                    <property name="local_mesure_unitwidth" value="pixel"/>                    <property name="local_mesure_unitx" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.x"                              value="pixel"/>                    <property name="com.jaspersoft.studio.unit.width"                              value="pixel"/>                </reportElement>                <textElement textAlignment="Right"                             verticalAlignment="Middle"/>                <textFieldExpression>                    <![CDATA[$F{SALDO_REFERENTIE_TIJD}+ "test"]]>                </textFieldExpression>            </textField>            <textField isStretchWithOverflow="true">                <reportElement key="" style="Font_Balance" x="380" y="0"                               width="75" height="15"                               uuid="33e9cba8-8915-48ad-94b0-7043295997fd">                    <property name="local_mesure_unitwidth" value="pixel"/>                    <property name="local_mesure_unitx" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.x"                              value="pixel"/>                    <property name="com.jaspersoft.studio.unit.width"                              value="pixel"/>                </reportElement>                <textElement textAlignment="Right"                             verticalAlignment="Middle"/>                <textFieldExpression>                    <![CDATA[$V{SALDO}]]>                </textFieldExpression>            </textField>            <textField isStretchWithOverflow="true">                <reportElement style="Font_Normal" x="305" y="0"                               width="75" height="15"                               uuid="35dce027-eba3-4c7c-ab50-c7ab9e2c740d">                    <property name="local_mesure_unitx" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.x"                              value="pixel"/>                    <property name="com.jaspersoft.studio.unit.width"                              value="pixel"/>                </reportElement>                <textElement textAlignment="Right"                             verticalAlignment="Middle"/>                <textFieldExpression>                    <![CDATA[$F{SALDO_DAGEN}]]>                </textFieldExpression>            </textField>            <textField isStretchWithOverflow="true">                <reportElement style="Font_Running_Balance"                               x="455" y="0" width="100" height="15"                               uuid="adf538d2-f004-4625-82cd-5cb1e8fdbc6b">                    <property name="local_mesure_unitwidth" value="pixel"/>                    <property name="local_mesure_unitx" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.x"                              value="pixel"/>                    <property name="com.jaspersoft.studio.unit.width"                              value="pixel"/>                </reportElement>                <box>                    <leftPen lineWidth="0.0" lineColor="#0D62B2"/>                </box>                <textElement textAlignment="Right"                    verticalAlignment="Middle"/>                <textFieldExpression>                    <![CDATA[$V{SALDO_TOTAL}]]>                </textFieldExpression>            </textField>        </band>    </detail>    <pageFooter>        <band height="19">            <property name="local_mesure_unitheight" value="pixel"/>            <property name="com.jaspersoft.studio.unit.height" value="px"/>            <frame>                <reportElement stretchType="RelativeToBandHeight"                               x="0" y="0" width="555" height="19"                               uuid="983630ca-72e3-4dca-810c-21e82873bd6d">                    <property name="local_mesure_unitheight" value="pixel"/>                    <property name="com.jaspersoft.studio.unit.height"                              value="px"/>                </reportElement>                <box padding="0">                    <topPen lineWidth="1.0" lineColor="#0D62B2"/>                </box>                <textField isStretchWithOverflow="true">                    <reportElement style="Font_Normal" x="455" y="3"                                   width="100" height="14"                                   uuid="d126a519-03ad-4aca-9e4f-289fa914660e">                        <property name="com.jaspersoft.studio.unit.width"                                  value="pixel"/>                    </reportElement>                    <textElement textAlignment="Right"/>                    <textFieldExpression>                        <![CDATA["%PAGE% " + $V{PAGE_NUMBER}]]>                    </textFieldExpression>                </textField>            </frame>        </band>    </pageFooter>    <summary>        <band height="15">            <frame>                <reportElement x="0" y="0" width="555" height="15"                               uuid="a1b47b44-6150-40c1-a150-99afed0ea94e"/>                <box padding="0">                    <topPen lineWidth="1.0" lineColor="#0D62B2"/>                    <bottomPen lineWidth="1.0" lineColor="#0D62B2"/>                </box>                <textField isStretchWithOverflow="true">                    <reportElement style="Font_Bold" mode="Transparent"                                   x="0" y="0" width="130" height="15"                                   forecolor="#000000" backcolor="#FFFFFF"                                   uuid="96b121be-39b4-4998-bc53-e5c16f17f0db"/>                    <box padding="0" topPadding="0" leftPadding="3"                         bottomPadding="0" rightPadding="3"/>                    <textElement textAlignment="Left" verticalAlignment="Middle"                                 rotation="None" markup="none">                        <paragraph lineSpacing="Single" lineSpacingSize="1.0"                                   firstLineIndent="0" leftIndent="0"                                   rightIndent="0" spacingBefore="0"                                   spacingAfter="0" tabStopWidth="40"/>                    </textElement>                    <textFieldExpression>                        <![CDATA["%EndTotal%"]]>                    </textFieldExpression>                </textField>                <textField isStretchWithOverflow="true">                    <reportElement style="Font_Bold" x="130" y="0"                                   width="100" height="15"                                   uuid="a79032d4-9f81-4ecb-b45d-a9adfbbe2df0">                        <property name="com.jaspersoft.studio.unit.x"                                  value="px"/>                    </reportElement>                    <textElement textAlignment="Right" verticalAlignment="Middle"/>                    <textFieldExpression>                        <![CDATA[$V{SALDO_DUUR_TIJD__SUM__SUMMARY}]]>                    </textFieldExpression>                </textField>                <textField isStretchWithOverflow="true">                    <reportElement style="Font_Bold" x="230" y="0"                                   width="75" height="15"                                   uuid="103a298b-0daf-42b5-863a-9b7a09f7b09d">                        <property name="local_mesure_unity" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.y" value="px"/>                    </reportElement>                    <textElement textAlignment="Right" verticalAlignment="Middle"/>                    <textFieldExpression>                        <![CDATA[$V{SALDO_REFERENTIE_TIJD__SUM__SUMMARY}]]>                    </textFieldExpression>                </textField>                <textField isStretchWithOverflow="true">                    <reportElement style="Font_Bold" x="305" y="1"                                   width="75" height="15"                                   uuid="f59b6861-a713-4297-be8c-3335c2934c39">                        <property name="local_mesure_unitx" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.x"                                  value="px"/>                        <property name="local_mesure_unitwidth"                                  value="pixel"/>                        <property name="com.jaspersoft.studio.unit.width"                                  value="px"/>                    </reportElement>                    <textElement textAlignment="Right"                                 verticalAlignment="Middle"/>                    <textFieldExpression>                        <![CDATA[$V{SALDO_DAGEN_SUM_SUMMARY}]]>                    </textFieldExpression>                </textField>                <textField isStretchWithOverflow="true">                    <reportElement style="Font_Bold" x="380" y="1"                                   width="75" height="15"                                   uuid="fa37d559-a0ce-482b-9c9e-52df73ad63ac">                        <property name="local_mesure_unity" value="pixel"/>                        <property name="local_mesure_unitx" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.x"                                  value="px"/>                        <property name="com.jaspersoft.studio.unit.width"                                  value="px"/>                    </reportElement>                    <textElement textAlignment="Right" verticalAlignment="Middle"/>                    <textFieldExpression>                        <![CDATA[$V{SALDO_DUUR_TIJD__SUM__SUMMARY} - $V{SALDO_REFERENTIE_TIJD__SUM__SUMMARY}]]>                    </textFieldExpression>                </textField>            </frame>        </band>    </summary></jasperReport>[/code]

 

Link to comment
Share on other sites

Thanks it works, but I don't understand.

I see you have added some lines like this:

<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>

Could you explain it?

Could I find it in a any document?

I also noticed I have less columns. In the old jrxml there was next to each column a very small column. Is there a expaination for this?

I actually need to generate the jrxml using the JasperDesign API from java code. How should I do that?

I noticed you sometimes added both properties (...unit.x and ...unit.width), but sometimes you have added one of theme. How should I know which one is missing?

Thanks for all the help!

Link to comment
Share on other sites

As mentioned in my first answer, it was alignment issue in the grid lines of a jrxml. (please mark the jrxml comment as correct so that it can be resolved)

dont worry about com.jaspersoft.studio.unit.x and y units. These are added by the tool itself. 

Lets say you have 6 columns in a report along with some subtotals ,headers and you want to export it to excel.  

All the text fields in all the bands should align with each other in vertical pattern. One field should not overlap with the other field in any way. 

play around with a simple jrxml by placing text fields here and there... you will understand. 

for your API question. refer this tutorialspoint site https://www.tutorialspoint.com/jasper_reports/jasper_exporting_reports.htm

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