Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9239345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:57:59+00:00 2026-06-18T07:57:59+00:00

I am using jasper report to export my excel report in my liferay custom

  • 0

I am using jasper report to export my excel report in my liferay custom portlet JSP Page.

now what happen is when i set IS_IGNORE_GRAPHICS property false then its showing image in excel report.but then the column of excel report not showing any border..and if i set it to true then its not showing image and then every column comes with border..now what i want is both as image on the excel report as well as the cell border of the excel report.

following is my jrxml file

<?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="RestaurantReport" language="groovy" pageWidth="595" pageHeight="520" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isFloatColumnFooter="true">
    <property name="ireport.zoom" value="1.1000000000000032"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <property name="net.sf.jasperreports.export.xls.ignore.graphics" value="false"/>
    <style name="table">
        <box>
            <pen lineWidth="1.0" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <subDataset name="Table Dataset 1"/>
    <field name="advertisename" class="java.lang.String"/>
    <field name="camp_name" class="java.lang.String"/>
    <field name="ad_location" class="java.lang.String"/>
    <field name="clicked" class="java.lang.Integer"/>
    <field name="impression" class="java.lang.Integer"/>
    <field name="filter_start_date" class="java.util.Date"/>
    <field name="filter_end_date" class="java.util.Date"/>
    <field name="ctr" class="java.lang.Float"/>
    <field name="restaurantname" class="java.lang.String"/>
    <field name="medianame" class="java.lang.String"/>
    <variable name="RestaurantTotal" class="java.lang.Integer" resetType="Group" resetGroup="Restaurant Name" calculation="Sum">
        <variableExpression><![CDATA[$F{impression}]]></variableExpression>
    </variable>
    <variable name="RestaurantGrandTotal" class="java.lang.Integer" calculation="Sum">
        <variableExpression><![CDATA[$F{impression}]]></variableExpression>
    </variable>
    <variable name="CTR Total" class="java.lang.Float" resetType="Group" resetGroup="Restaurant Name" calculation="Sum">
        <variableExpression><![CDATA[$F{ctr}]]></variableExpression>
    </variable>
    <variable name="CTRGrandtotal" class="java.lang.Float" calculation="Sum">
        <variableExpression><![CDATA[$F{ctr}]]></variableExpression>
    </variable>
    <variable name="ClickTotal" class="java.lang.Integer" calculation="Sum">
        <variableExpression><![CDATA[$F{clicked}]]></variableExpression>
    </variable>
    <variable name="ClickGrandTotal" class="java.lang.Integer" resetType="Group" resetGroup="Restaurant Name" calculation="Sum">
        <variableExpression><![CDATA[$F{clicked}]]></variableExpression>
    </variable>
    <group name="Restaurant Name" isReprintHeaderOnEachPage="true">
        <groupExpression><![CDATA[$F{restaurantname}]]></groupExpression>
        <groupHeader>
            <band height="50">
                <staticText>
                    <reportElement mode="Opaque" x="0" y="30" width="149" height="20" forecolor="#FFFFFF" backcolor="#0FAAC2"/>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="10" isBold="true"/>
                        <paragraph firstLineIndent="4"/>
                    </textElement>
                    <text><![CDATA[Advertise Name]]></text>
                </staticText>
                <staticText>
                    <reportElement mode="Opaque" x="412" y="30" width="46" height="20" forecolor="#FFFFFF" backcolor="#0FAAC2"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="10" isBold="true"/>
                    </textElement>
                    <text><![CDATA[Click]]></text>
                </staticText>
                <staticText>
                    <reportElement mode="Opaque" x="283" y="30" width="78" height="20" isPrintInFirstWholeBand="true" forecolor="#FFFFFF" backcolor="#0FAAC2"/>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="10" isBold="true"/>
                        <paragraph firstLineIndent="2"/>
                    </textElement>
                    <text><![CDATA[AD Location]]></text>
                </staticText>
                <staticText>
                    <reportElement mode="Opaque" x="458" y="30" width="51" height="20" forecolor="#FFFFFF" backcolor="#0FAAC2"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="10" isBold="true"/>
                    </textElement>
                    <text><![CDATA[Impression]]></text>
                </staticText>
                <textField>
                    <reportElement x="0" y="10" width="284" height="20"/>
                    <textElement verticalAlignment="Middle">
                        <font isBold="true" isUnderline="false"/>
                    </textElement>
                    <textFieldExpression><![CDATA["Restaurant Name : "+ $F{restaurantname}]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement mode="Opaque" x="149" y="30" width="134" height="20" isPrintInFirstWholeBand="true" forecolor="#FFFFFF" backcolor="#0FAAC2"/>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="10" isBold="true"/>
                        <paragraph firstLineIndent="4"/>
                    </textElement>
                    <text><![CDATA[Campaign]]></text>
                </staticText>
                <staticText>
                    <reportElement mode="Opaque" x="509" y="30" width="46" height="20" forecolor="#FFFFFF" backcolor="#0FAAC2"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="10" isBold="true"/>
                    </textElement>
                    <text><![CDATA[CTR (%)]]></text>
                </staticText>
                <staticText>
                    <reportElement mode="Opaque" x="361" y="30" width="51" height="20" forecolor="#FFFFFF" backcolor="#0FAAC2"/>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="10" isBold="true"/>
                        <paragraph firstLineIndent="4" leftIndent="10"/>
                    </textElement>
                    <text><![CDATA[Type]]></text>
                </staticText>
            </band>
        </groupHeader>
        <groupFooter>
            <band height="21">
                <textField pattern="###0.00">
                    <reportElement x="509" y="1" width="47" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$V{ClickTotal}/$V{RestaurantTotal}*100]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="412" y="0" width="46" height="21"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman" isBold="true"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$V{ClickTotal}]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement x="270" y="1" width="142" height="20"/>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Times New Roman" isBold="true"/>
                        <paragraph leftIndent="5"/>
                    </textElement>
                    <text><![CDATA[Group Total ]]></text>
                </staticText>
                <textField pattern="" isBlankWhenNull="true">
                    <reportElement x="458" y="1" width="51" height="20"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
                        <font fontName="Times New Roman" isBold="true"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$V{RestaurantTotal}]]></textFieldExpression>
                </textField>
            </band>
        </groupFooter>
    </group>
    <background>
        <band splitType="Stretch"/>
    </background>
    <pageHeader>
        <band height="113">
            <image scaleImage="RetainShape" isUsingCache="true">
                <reportElement x="414" y="0" width="139" height="65"/>
                <imageExpression><![CDATA["C:\\Liferay\\tomcat-7.0.27\\webapps\\eMenuAdvertise-portlet\\img\\eMenuLogo.png"]]></imageExpression>
            </image>
            <textField pattern="MM/dd/yyyy h.mm a Z">
                <reportElement x="30" y="0" width="100" height="20"/>
                <textElement textAlignment="Justified">
                    <font fontName="Times New Roman" isUnderline="false"/>
                </textElement>
                <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
            </textField>
            <textField pattern="MM/dd/yyyy">
                <reportElement x="30" y="93" width="64" height="20"/>
                <textElement textAlignment="Justified" verticalAlignment="Middle"/>
                <textFieldExpression><![CDATA[$F{filter_start_date}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="0" y="0" width="30" height="20"/>
                <textElement>
                    <font fontName="Times New Roman" isBold="true"/>
                </textElement>
                <text><![CDATA[Date : ]]></text>
            </staticText>
            <staticText>
                <reportElement x="94" y="93" width="19" height="20"/>
                <textElement verticalAlignment="Middle">
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[To:]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="93" width="30" height="20"/>
                <textElement verticalAlignment="Middle">
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[From:]]></text>
            </staticText>
            <textField pattern="MM/dd/yyyy">
                <reportElement x="113" y="93" width="100" height="20"/>
                <textElement textAlignment="Justified" verticalAlignment="Middle"/>
                <textFieldExpression><![CDATA[$F{filter_end_date}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="130" y="23" width="283" height="67"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="Arial Black" size="16" isBold="true" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Restaurant Report]]></text>
            </staticText>
        </band>
    </pageHeader>
    <columnHeader>
        <band/>
    </columnHeader>
    <detail>
        <band height="18" splitType="Immediate">
            <textField>
                <reportElement mode="Transparent" x="0" y="1" width="149" height="15"/>
                <textElement textAlignment="Left" verticalAlignment="Middle" markup="html">
                    <font fontName="Times New Roman" size="9"/>
                    <paragraph lineSpacing="Single" firstLineIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{advertisename}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement mode="Transparent" x="283" y="1" width="78" height="15" backcolor="#FFFFFF"/>
                <textElement textAlignment="Left" verticalAlignment="Middle" markup="html">
                    <font fontName="Times New Roman" size="9"/>
                    <paragraph lineSpacing="Single" firstLineIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{ad_location}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement mode="Transparent" x="458" y="1" width="51" height="15"/>
                <textElement textAlignment="Center" verticalAlignment="Middle" markup="html">
                    <font fontName="Times New Roman" size="9"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{impression}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement mode="Transparent" x="412" y="1" width="46" height="15"/>
                <textElement textAlignment="Center" verticalAlignment="Middle" markup="html">
                    <font fontName="Times New Roman" size="9"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{clicked}]]></textFieldExpression>
            </textField>
            <line direction="BottomUp">
                <reportElement x="0" y="16" width="555" height="1"/>
                <graphicElement>
                    <pen lineWidth="0.5" lineStyle="Solid"/>
                </graphicElement>
            </line>
            <textField>
                <reportElement x="149" y="1" width="134" height="15"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="9"/>
                    <paragraph firstLineIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{camp_name}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="509" y="1" width="46" height="15"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{ctr}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="361" y="1" width="51" height="15"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="9"/>
                    <paragraph firstLineIndent="5" leftIndent="10"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{medianame}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band/>
    </columnFooter>
    <pageFooter>
        <band height="23" splitType="Immediate">
            <textField>
                <reportElement x="226" y="0" width="80" height="20"/>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Times New Roman" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
            </textField>
            <textField evaluationTime="Report">
                <reportElement x="308" y="0" width="40" height="20"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="Times New Roman" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
        </band>
    </pageFooter>
    <lastPageFooter>
        <band height="20" splitType="Immediate">
            <textField evaluationTime="Report">
                <reportElement x="308" y="0" width="40" height="20"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="Times New Roman" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="228" y="0" width="80" height="20"/>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Times New Roman" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
            </textField>
        </band>
    </lastPageFooter>
    <summary>
        <band height="20">
            <staticText>
                <reportElement x="257" y="0" width="155" height="20"/>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="11" isBold="true"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <text><![CDATA[Grand Total]]></text>
            </staticText>
            <textField pattern="###0" isBlankWhenNull="false">
                <reportElement x="458" y="0" width="51" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{RestaurantGrandTotal}]]></textFieldExpression>
            </textField>
            <textField pattern="###0.00">
                <reportElement x="509" y="0" width="45" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{ClickGrandTotal}/$V{RestaurantGrandTotal}*100]]></textFieldExpression>
            </textField>
            <textField pattern="###0">
                <reportElement x="412" y="0" width="46" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{ClickGrandTotal}]]></textFieldExpression>
            </textField>
        </band>
    </summary>
    <noData>
        <band/>
    </noData>
