forked from quarkiverse/quarkus-jasperreports
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes quarkiverse#116 * added an example report that uses styles * fixed the processor to not attempt to compile the styles, but instead just copy them to the output directory * added some constants for media types * use constants for header names were possible * added a new REST service to wrap all the different output formats for the styled report * centralized the export methods so they could be reused between the REST endpoints Signed-off-by:Nathan Erwin <nathan.d.erwin@gmail.com>
- Loading branch information
Showing
11 changed files
with
389 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
integration-tests/src/main/jasperreports/StylesReport.jrxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<jasperReport name="StylesReport" language="java" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" uuid="53f914b8-f951-4433-971d-6b1819430c56"> | ||
<template><![CDATA["styles.jrtx"]]></template> | ||
<style name="Right Aligned" style="Regular" hTextAlign="Right" hImageAlign="Right"/> | ||
<style name="More Emphasis" style="Emphasis" mode="Opaque" backcolor="#FFC800" fontSize="14.0"/> | ||
<style name="Serif Note" style="Serif" mode="Opaque" forecolor="#FFC800" backcolor="#404040" fontSize="10.0"/> | ||
<title height="782"> | ||
<element kind="textField" uuid="75dc6b08-96e0-45b9-a771-9e884cc4aafb" x="0" y="0" width="555" height="25" textAdjust="StretchHeight"> | ||
<expression><![CDATA["Regular (default): font size = 12, centered, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="d74f4c94-b8ae-4627-a7fc-6651b2eaecdf" x="0" y="30" width="555" height="25" textAdjust="StretchHeight" underline="true"> | ||
<expression><![CDATA["Regular (modified): font size = 12, underlined, centered, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="e35e4360-5387-4e05-a931-097091258215" positionType="Float" x="0" y="60" width="555" height="25" textAdjust="StretchHeight" style="Right Aligned"> | ||
<expression><![CDATA["Right Aligned: font size = 12, right aligned, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="ba12716b-8e1e-4379-8ec1-a3ff34d99e20" positionType="Float" x="0" y="90" width="555" height="25" textAdjust="StretchHeight" style="Emphasis"> | ||
<expression><![CDATA["Emphasis: font size = 10, italic, centered, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="f370465b-2cfd-41c5-b48a-e4c3b0afe86f" positionType="Float" x="0" y="120" width="555" height="25" textAdjust="StretchHeight" style="Special Emphasis"> | ||
<expression><![CDATA["Special Emphasis: font size = 12, red, italic, centered, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="c864bf3d-2357-46c1-a22d-611159c6be51" positionType="Float" x="0" y="150" width="555" height="25" textAdjust="StretchHeight" style="More Emphasis"> | ||
<expression><![CDATA["More Emphasis: font size = 14, black on orange, italic, centered, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="34e8a2ef-6903-425d-809e-1d395fc9b683" positionType="Float" x="0" y="180" width="555" height="25" textAdjust="StretchHeight" style="Strong"> | ||
<expression><![CDATA["Strong: font size = 14, underlined, centered, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="3f80426c-2b53-49c4-9556-c2ae6cd8d564" positionType="Float" x="0" y="210" width="555" height="25" textAdjust="StretchHeight" style="Very Strong"> | ||
<expression><![CDATA["Very Strong: font size = 12, black on light gray, bold, centered, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="7cbc0ad3-1d9c-4f0e-a4c7-2e1055be690a" positionType="Float" x="0" y="240" width="555" height="25" backcolor="#FFC800" textAdjust="StretchHeight" style="Very Strong"> | ||
<expression><![CDATA["Very Strong (modified): font size = 12, black on orange, bold, centered, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="af97e5bb-2d6a-4fae-bc17-bad21101a3a1" positionType="Float" x="0" y="270" width="555" height="25" textAdjust="StretchHeight" style="Serif"> | ||
<expression><![CDATA["Serif: font face = DejaVu Serif, font size = 12, centered, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="ed44229f-c431-447c-8f46-0113ecc9affa" positionType="Float" x="0" y="300" width="555" height="25" markup="styled" textAdjust="StretchHeight" style="Serif"> | ||
<expression><![CDATA["Serif (styled): font face = DejaVu Serif, font size = 12, <style forecolor=\"red\">partially red</style>, centered, border"]]></expression> | ||
</element> | ||
<element kind="textField" uuid="6dc9246d-95be-4d9c-abb8-9dbdcc6dcea8" positionType="Float" x="0" y="330" width="555" height="25" textAdjust="StretchHeight" style="Serif Note"> | ||
<expression><![CDATA["Serif Note: font face = DejaVu Serif, font size = 10, orange on dark gray, centered, border"]]></expression> | ||
</element> | ||
</title> | ||
</jasperReport> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<jasperTemplate> | ||
<style name="Base" hTextAlign="Center" vTextAlign="Middle" hImageAlign="Center" vImageAlign="Middle" fontSize="10.0" pdfFontName="Helvetica" pdfEncoding="Cp1252" default="true" pdfEmbedded="false"> | ||
<box padding="4"> | ||
<pen lineWidth="0.5"/> | ||
</box> | ||
</style> | ||
<style name="Emphasis" pdfFontName="Helvetica-Oblique" italic="true" style="Base"/> | ||
<style name="Strong" fontSize="12.0" pdfFontName="Helvetica-Bold" bold="true" style="Base"/> | ||
<style name="Very Strong" mode="Opaque" backcolor="#C0C0C0" style="Strong"/> | ||
</jasperTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<jasperTemplate> | ||
<template>base_styles.jrtx</template> | ||
<style name="Regular" fontSize="12.0" default="true" style="Base"/> | ||
<style name="Special Emphasis" forecolor="#FF0000" fontSize="12.0" style="Emphasis"/> | ||
<style name="Strong" fontSize="14.0" underline="true" style="Base"/> | ||
<style name="Serif" fontName="DejaVu Serif" fontSize="12.0" style="Base"/> | ||
<style name="Serif Note" underline="true" style="Serif"/> | ||
</jasperTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
integration-tests/src/main/java/io/quarkiverse/jasperreports/it/ExtendedMediaType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.quarkiverse.jasperreports.it; | ||
|
||
import jakarta.ws.rs.core.MediaType; | ||
|
||
public class ExtendedMediaType extends MediaType { | ||
|
||
/** | ||
* A {@code String} constant representing {@value #APPLICATION_DOCX} media type. | ||
*/ | ||
public static final String APPLICATION_DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; | ||
/** | ||
* A {@code String} constant representing {@value #APPLICATION_OPENDOCUMENT_SPREADSHEET} media type. | ||
*/ | ||
public static final String APPLICATION_OPENDOCUMENT_SPREADSHEET = "application/vnd.oasis.opendocument.spreadsheet"; | ||
/** | ||
* A {@code String} constant representing {@value #APPLICATION_OPENDOCUMENT_TEXT} media type. | ||
*/ | ||
public static final String APPLICATION_OPENDOCUMENT_TEXT = "application/vnd.oasis.opendocument.text"; | ||
/** | ||
* A {@code String} constant representing {@value #APPLICATION_PDF} media type. | ||
*/ | ||
public static final String APPLICATION_PDF = "application/pdf"; | ||
/** | ||
* A {@code String} constant representing {@value #APPLICATION_PPTX} media type. | ||
*/ | ||
public static final String APPLICATION_PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; | ||
/** | ||
* A {@code String} constant representing {@value #APPLICATION_RTF} media type. | ||
*/ | ||
public static final String APPLICATION_RTF = "application/rtf"; | ||
/** | ||
* A {@code String} constant representing {@value #APPLICATION_XLS} media type. | ||
*/ | ||
public static final String APPLICATION_XLS = "application/vnd.ms-excel"; | ||
/** | ||
* A {@code String} constant representing {@value #APPLICATION_XLSX} media type. | ||
*/ | ||
public static final String APPLICATION_XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; | ||
/** | ||
* A {@code String} constant representing {@value #TEXT_CSV} media type. | ||
*/ | ||
public static final String TEXT_CSV = "text/csv"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.