Reputation: 17
I have created a sample report in Jaspersoft Studio
and I created server connection and the created report published to it. but when i open the server and check the same item which was published, it shows empty report. why it is so?
Connection to jasper server:
Report design:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 -->
<!-- 2016-09-23T17:10:52 -->
<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="myCoffee" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ced95029-b569-4027-895c-af2843a4e088">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
<property name="ireport.jasperserver.url" value="http://localhost:8080/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="jasperadmin"/>
<property name="ireport.jasperserver.reportUnit" value="/public/Samples/newwww_cofeee"/>
<property name="ireport.jasperserver.report.resource" value="/public/Samples/newwww_cofeee_files/main_jrxml"/>
<style name="Title" fontName="Times New Roman" fontSize="50" isBold="true"/>
<style name="SubTitle" forecolor="#736343" fontName="Arial" fontSize="18"/>
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
<style name="Detail" fontName="Arial" fontSize="12"/>
<style name="Row" mode="Transparent">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style backcolor="#E6DAC3"/>
</conditionalStyle>
</style>
<queryString>
<![CDATA[select * from "ORDERS"]]>
</queryString>
<field name="ORDERID" class="java.lang.Integer"/>
<field name="SHIPNAME" class="java.lang.String"/>
<field name="SHIPADDRESS" class="java.lang.String"/>
<field name="SHIPCITY" class="java.lang.String"/>
<field name="SHIPREGION" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="136" splitType="Stretch">
<image>
<reportElement x="0" y="0" width="164" height="126" uuid="ddc15723-2728-421f-b95e-2df9faf64ce1"/>
<imageExpression><![CDATA["coffee.jpg"]]></imageExpression>
</image>
<staticText>
<reportElement style="Title" x="170" y="0" width="263" height="62" uuid="1a652692-054a-40f3-ade5-68d8da36626d"/>
<textElement verticalAlignment="Middle"/>
<text><![CDATA[Coffee Title]]></text>
</staticText>
<staticText>
<reportElement style="SubTitle" x="219" y="62" width="196" height="22" uuid="88d4231e-f014-4b0d-b871-1737ba63a1ae"/>
<textElement>
<font fontName="Times New Roman"/>
</textElement>
<text><![CDATA[Coffee SubTitle]]></text>
</staticText>
<staticText>
<reportElement x="172" y="94" width="383" height="42" uuid="f0bfb1ea-a85a-47cd-a1a4-43f22b45e80f"/>
<textElement textAlignment="Right">
<font size="10"/>
</textElement>
<text><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor purus gravida arcu aliquam mattis. Donec et nulla libero, ut varius massa. Nulla sed turpis elit. Etiam aliquet mauris a ligula hendrerit in auctor leo lobortis.]]></text>
</staticText>
<image>
<reportElement x="433" y="-115" width="267" height="209" uuid="5d64e5b3-07bb-48ab-89dc-15c0c46bb19a"/>
<imageExpression><![CDATA["coffee_stain.png"]]></imageExpression>
</image>
</band>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="16" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="15" width="555" height="1" uuid="1a61a836-d137-48b1-ad67-6ff64600bf93"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
<staticText>
<reportElement style="Column header" x="0" y="0" width="111" height="15" forecolor="#736343" uuid="0ff41838-59fc-47bd-9b48-1bc622576a80"/>
<text><![CDATA[ORDERID]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="111" y="0" width="111" height="15" forecolor="#736343" uuid="3c5657fa-038a-4b98-a026-2f6203f5c0be"/>
<text><![CDATA[SHIPNAME]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="222" y="0" width="111" height="15" forecolor="#736343" uuid="c9f171bf-1fbb-472d-a5ab-d5bd23340350"/>
<text><![CDATA[SHIPADDRESS]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="333" y="0" width="111" height="15" forecolor="#736343" uuid="0907046f-988c-4903-9f92-fcc927eb8a14"/>
<text><![CDATA[SHIPCITY]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="444" y="0" width="111" height="15" forecolor="#736343" uuid="d9a1b7ba-d450-4f4c-9956-ba21a8ff4066"/>
<text><![CDATA[SHIPREGION]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="15" splitType="Stretch">
<frame>
<reportElement style="Row" mode="Opaque" x="0" y="0" width="555" height="15" uuid="a98495d8-3c8d-4fa0-81f5-30c3efc2f766"/>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="0" y="0" width="111" height="15" uuid="004e4afd-035d-42f8-8d5f-f2f847459fb5"/>
<textFieldExpression><![CDATA[$F{ORDERID}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="111" y="0" width="111" height="15" uuid="bf9e44ec-80a7-40fc-afca-60227b369850"/>
<textFieldExpression><![CDATA[$F{SHIPNAME}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="222" y="0" width="111" height="15" uuid="60bc8d8f-c31a-491d-acaa-27c2d00a54f9"/>
<textFieldExpression><![CDATA[$F{SHIPADDRESS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="333" y="0" width="111" height="15" uuid="8b37170b-04ae-4269-9e01-d5e70e5c0b08"/>
<textFieldExpression><![CDATA[$F{SHIPCITY}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="444" y="0" width="111" height="15" uuid="a0ce4789-f7ab-4eb0-94bf-35152ddbf1b5"/>
<textFieldExpression><![CDATA[$F{SHIPREGION}]]></textFieldExpression>
</textField>
</frame>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="3" width="555" height="1" uuid="fa45a887-615a-4d84-a2d7-8a2219671b3c"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnFooter>
<pageFooter>
<band height="25" splitType="Stretch">
<frame>
<reportElement mode="Opaque" x="-21" y="1" width="597" height="24" forecolor="#D0B48E" backcolor="#F2EBDF" uuid="183682bc-d976-4756-83e0-6625a3f98ed1"/>
<textField evaluationTime="Report">
<reportElement style="Column header" x="533" y="0" width="40" height="20" forecolor="#736343" uuid="0193f9b3-1559-491a-8580-b6988863b6a1"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Column header" x="453" y="0" width="80" height="20" forecolor="#736343" uuid="d00b105e-494b-418b-8ac9-8b1b4824f4f0"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement style="Column header" x="22" y="1" width="197" height="20" forecolor="#736343" uuid="0616f3fe-0354-456f-8911-ec30ec51a5ae"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</frame>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
Upvotes: 1
Views: 5974
Reputation: 2511
The report is empty on JasperReports Server because, most likely, you have not selected a data source when published it.
You have created and tested the report with the Sample DB that is shipped with Jaspersoft Studio. The same data, or in this case the same database table with the same structure, must be accessible to the Server, too. You specify that when you publish the report.
Luckily, there is a data source on the Server that has a similar table structure to the one in Studio. What you need to do is to republish the report in the same location and in the Report Publishing Wizard
to select Data Source from Repository
and either enter this path:
/public/Samples/Data_Sources/ExmapleVDS
(the typo is intended) or manually select it by browsing through these folders:
Public > Samples > Data Sources > ExampleVDS
in the Repository Browser
dialog triggered by the ...
button adjacent to the input text field.
Note: The Server connection in Studio was done with the jasperadmin
user.
Upvotes: 3