</jasperReport>

these is the properties i set before exporting to excel file

exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT,
                jasperPrint);
        exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM,
                byteArrayOutputStream);
        exporterXLS.setParameter(JRXlsExporterParameter.IS_IGNORE_CELL_BORDER,
                Boolean.FALSE);
        exporterXLS.setParameter(
                JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
        exporterXLS.setParameter(
                JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,
                Boolean.TRUE);
        exporterXLS.setParameter(JRXlsExporterParameter.IS_COLLAPSE_ROW_SPAN,
                Boolean.TRUE);
        exporterXLS.setParameter(
                JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS,
                Boolean.TRUE);
        exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET,
                Boolean.FALSE);
        exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE,
                Boolean.FALSE);

        exporterXLS.setParameter(JRXlsExporterParameter.IS_IGNORE_GRAPHICS,
                Boolean.FALSE);

So can Anyone Please guide me that how can i export to Standard excel file from jasper with the image cell border and the excel file look likes normal excel file.**other problem is that **its not even coming in proper alignment.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:58:00+00:00Added an answer on June 18, 2026 at 7:58 am

    With the Above Function i have set all parameter thats helps me to achieve this..posting this for the people who have still problems to export excel file with jasper.thanx

      private void SetExcelReportParameter(JRXlsExporter exporterXLS,
                    JasperPrint jasperPrint, ByteArrayOutputStream byteArrayOutputStream) {
    
                exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT,
                        jasperPrint);
                exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM,
                        byteArrayOutputStream);
                exporterXLS.setParameter(JRXlsExporterParameter.IS_IGNORE_CELL_BORDER,
                        Boolean.FALSE);
                exporterXLS.setParameter(
                        JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
                exporterXLS.setParameter(
                        JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,
                        Boolean.TRUE);
                exporterXLS.setParameter(JRXlsExporterParameter.IS_COLLAPSE_ROW_SPAN,
                        Boolean.TRUE);
    
                exporterXLS.setParameter(
                        JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS,
                        Boolean.TRUE);
                exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET,
                        Boolean.FALSE);
                exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE,
                        Boolean.TRUE);
    
                exporterXLS.setParameter(JRXlsExporterParameter.IS_IMAGE_BORDER_FIX_ENABLED,
                        Boolean.TRUE);
                exporterXLS.setParameter(JRXlsExporterParameter.IS_FONT_SIZE_FIX_ENABLED,
                        Boolean.TRUE);
    
                exporterXLS.setParameter(JRXlsExporterParameter.IS_IGNORE_GRAPHICS,
                        Boolean.FALSE);
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a report to be exported in excel, pdf and word using jasper
How does one apply custom CSS to a HTML report generated using Jasper. I
How to display jasper reports in JSP page? I am using iReport1.3.3 tool to
I am using jasper reports and groovy/grails and i want to export report in
Current Excel Report is created using Jasper Server / Jasper Report 3.8. In my
I am using Jasper Report 4.5 My problem is I have list of employees
Is there a way to export a Jasper report in PDF where designated fields
I am using *.jasper report generated with iReport in Java program. I need to
How to dynamically remove the legend from a chart using the Jasper report API?
I generate a report in doc format using Jasper, Jasper uses JRRTFExporter to generate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.