Jump to content
Changes to the Jaspersoft community edition download ×

Excel sheets renaming


del253253

Recommended Posts

Hello,

I am using Jaspersoft Studio (community edition, version 6.20.0).

I have a report book that contains multiple Jasper reports and I would like to rename the sheets when exporting them to excel, I have tried doing the following:

 

<property name="net.sf.jasperreports.export.xls.sheet.names.all" value="First sheet/Second sheet/Third sheet" />


<property name="net.sf.jasperreports.export.xls.sheet.names.sheet1" value="First sheet" />
<property name="net.sf.jasperreports.export.xls.sheet.names.sheet2" value="Second sheet" />

<property name="net.sf.jasperreports.export.xls.sheet.names.sheet2" value="Third sheet" />

 

But each time the sheets names are: First sheet, First sheet 2, First sheet 3

Any assistance would be appreciated.

 

This is my JRXML code:

 

<?xml version="1.0" encoding="UTF-8"?>
<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="main" pageWidth="595" pageHeight="842" sectionType="Part" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" whenResourceMissingType="Empty" uuid="n20160a4-8ae4-4xcf-a579-33afba860e8a">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="New Data Adapter"/>
    <property name="net.sf.jasperreports.print.create.bookmarks" value="true"/>
    <property name="net.sf.jasperreports.export.xls.sheet.names.all" value="First sheet/Second sheet/Third sheet" />
    <parameter name="REPORT_NAME" class="java.lang.String"/>
    <parameter name="REPORT_ID" class="java.lang.String"/>

    <field name="org_name" class="java.lang.String"/>
    <detail>
        <part uuid="6c97a611-6006-43f7-a920-03a12f258c7f">
            <p:subreportPart xmlns:p="http://jasperreports.sourceforge.net/jasperreports/parts" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/parts http://jasperreports.sourceforge.net/xsd/parts.xsd" usingCache="false">
                <subreportParameter name="REPORT_CONNECTION_ID">
                    <subreportParameterExpression><![CDATA[$P{REPORT_CONNECTION_ID}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="REPORT_NAME">
                    <subreportParameterExpression><![CDATA[$P{REPORT_NAME}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="REPORT_ID">
                    <subreportParameterExpression><![CDATA[$P{REPORT_ID}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportExpression><![CDATA["general.jasper"]]></subreportExpression>
            </p:subreportPart>
        </part>
        <part uuid="00730a87-4701-00ad-x10e-b0d07037aa0f">
            <p:subreportPart xmlns:p="http://jasperreports.sourceforge.net/jasperreports/parts" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/parts http://jasperreports.sourceforge.net/xsd/parts.xsd" usingCache="false">
                <subreportParameter name="REPORT_CONNECTION_ID">
                    <subreportParameterExpression><![CDATA[$P{REPORT_CONNECTION_ID}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="REPORT_NAME">
                    <subreportParameterExpression><![CDATA[$P{REPORT_NAME}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="REPORT_ID">
                    <subreportParameterExpression><![CDATA[$P{REPORT_ID}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportExpression><![CDATA["detailed.jasper"]]></subreportExpression>
            </p:subreportPart>
        </part>
    </detail>
</jasperReport>
 

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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