Detect export format to hide/exclude a band

0

Hello,

I want to hide/exclude pageHeader band when the export format is html or pdf.

I used the sintax <property name="net.sf.jasperreports.export.html.exclude.key.element"/> but this keep the pageHeader band with white space.

Is there any formula can I put in "print when expression" of pageHeader band?

I need a formula like this: if (exportFormat.equals("html") || exportFormat.equals("pdf")) false else true

ibedini's picture
14
Joined: Nov 30 2015 - 3:53am
Last seen: 4 months 1 week ago

3 Answers:

0

I just created a variable for the export type. In my front end page where report export type is selected, I just added this parameter to the URL on the report. 

 

hozawa's picture
57826
Joined: Apr 24 2010 - 4:31pm
Last seen: 8 months 2 weeks ago
0

I use visualize.js. For export I use the following javascript function:

window.customExport = function(format) {
                    report.run(
                            function(){
                                report.export({
                                    outputFormat: format
                                    })
                                    .done(function (link) {
                                    window.open(link.href); // open new window to download report
                                })
                                    .fail(function(err) {
                                    alert(err);
                                });
                            }
                            )
                            .fail(function(err) {
                                alert(err);
                            });
                };

 

How can I pass a parameter like you suggested?

ibedini's picture
14
Joined: Nov 30 2015 - 3:53am
Last seen: 4 months 1 week ago
0

This syntax works fine for me to exclude title and pagefooter bands on pdf export.

<property name="net.sf.jasperreports.export.pdf.exclude.origin.band.1" value="title"/>

<property name="net.sf.jasperreports.export.pdf.exclude.origin.band.2" value="pageFooter"/>

 
horseman's picture
112
Joined: Oct 17 2011 - 11:30pm
Last seen: 6 hours 5 min ago
Feedback
randomness