Antranig Posted September 21, 2016 Share Posted September 21, 2016 Hi all, I have created a simple report template to be generated from the application, but I get an error messae saying "Failed to load PDF document"- the pdf is downloading normally from the application, upon opening the PDF i get the error and unable to see the content.- In jaspersoft Studio, I am able to see the report correctly using data from application database without any errors.- I suspect an issue with PDF encodingAppreciate any advise or help about this, XML Code: <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.0.0.final using JasperReports Library version 6.0.0 --><!-- 2016-09-21T13:57:08 --><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="JournalReportLines" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="575" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10" uuid="45ffeea8-2374-479c-a88e-9b8cd83d7e01"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <property name="com.jaspersoft.studio.unit." value="pixel"/> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Openbravo-eval16"/> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA[$P{BASE_DESIGN}+"/org/orkila/journalreport/"]]></defaultValueExpression> </parameter> <parameter name="DOCUMENT_ID" class="java.lang.String"> <defaultValueExpression><![CDATA[$P{DOCUMENT_ID}]]></defaultValueExpression> </parameter> <parameter name="BASE_DESIGN" class="java.lang.String"> <defaultValueExpression><![CDATA["/devel/bttCourse/pi/src"]]></defaultValueExpression> </parameter> <queryString> <![CDATA[sELECT ad_column_identifier(AD_Table.TableName, f.Record_ID, 'en_US') AS DOCNUMBER, C_CURRENCY_ISOSYM(f.c_currency_id) AS CURRENCY, AD_Org.Name AS ORGNAMEFROM fact_acct fLEFT JOIN C_DocType ON (C_DocType.C_DocType_ID=f.C_DocType_ID)LEFT JOIN AD_Table ON (C_DocType.AD_table_ID=AD_table.AD_table_ID)LEFT JOIN AD_Org ON (f.AD_Org_ID=AD_Org.AD_Org_ID)WHERE f.Record_ID = $P{DOCUMENT_ID}GROUP BY AD_Table.TableName, f.Record_ID, f.c_currency_id, ad_org.name, f.ad_org_id]]> </queryString> <field name="DOCNUMBER" class="java.lang.String"/> <field name="CURRENCY" class="java.lang.String"/> <field name="ORGNAME" class="java.lang.String"/> <pageHeader> <band height="48" splitType="Stretch"> <staticText> <reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="190" height="25" uuid="b306eb47-2e2e-4237-9e3b-8ef3155c93d6"/> <textElement textAlignment="Left" verticalAlignment="Middle"> <font size="16" pdfFontName="Helvetica" pdfEncoding="Cp1251"/> </textElement> <text><![CDATA[Journal Entries Report]]></text> </staticText> <staticText> <reportElement x="500" y="0" width="60" height="24" uuid="2c824a99-84cd-4478-b3c5-ce44210b1957"/> <textElement textAlignment="Left" verticalAlignment="Middle"> <font pdfFontName="Helvetica" pdfEncoding="Cp1251"/> </textElement> <text><![CDATA[Printed on :]]></text> </staticText> <textField> <reportElement x="110" y="26" width="280" height="19" uuid="90aeaf5a-67e3-4388-a001-d827da2c8d90"/> <textElement verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$F{DOCNUMBER}+" "+$F{CURRENCY}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="26" width="110" height="19" uuid="63e7d09e-c932-49df-aac2-ac50f7633c17"/> <textElement verticalAlignment="Middle"> <font isBold="true" pdfFontName="Helvetica" pdfEncoding="Cp1251"/> </textElement> <text><![CDATA[Document Reference :]]></text> </staticText> <textField> <reportElement x="190" y="0" width="210" height="24" uuid="e0232293-c8c0-4997-b825-a002ef7a8df5"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="16" isBold="true" pdfFontName="Helvetica" pdfEncoding="Cp1251"/> </textElement> <textFieldExpression><![CDATA[$F{ORGNAME}]]></textFieldExpression> </textField> </band> </pageHeader> <pageFooter> <band height="17" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="60" height="14" uuid="1266bde8-1a0b-4f50-ad00-47a39fbcffe1"/> <textElement> <font pdfFontName="Helvetica" pdfEncoding="Cp1251"/> </textElement> <text><![CDATA[Created by :]]></text> </staticText> <staticText> <reportElement x="190" y="0" width="70" height="14" uuid="8c56c9ac-72ea-4414-bfef-23fd30248f1e"/> <textElement> <font pdfFontName="Helvetica" pdfEncoding="Cp1251"/> </textElement> <text><![CDATA[Controlled by :]]></text> </staticText> </band> </pageFooter></jasperReport>[/code]Thank you Link to comment Share on other sites More sharing options...
factor_1 Posted September 22, 2016 Share Posted September 22, 2016 Hello! It seems that your problem similar my problem:http://community.jaspersoft.com/questions/1030146/loading-mondiran-schema-jasper-report-server-access-deniedCan you provide full error stack? Link to comment Share on other sites More sharing options...
miracleihediwa619 Posted October 24, 2023 Share Posted October 24, 2023 Some times the problem could be from your browser(Chrome) settings, you should go to your settings in your chrome, then go to privacy then go to site settings then scroll down to pdf documents and remove the selection "open from chrome" and select "download pdfs" Maybe another isssue could be that you didn't flush and close your outputstream after using it. i.e outputStream.flush();outputStream.close(); 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