oleksandr.voloschuk
-
Posts
28 -
Joined
-
Last visited
Content Type
Profiles
Forum
Events
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Security Advisories
Downloads
Posts posted by oleksandr.voloschuk
-
-
Login (optional)
http://<host>:<port>/jasperserver-pro/rest/login
Repository
http://<host>:<port>/jasperserver-pro/rest/resources
http://<host>:<port>/jasperserver-pro/rest/resource
http://<host>:<port>/jasperserver-pro/rest/permissionReports
http://<host>:<port>/jasperserver-pro/rest/report
http://<host>:<port>/jasperserver-pro/rest/jobsummary
http://<host>:<port>/jasperserver-pro/rest/jobAdministration
http://<host>:<port>/jasperserver-pro/rest/organization
http://<host>:<port>/jasperserver-pro/rest/user
http://<host>:<port>/jasperserver-pro/rest/attribute
http://<host>:<port>/jasperserver-pro/rest/roleThe context name (by default jasperserver or jasperserver-pro) may also depend on the specific installation
of JasperReports Server. -
Does your Jasper Server is running? Can you log in to it through user interface?
According to documentation - REST login should be like:
http://<host>:<port>/jasperserver-pro/rest/login
Does it help?
-
If you apply "Remove Line When Blank" for all your text fields + set "Evaluation Time" for them as "Now", you will have the expected result.
Sharing the final source code for this report (added there some values for showing the result):
<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 7.1.0.final using JasperReports Library version 6.4.3 --><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 Template" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="22974b6e-10a0-4530-8d14-87b0b674ae2c"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString language="SQL"> <![CDATA[sELECT * FROM (values(1),(2),(3),(-1),(-2),(-3),(4),(-4), (-5)) AS x]]> </queryString> <field name="C1" class="java.lang.Integer"> <property name="com.jaspersoft.studio.field.label" value="C1"/> </field> <variable name="Variable_1" class="java.lang.Integer" calculation="Sum"> <variableExpression><![CDATA[$F{C1}]]></variableExpression> </variable> <columnHeader> <band height="13" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="100" height="13" uuid="f8b9997e-98e5-4123-8533-054558ef12e2"> <property name="com.jaspersoft.studio.unit.height" value="pixel"/> </reportElement> <text><![CDATA[col header]]></text> </staticText> </band> </columnHeader> <detail> <band height="13" splitType="Stretch"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="180" height="13" isRemoveLineWhenBlank="true" uuid="b6b32530-7b05-4d24-837f-8eb7f396733d"> <property name="com.jaspersoft.studio.unit.height" value="pixel"/> </reportElement> <textElement markup="none"/> <textFieldExpression><![CDATA[$V{Variable_1} != 0 ? $F{C1} : ""]]></textFieldExpression> </textField> </band> </detail> <summary> <band height="13"> <staticText> <reportElement x="0" y="0" width="100" height="13" uuid="b5d6692a-d851-4669-9dc7-b832ca674365"> <property name="com.jaspersoft.studio.unit.height" value="pixel"/> </reportElement> <text><![CDATA[ summary ]]></text> </staticText> </band> </summary></jasperReport>[/code]
-
If you apply "Remove Line When Blank" for all your text fields + set "Evaluation Time" for them as "Now", you will have the expected result.
Sharing the final source code for this report:
<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 7.1.0.final using JasperReports Library version 6.4.3 --><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="report1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c78226d3-cfba-479d-a6dc-13eafc95542c"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> <subDataset name="dataset1" uuid="352ef710-eb92-4ce4-88a7-b19ee4136bde"/> <parameter name="addressLine1" class="java.lang.String"/> <parameter name="addressLine2" class="java.lang.String"/> <parameter name="state" class="java.lang.String"/> <field name="field" class="java.lang.String"/> <field name="addressLine1" class="java.lang.String"/> <field name="addressLine2" class="java.lang.String"/> <field name="state" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <title> <band height="117" splitType="Stretch"> <elementGroup/> <textField isBlankWhenNull="true"> <reportElement key="" mode="Transparent" x="0" y="7" width="163" height="26" isRemoveLineWhenBlank="true" uuid="57fcac34-a5b5-4f9d-8a3e-d7369b941472"/> <box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1"> <pen lineWidth="0.25" lineStyle="Solid"/> <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font fontName="Arial" size="9"/> </textElement> <textFieldExpression><![CDATA[$P{addressLine1}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement key="" mode="Transparent" x="0" y="33" width="163" height="25" isRemoveLineWhenBlank="true" uuid="02f80517-665a-4a05-88f5-48372b555e42"/> <box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1"> <pen lineWidth="0.25" lineStyle="Solid"/> <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font fontName="Arial" size="9"/> </textElement> <textFieldExpression><![CDATA[$P{addressLine2}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement key="" mode="Transparent" x="0" y="58" width="163" height="18" isRemoveLineWhenBlank="true" uuid="4d698ec9-6a4b-4088-a4e4-9924b6ca4523"/> <box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1"> <pen lineWidth="0.25" lineStyle="Solid"/> <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font fontName="Arial" size="9"/> </textElement> <textFieldExpression><![CDATA[$P{state}]]></textFieldExpression> </textField> </band> </title> <detail> <band height="28"/> <band height="25"/> <band height="18"/> </detail></jasperReport>[/code]
-
To use a dynamic formula in this case, please refer to the article -> Exporting Crosstab Formula "SUM" To Excel
-
For disabling not necessary options for exporters on server level, you have to modify the file WEB-INFflowsviewReportBeans.xml
You can find next list of exporters there:
<entry key="pdf" value-ref="pdfExporterConfiguration"/>
<entry key="xls" value-ref="xlsExporterConfiguration"/>
<entry key="xlsNoPag" value-ref="xlsNoPaginationExporterConfiguration"/>
<entry key="csv" value-ref="csvExporterConfiguration"/>
<entry key="docx" value-ref="docxExporterConfiguration"/>
<entry key="rtf" value-ref="rtfExporterConfiguration"/>
<entry key="odt" value-ref="odtExporterConfiguration"/>
<entry key="ods" value-ref="odsExporterConfiguration"/>
<entry key="xlsx" value-ref="xlsxExporterConfiguration"/>
<entry key="xlsxNoPag" value-ref="xlsxNoPaginationExporterConfiguration"/>
<entry key="pptx" value-ref="pptxExporterConfiguration"/>
So, remove/comment out the variants that you do not want use, restart Jasper Server and you will see only your enabled variants of export. -
For disabling not necessary options for exporters on server level, you have to modify the file WEB-INFflowsviewReportBeans.xml
You can find next list of exporters there:
<entry key="pdf" value-ref="pdfExporterConfiguration"/>
<entry key="xls" value-ref="xlsExporterConfiguration"/>
<entry key="xlsNoPag" value-ref="xlsNoPaginationExporterConfiguration"/>
<entry key="csv" value-ref="csvExporterConfiguration"/>
<entry key="docx" value-ref="docxExporterConfiguration"/>
<entry key="rtf" value-ref="rtfExporterConfiguration"/>
<entry key="odt" value-ref="odtExporterConfiguration"/>
<entry key="ods" value-ref="odsExporterConfiguration"/>
<entry key="xlsx" value-ref="xlsxExporterConfiguration"/>
<entry key="xlsxNoPag" value-ref="xlsxNoPaginationExporterConfiguration"/>
<entry key="pptx" value-ref="pptxExporterConfiguration"/>
So, remove/comment out the variants that you do not want use, restart Jasper Server and you will see only your enabled variants of export. -
There is a wiki article how to fix this:
How To Display Signs "Greater Than Or Equal To" or "Less Than Or Equal To" in PDF export -
you can freeze columns in excel output file by adding next property to your .jrxml:
<property name="net.sf.jasperreports.export.xls.freeze.column" value="A"/>[/code]
the same for row:
<property name="net.sf.jasperreports.export.xls.freeze.row" value="1"/>[/code]
more information here: http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.xls.freeze.column
Properties like net.sf.jasperreports.export.xls.freeze.row/column are implemented for Excel export because Excel reads these settings ate export time, and process them internally to freeze rows or columns.
There are no equivalent properties for Java/HTML output format, because Java/HTML viewers don't interpret such values similar to Excel.
Freezing rows in HTML tables involves a lot of css/javascript additional code. See this link for reference: https://stackoverflow.com/questions/8423768/freeze-the-top-row-for-an-html-table-only-fixed-table-header-scrolling
-
<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.4.2.final using JasperReports Library version 6.4.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="Blank_A4" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f0d27607-3956-4a23-9f8a-92189b2e6fb7"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> <property name="ireport.jasperserver.url" value="http://hostanme:8080/jasperserver-pro/"/> <property name="ireport.jasperserver.user" value="superuser"/> <property name="ireport.jasperserver.reportUnit" value="/public/Blank_A4"/> <property name="ireport.jasperserver.report.resource" value="/public/Blank_A4_files/main_jrxml"/> <queryString> <![CDATA[]]> </queryString> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="555" height="79" uuid="aaffc397-2eb6-44d3-a25c-cf8eb1bc689f"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Carlito-Regular" size="35"/> </textElement> <text><![CDATA[Report Title Text]]></text> </staticText> </band> </title> <summary> <band height="90"> <staticText> <reportElement x="0" y="20" width="555" height="70" uuid="9d1e7c46-dadd-42f5-af78-49f96bdecb75"/> <textElement> <font fontName="Carlito-Regular" size="19"/> </textElement> <text><![CDATA[This is a test report. Ddddd PPPpppp CCCCCcccc.]]></text> </staticText> </band> </summary></jasperReport>[/code]
Carlito-Regular.ttf you could get by commands:
# yum install google-crosextra-carlito-fonts.noarch
# cd /usr/share/fonts/google-crosextra-carlito
-
m.kamran,
thank you for your response.
I tried to use default fonts from linux (like DejaVu or Liberation), but result is the same.
If you see my video, these fonts I used on Blank_A4_2 & Blank_A4_3 reports
-
Hi gurus,
Could anyone help me to understand next behavior?
1. on server (Centos VM) installed font google-crosextra-carlito-fonts.noarch (only this one contains necessary calibri font for my customer):
# yum search calibri
google-crosextra-carlito-fonts.noarch : Sans-serif font metric-compatible with Calibri font
# yum install google-crosextra-carlito-fonts.noarch
# ls -l /usr/share/fonts/google-crosextra-carlito
-rw-r--r-- 1 root root 816716 Sep 20 2013 Carlito-BoldItalic.ttf
-rw-r--r-- 1 root root 690516 Sep 20 2013 Carlito-Bold.ttf
-rw-r--r-- 1 root root 623416 Sep 20 2013 Carlito-Italic.ttf
-rw-r--r-- 1 root root 635996 Sep 20 2013 Carlito-Regular.ttf
"registered" new font in the system with command (but also reboot server):
# fc-cache -f -v
2. created simple report on Studio with some text fields (Blank_A4.jrxml)
3. added font Carlito-Regular.ttf (from Centos server) to Studio (see screen)
4. exported Carlito-Regular.jar file from Carlito-Regular.ttf copied to WEB-INF/lib folder; restarted application server + removed all caches from /temp & /work
5. added to report font extension, saved it and published to JRS
As result - on JRS it seems flickering problem during report execution. Please see screencast:
https://www.screencast.com/t/O3EH5FAE5n1L
Tried to apply a few different font to the report (Blank_A4_2 & Blank_A4_3 on video) as well as calibri.ttf downloaded from internet - the same result (on Chrome, Firefox, IE).
It looks like report is first trying to load the some default font form OS and then the applied font from font family.
Will be appreciate for any help.
Thanks,
Oleksandr
How to access Jasper REST API , URL does not work
in Products
Posted
The link for JASPERREPORTS SERVERWEB SERVICES GUIDERELEASE 4.7 (information is the same as for version 4.5.1)
https://community.jaspersoft.com/documentation/jasperreports-server-web-...
https://www.screencast.com/t/5Ba4XrLH