Why does the column header repeat in excel output when run from visualize commands?

0

jasperserver Version: 6.0.0Build: 20141128_1450

my report contains a title band with a customized title depending on input parameters and then the detail band contains a table for the subquery.

the table has a column header row which is repeated for each of my pdf pages.  However, if I specify xlsx output, I don't want it to repeat.  If I run the query directly from jasperserver and then use the file icon to select export as xlsx, I get my 2 rows of title and 1 row of column header.  If I run the query via my visualize.js calls, I get 2 rows of title, and the column row is repeated every page.  How do I get rid of that?  I have the following properties in my jrxml

<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="ContributionsByFilerID" language="groovy" pageWidth="792" pageHeight="612" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="604b7d16-b321-4d3f-b4d7-290ff6ab6d3d">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="TECInternal"/>
<property name="ireport.jasperserver.url" value="http://10.10.10.32:8082/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="jasperadmin"/>
<property name="ireport.jasperserver.report.resource" value="/public/Test_Data/ContributionsByFilerID_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/public/Test_Data/ContributionsByFilerID"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
<property name="net.sf.jasperreports.export.xls.ignore.cell.background" value="true"/>
<property name="net.sf.jasperreports.export.xls.ignore.anchors" value="true"/>
<property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.1" value="pageFooter"/>
 
I have tried <property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.2" value="columnHeader"/> but it changes nothing so I removed it.

The following is  the container I use.  I get multiple rows of just column headers.  The code $outputformat in red below is either pdf or xlsx.

Container code:

var t = encodeURIComponent("u=PUBLIC2|expireTime=';
echo $expire;
echo '");
visualize({
auth: {
           token: t,
           preAuth: true,
           tokenName: "tec-pp"
   }
}, function (v) {
        //render report from provided resource
        var $button = $("#button");
        var is_ready = false;
        var export_pending = false;
        var report = v.report({
            resource: "';
echo $reportString;
echo '",           container: "#container",';
echo $parmString;
echo ',
            error: handleError,
            success: onVisualizeReady
        });
 
 
        //show error
        function handleError(err){
            alert(err.message);
        }
    
        function onVisualizeReady(){
            is_ready=true;
            if (export_pending) {
                alert("running pending")
                doExport();
            }
        }
    
        function doExport(){
            report.export({ outputFormat: "';
echo $outputformat;
echo '" }).done(function (link) {
                window.open(link.href); // open new window to download report
            }).fail(function (err) {
                alert(err.message);
            });      
        }
    
        $button.click(function () {
            if (is_ready) {
                doExport();
            }
            else {
                alert("pending");
                export_pending = true;
            }
        });
 
 
 
 

 

patricia.williams's picture
Joined: Mar 8 2015 - 7:57am
Last seen: 11 months 1 day ago

1 Answer:

0

Seems like you're missing some properties to exclude header from a band.

http://community.jaspersoft.com/wiki/how-can-i-suppress-page-headers-and...

hozawa's picture
45109
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 month 1 week ago
Feedback