Shahbaz Ali Posted February 22 Share Posted February 22 I've created a jasper report by using Jaspersoft studio.In my report I've only 2 textfields which contains strings and I've placed one textfield on LHS and second textfield on RHS.When I open the preview in PDF and Java It's giving fine but in HTML preview it's givng some extra spaces on LHS and RHS.How can I remove these spaces in HTML preview? Here's my Jrxml code <?xml version="1.0" encoding="UTF-8"?> <!-- Created with Jaspersoft Studio version 6.20.6.final using JasperReports Library version 6.20.6-5c96b6aa8a39ac1dc6b6bea4b81168e16dd39231 --> <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="Test" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ebf35dbb-b084-4b9d-952b-390e89df01c1"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Activity Data Adapter"/> <queryString language="json"> <![CDATA[]]> </queryString> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"/> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="61" splitType="Stretch"/> </columnHeader> <detail> <band height="125" splitType="Stretch"> <textField> <reportElement x="-16" y="42" width="100" height="30" uuid="a48f45de-e859-4e55-85b8-fed076121d14"> <property name="com.jaspersoft.studio.unit.x" value="px"/> </reportElement> <textFieldExpression><![CDATA["New"]]></textFieldExpression> </textField> <textField> <reportElement x="472" y="42" width="100" height="30" uuid="a98fb27c-8215-45d5-85aa-a1ff4fb6e7d7"> <property name="com.jaspersoft.studio.unit.y" value="px"/> </reportElement> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA["Report"]]></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> Here's HTML Preview Link to comment Share on other sites More sharing options...
Thomas Tibcken Posted March 5 Share Posted March 5 Hi Shahbaz Ali, can you please tell us more about your environment like version of Jaspersoft, OS of Studio and Server. Can you provide a simple example and upload it as a .jrxml (no copy&paste of code), so we can try to reproduce what you describe. THX TT Link to comment Share on other sites More sharing options...
Shahbaz Ali Posted March 6 Author Share Posted March 6 13 hours ago, Thomas Tibcken said: Hi Shahbaz Ali, can you please tell us more about your environment like version of Jaspersoft, OS of Studio and Server. Can you provide a simple example and upload it as a .jrxml (no copy&paste of code), so we can try to reproduce what you describe. THX TT I've jaspersoft studio 6.20.6 and OS is ubuntu 22.04 Here's my jrxml file Test.jrxml Link to comment Share on other sites More sharing options...
Thomas Tibcken Posted March 12 Share Posted March 12 Hi Shahbaz Ali, thx for providing the example. What you see is the same pixel perfect result for all Formats. Jaspersoft HTML Reports output is not like a responsive HTML Web-Page - it will center the Report and keep all pixel from the template as defined. In your example you use the A4 Page / Unit Pixel ... you would need % of the screen to make it responsive. I will check if there is a propertie for HTML Format to generate a HTML Report with reponsive layout. Regards TT Link to comment Share on other sites More sharing options...
Solution Thomas Tibcken Posted March 12 Solution Share Posted March 12 Please look at this articel: https://stackoverflow.com/questions/57889915/how-to-adapt-the-report-size-to-screen-size-when-exporting-to-html Regards TT 1 Link to comment Share on other sites More sharing options...
Shahbaz Ali Posted March 12 Author Share Posted March 12 1 hour ago, Thomas Tibcken said: Please look at this articel: https://stackoverflow.com/questions/57889915/how-to-adapt-the-report-size-to-screen-size-when-exporting-to-html Regards TT Thanks it's working Thomas 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now