amartynov Posted March 30, 2022 Share Posted March 30, 2022 Good afternoon. My report should draw a folder tree in the project. In html, everything is rendered perfectly, but if I save it to pdf, the content is cut off. How can this be avoided?html:pdf:To crawl the folder tree, I have to call the subreport recursively. Link to comment Share on other sites More sharing options...
amartynov Posted March 30, 2022 Author Share Posted March 30, 2022 jrxml:<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.15.0.final using JasperReports Library version 6.5.1 --><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="Policies Details" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="10" bottomMargin="0" uuid="8023d4bc-790a-4e0f-9608-6d171760131d"> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["..\subreports\"]]></defaultValueExpression> </parameter> <parameter name="db_schema" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["re_app"]]></defaultValueExpression> </parameter> <parameter name="numberFormat" class="java.text.NumberFormat" isForPrompting="false"> <defaultValueExpression><![CDATA[$P{REPORT_FORMAT_FACTORY}.createNumberFormat( "#,###", $P{REPORT_LOCALE})]]></defaultValueExpression> </parameter> <parameter name="parent_folderid" class="java.lang.Long"/> <queryString> <![CDATA[select f.name, f.is_system, f.folderid, case f.is_system when 0 then 1 when 1 then (select count(*) from re_app.folders where parent_folderid = f.folderid) end cnt, FLOOR(dbms_random.value(0, 300000)) as under_retention_pol, FLOOR(dbms_random.value(0, 300000)) as end_of_lifecycle_pol, FLOOR(dbms_random.value(0, 300000)) as awaiting_deision_pol, FLOOR(dbms_random.value(0, 300000)) as out_retention_bocked_polfrom re_app.folders f where parent_folderid = $P{parent_folderid}order by name]]> </queryString> <field name="name" class="java.lang.String"/> <field name="is_system" class="java.lang.Integer"/> <field name="folderid" class="java.lang.Long"/> <field name="cnt" class="java.lang.Long"/> <field name="under_retention_pol" class="java.lang.Long"/> <field name="end_of_lifecycle_pol" class="java.lang.Long"/> <field name="awaiting_deision_pol" class="java.lang.Long"/> <field name="out_retention_bocked_pol" class="java.lang.Long"/> <detail> <band height="26" splitType="Stretch"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <frame> <reportElement x="-20" y="0" width="595" height="13" uuid="04ee7031-77cb-449a-94a9-0bb5b8faa566"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> </reportElement> <image hAlign="Center" vAlign="Top"> <reportElement positionType="Float" stretchType="ContainerHeight" x="6" y="0" width="13" height="13" uuid="8fdbf69f-39e6-4a41-93c1-57c13e0627f4"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.y" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 0]]></printWhenExpression> </reportElement> <imageExpression><![CDATA[".\images\arrow.jpg"]]></imageExpression> </image> <textField isStretchWithOverflow="true"> <reportElement x="23" y="0" width="332" height="13" uuid="9dc72863-a96d-4d18-aa1d-bbaec3aaba02"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> </reportElement> <textFieldExpression><![CDATA[$F{name}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="355" y="0" width="50" height="13" uuid="7f3ca223-8032-43b6-81e1-7e2d7a47fb1f"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 0]]></printWhenExpression> </reportElement> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$F{under_retention_pol} == null ? "-" : $P{numberFormat}.format($F{under_retention_pol})]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="405" y="0" width="50" height="13" uuid="0a08efd9-0cc0-4da0-90d4-218be12feaf4"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 0]]></printWhenExpression> </reportElement> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$F{end_of_lifecycle_pol} == null ? "-" : $P{numberFormat}.format($F{end_of_lifecycle_pol})]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="455" y="0" width="50" height="13" uuid="db4355d6-5ede-48a8-b022-02c8c0106b4d"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 0]]></printWhenExpression> </reportElement> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$F{awaiting_deision_pol} == null ? "-" : $P{numberFormat}.format($F{awaiting_deision_pol})]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="505" y="0" width="50" height="13" uuid="9c12d37a-33a0-4e72-bf3c-efe6df2089f6"> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 0]]></printWhenExpression> </reportElement> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$F{out_retention_bocked_pol} == null ? "-" : $P{numberFormat}.format($F{out_retention_bocked_pol})]]></textFieldExpression> </textField> <image hAlign="Center" vAlign="Bottom"> <reportElement positionType="Float" stretchType="ContainerBottom" x="7" y="0" width="13" height="13" uuid="c13d0d9b-faa2-43f2-b87a-e2ca014081c1"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.y" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 1]]></printWhenExpression> </reportElement> <imageExpression><![CDATA[".\images\folder.jpg"]]></imageExpression> </image> <image hAlign="Center" vAlign="Bottom"> <reportElement x="397" y="0" width="13" height="13" uuid="71266874-d21e-40a0-8e5b-3414591f7d85"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.y" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 1]]></printWhenExpression> </reportElement> <imageExpression><![CDATA[".\images\shield.jpg"]]></imageExpression> </image> <image hAlign="Center" vAlign="Bottom"> <reportElement x="445" y="0" width="13" height="13" uuid="6aa0d70f-7703-4ce8-b3ec-8f9ae26ed94e"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.y" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 1]]></printWhenExpression> </reportElement> <imageExpression><![CDATA[".\images\clock.jpg"]]></imageExpression> </image> <image hAlign="Center" vAlign="Bottom"> <reportElement x="494" y="0" width="13" height="13" uuid="99701769-d859-4772-a038-9baaf5b5116c"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.y" value="px"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 1]]></printWhenExpression> </reportElement> <imageExpression><![CDATA[".\images\finger.jpg"]]></imageExpression> </image> <image hAlign="Center" vAlign="Bottom"> <reportElement x="544" y="0" width="13" height="13" uuid="4c720d3c-939a-4b8e-ae50-80d29744d476"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.y" value="px"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 1]]></printWhenExpression> </reportElement> <imageExpression><![CDATA[".\images\stop.jpg"]]></imageExpression> </image> </frame> <subreport> <reportElement x="0" y="13" width="555" height="13" uuid="ca9c8f17-1758-4648-ac81-97fa2357b22f"> <property name="com.jaspersoft.studio.unit.x" value="pixel"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="com.jaspersoft.studio.unit.y" value="px"/> <printWhenExpression><![CDATA[$F{is_system} == 1 && $F{cnt} > 0]]></printWhenExpression> </reportElement> <subreportParameter name="SUBREPORT_DIR"> <subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="db_schema"> <subreportParameterExpression><![CDATA[$P{db_schema}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="parent_folderid"> <subreportParameterExpression><![CDATA[$F{folderid}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "PoliciesDetails.jasper"]]></subreportExpression> </subreport> </band> </detail></jasperReport> Link to comment Share on other sites More sharing options...
jgust Posted March 30, 2022 Share Posted March 30, 2022 For PDF You are limited to the with and height of the main report. You will need to figure out how wide that data might get and set the appropriate value in the page format.These format sizes offer over 2000 pixelsARCHE_DARCHE_EB2B1B0A1A0 Link to comment Share on other sites More sharing options...
amartynov Posted March 30, 2022 Author Share Posted March 30, 2022 Thanks for the tip. But the problem is that it is impossible to know the size of the nesting. Is it possible with jasper to simply transfer content that does not fit to a new line? 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