Jump to content
Changes to the Jaspersoft community edition download ×

Jasper Reports HTML LEFT And Right Width Issue


barshanap7

Recommended Posts

I have created a report with jasper reporting tool and showing it in our web application with angular 5 and rest api. While generating report in jasper, it shows unwanted white spaces on the left and right side of the report. I need to fit report on screen. Could you please support me to resolve this issue? I am attaching sample jasper code snippet and screen shot along with this.  I have attached the Jasper Html Preview image and jrxml code:

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0  --><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="Blank_A4_3" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="7a6b358b-ad00-496b-b13f-015688f8c679">    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>    <queryString language="SQL">        <![CDATA[select * from  "PRODUCT"]]>    </queryString>    <field name="ID" class="java.lang.Integer">        <property name="com.jaspersoft.studio.field.label" value="ID"/>        <property name="com.jaspersoft.studio.field.tree.path" value="PRODUCT"/>    </field>    <field name="NAME" class="java.lang.String">        <property name="com.jaspersoft.studio.field.label" value="NAME"/>        <property name="com.jaspersoft.studio.field.tree.path" value="PRODUCT"/>    </field>    <field name="COST" class="java.math.BigDecimal">        <property name="com.jaspersoft.studio.field.label" value="COST"/>        <property name="com.jaspersoft.studio.field.tree.path" value="PRODUCT"/>    </field>    <group name="ID">        <groupExpression><![CDATA[$F{ID}]]></groupExpression>    </group>    <group name="NAME">        <groupExpression><![CDATA[$F{NAME}]]></groupExpression>    </group>    <group name="COST">        <groupExpression><![CDATA[$F{COST}]]></groupExpression>    </group>    <background>        <band splitType="Stretch"/>    </background>    <title>        <band height="79" splitType="Stretch">            <staticText>                <reportElement x="0" y="15" width="560" height="30" uuid="e9ec1a69-b7b3-4e9b-9781-22530198b499"/>                <textElement textAlignment="Center">                    <font size="14" isBold="true"/>                </textElement>                <text><![CDATA[Company Name]]></text>            </staticText>        </band>    </title>    <pageHeader>        <band height="35" splitType="Stretch"/>    </pageHeader>    <columnHeader>        <band height="30" splitType="Stretch">            <staticText>                <reportElement x="4" y="0" width="100" height="30" uuid="6a80135c-446a-4da3-8794-298143da8e5c">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="0f999faf-25c6-46d2-bb2b-c8ba3a8f41f5"/>                </reportElement>                <text><![CDATA[iD]]></text>            </staticText>            <staticText>                <reportElement x="190" y="0" width="100" height="30" uuid="a47e2320-cc65-4f11-ba4f-4abaa322abb7">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="9c67fbee-b8c8-47d5-bb34-f6d24ea76ecd"/>                </reportElement>                <text><![CDATA[NAME]]></text>            </staticText>            <staticText>                <reportElement x="381" y="0" width="100" height="30" uuid="b27b8221-1869-452d-86bc-81a2762d9d6e">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="623faa99-74f9-4038-a8dc-eb366e29b807"/>                </reportElement>                <text><![CDATA[COST]]></text>            </staticText>        </band>    </columnHeader>    <detail>        <band height="39" splitType="Stretch">            <textField>                <reportElement x="4" y="9" width="100" height="30" uuid="b6181d4a-74bc-4103-ad8c-d50ed80e06de">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="0f999faf-25c6-46d2-bb2b-c8ba3a8f41f5"/>                </reportElement>                <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="190" y="9" width="100" height="30" uuid="f758c846-0616-49a7-bdf8-85e48898603e">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="9c67fbee-b8c8-47d5-bb34-f6d24ea76ecd"/>                </reportElement>                <textFieldExpression><![CDATA[$F{NAME}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="381" y="7" width="100" height="30" uuid="5f40a3b0-7b75-4ec0-8d85-6fdcce153b68">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="623faa99-74f9-4038-a8dc-eb366e29b807"/>                </reportElement>                <textFieldExpression><![CDATA[$F{COST}]]></textFieldExpression>            </textField>        </band>    </detail>    <columnFooter>        <band height="45" splitType="Stretch"/>    </columnFooter>    <pageFooter>        <band height="54" splitType="Stretch"/>    </pageFooter>    <summary>        <band height="42" splitType="Stretch"/>    </summary></jasperReport>[/code]

test.png

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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