<?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="tree-template" pageWidth="595" pageHeight="842" columnWidth="481" leftMargin="57" rightMargin="57" topMargin="72" bottomMargin="72">
<style name="Title" forecolor="#000000" fontName="Times New Roman" fontSize="50" isBold="false" pdfFontName="Times-Bold"/>
<style name="SubTitle" forecolor="#666666" fontName="Times New Roman" fontSize="18" isBold="false" pdfFontName="Times-Roman"/>
<style name="Column header" forecolor="#666666" fontName="Times New Roman" fontSize="14" isBold="true" pdfFontName="Times-Roman"/>
<style name="Detail" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman"/>
<style name="Row" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style mode="Opaque" backcolor="#F0EFEF"/>
</conditionalStyle>
</style>
<parameter name="JasperCustomSubReportLocation" class="net.sf.jasperreports.engine.JasperReport"/>
<parameter name="JasperCustomSubReportDatasource" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
<field name="name" class="java.lang.String"/>
<field name="notes" class="java.lang.String"/>
<field name="state" class="java.lang.String"/>
<field name="project" class="com.pearson.ltg.qmo.dashboard.domain.QDashProject">
<fieldDescription><![CDATA[project]]></fieldDescription>
</field>
<field name="theme" class="java.lang.String"/>
<field name="goals" class="java.lang.String"/>
<field name="statusDetails" class="java.lang.String"/>
<field name="mitigation" class="java.lang.String"/>
<field name="status" class="java.lang.String"/>
<field name="releaseDate" class="java.util.Calendar"/>
<group name="Group1">
<groupExpression><![CDATA[(int)($V{REPORT_COUNT}/15)]]></groupExpression>
</group>
<group name="Group2">
<groupExpression><![CDATA[(int)($V{REPORT_COUNT}/5)]]></groupExpression>
<groupHeader>
<band height="10"/>
</groupHeader>
</group>
<title>
<band height="58" splitType="Stretch">
<staticText>
<reportElement style="Title" x="4" y="0" width="477" height="56"/>
<textElement>
<font size="48" isBold="false"/>
</textElement>
<text><![CDATA[Release Details]]></text>
</staticText>
</band>
</title>
<detail>
<band height="189" splitType="Stretch">
<frame>
<reportElement mode="Opaque" x="0" y="7" width="481" height="13" forecolor="#D0B48E" backcolor="#9DB1B8"/>
</frame>
<textField>
<reportElement x="279" y="7" width="202" height="13"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="79" y="7" width="100" height="13"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{project}.getName()]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="2" y="7" width="79" height="13"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Platform : ]]></text>
</staticText>
<staticText>
<reportElement x="179" y="7" width="100" height="13"/>
<textElement>
<font size="10" isBold="true" isItalic="false"/>
</textElement>
<text><![CDATA[Release Name :]]></text>
</staticText>
<staticText>
<reportElement x="0" y="20" width="47" height="20"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Status : ]]></text>
</staticText>
<textField>
<reportElement x="79" y="20" width="100" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{status}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="40" width="79" height="20"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Release Date: ]]></text>
</staticText>
<staticText>
<reportElement x="0" y="60" width="181" height="20"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Release Goals]]></text>
</staticText>
##want this field to auto stretch as per content##
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="Float" stretchType="RelativeToTallestObject" x="0" y="80" width="463" height="20"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{goals}==null ? "Not Defined":$F{goals}]]></textFieldExpression>
</textField>
##want this field to auto stretch as per content##
<staticText>
<reportElement stretchType="RelativeToTallestObject" x="0" y="100" width="98" height="20"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Status Details]]></text>
</staticText>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="2" y="120" width="463" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{statusDetails}==null ? "Not Defined":$F{statusDetails}]]></textFieldExpression>
</textField>
<staticText>
<reportElement stretchType="RelativeToTallestObject" x="0" y="140" width="98" height="20"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Risk Mitigation]]></text>
</staticText>
<textField>
<reportElement stretchType="RelativeToTallestObject" x="18" y="160" width="463" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{mitigation}==null?"Not Defined":$F{mitigation}]]></textFieldExpression>
</textField>
<textField>
<reportElement stretchType="RelativeToTallestObject" x="79" y="40" width="100" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[new SimpleDateFormat("MMM dd,yyyy").format($F{releaseDate}.getTime())]]></textFieldExpression>
</textField>
<line>
<reportElement x="0" y="180" width="481" height="1"/>
</line>
</band>
</detail>
<columnFooter>
<band height="12" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="13" splitType="Stretch">
<frame>
<reportElement mode="Opaque" x="0" y="0" width="477" height="13" forecolor="#D0B48E" backcolor="#9DB1B8"/>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement style="Column header" x="2" y="0" width="197" height="13" forecolor="#FFFFFF"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement style="Column header" x="450" y="0" width="27" height="13" forecolor="#FFFFFF"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Column header" x="370" y="0" width="80" height="13" forecolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
</frame>
</band>
</pageFooter>
</jasperReport>
Trả lời
Trường có thể tự động kéo giãn với tràn, nhưng nó sẽ bị hỏng (thay đổi từ) thay vì tăng chiều rộng. Trong tài liệu PDF tùy chọn mà bạn tìm kiếm, sẽ có ít hoặc không sử dụng.
Kiểm tra chủ đề này khác để biết thêm Dynamic column cell width
EDIT Ngoài ra kiểm tra và bao gồm JasperReports phông chữ mở rộng. Có lẽ nó có thể giúp đỡ trên một triển khai hoàn hảo mà không có vấn đề phông chữ hệ điều hành.
Tôi đang tạo ra một RTR JasperReport, chiều cao của trường text không được kéo dài tự động. –
Có giải pháp. Đã sửa đổi tất cả các trường văn bản tĩnh và tất cả các thuộc tính của phần tử thành positionType = "Float". –
Tốt. Tạo câu trả lời và kiểm tra nó để những người khác sẽ biết! – Alfabravo
Có giải pháp. Đã sửa đổi tất cả các trường văn bản tĩnh và tất cả các thuộc tính của phần tử thành positionType = "Float".
Chỉ cần thêm isStretchWithOverflow="true"
vào textField mà bạn muốn làm phần tử.
<textField isStretchWithOverflow="true">
<reportElement x="279" y="7" width="202" height="13"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression>
</textField>
- 1. Làm cách nào để kéo giãn nội dung của HeaderedContentControl?
- 2. Làm cách nào để kéo giãn văn bản trong một nút hình vuông?
- 3. WPF cách làm cho nội dung di chuyển giãn nở
- 4. JasperReport - văn bản quấn để hiển thị văn bản dài trong trường văn bản
- 5. canvas html5 - Làm cách nào để kéo dài văn bản?
- 6. Làm cách nào để có được nội dung văn bản của một vùng văn bản với trình quản lý web?
- 7. C# - Kéo giãn hộp văn bản để vừa với cửa sổ chứa
- 8. Làm thế nào để có được văn bản nội dung chức năng trong JavaScript?
- 9. Đọc nội dung văn bản từ SyndicationContent
- 10. Đọc nội dung văn bản từ XElement
- 11. Nội dung văn bản trong một nút WPF không được làm trung tâm theo chiều dọc
- 12. Làm cách nào để ngăn trình duyệt nhớ nội dung của trường văn bản?
- 13. Làm cách nào để tạo tệp PDF có nội dung văn bản "thực" trên iOS?
- 14. Làm cách nào để tìm nạp nội dung văn bản thuần túy trực tiếp của etherpad?
- 15. Làm cách nào để tìm văn bản có văn bản được kéo dài trên vim?
- 16. Làm cách nào để in nội dung của tệp văn bản OSX từ thiết bị đầu cuối?
- 17. Làm thế nào để tăng chiều cao hàng trong NSTableView dựa trên nội dung văn bản?
- 18. Làm cách nào để căn giữa theo chiều ngang nội dung của tệp mở trong vim?
- 19. Cách lấy nội dung văn bản với jquery
- 20. Làm thế nào để bạn thay đổi kích thước nội dung văn bản của Silverlight?
- 21. Làm cách nào để căn chỉnh nội dung trong DataTemplate?
- 22. Chèn nội dung vào tệp văn bản trong Powershell
- 23. Làm cách nào để căn chỉnh văn bản theo chiều dọc?
- 24. làm cách nào để sử dụng Rspec để kiểm tra nội dung của vùng văn bản trong chế độ xem?
- 25. Nội dung tĩnh và động trong hệ thống docpad - cách tạo nội dung động?
- 26. Làm thế nào để thêm spacer có thể kéo giãn trong Qtoolbar?
- 27. Làm cách nào để kéo dài trường văn bản trên nhiều trang trong Báo cáo Jasper?
- 28. Làm cách nào để có được vùng accordion mở rộng (theo chiều dọc) thành nội dung động?
- 29. Làm cách nào để chọn tất cả văn bản trong div có thể chỉnh sửa nội dung?
- 30. PHP: Làm cách nào để hiển thị nội dung của một tệp văn bản trên trang của tôi?
Báo cáo của bạn được xác định, theo chiều dọc hoặc đường chân trời như thế nào? – adis
Vui vì bạn đã cho chúng tôi biết tình trạng lỗi nào đã xảy ra. Bây giờ, bạn đang sử dụng phiên bản jasperreports nào? Bạn chỉnh sửa nó như thế nào? – Alfabravo
Tôi đang sử dụng iReport để chỉnh sửa nó. Báo cáo Jasper là phiên bản 3.7.6 –