Jump to content
We've recently updated our Privacy Statement, available here ×

2002 JI Open Discussion

Members
  • Posts

    1,481
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by 2002 JI Open Discussion

  1. By: jayalakshmi - jayashaki Problems due to font in HTML,PDF,EXCEL 2004-01-03 01:28 Hello all, The reports are generating fine in PDF,HTML,EXCEL formats, but the font size in HTML is very small when compared with PDF,EXCEL.I cannot do modifications in XML as b'cos it will refelct in all the three. So, i have written a function using the class JRDesignReportFont, but the problem is I want some text to be bold and some to be in normal. The Bold is not working, so i started to use the normal font with isBold="true", but as i change the size in java file it affects only to the textFieldExpressions i.e. $F not for static text,the size is changed only to the datas from the database and for the static text, it remains the same. Kindly help me. XML file: <?xml version="1.0"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="UserBasedReport" columnCount="1" printOrder="Vertical" pageWidth="595" pageHeight="842" columnWidth="270" columnSpacing="15" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" isTitleNewPage="true" isSummaryNewPage="false" whenNoDataType="AllSectionsNoDetail"> <!--<reportFont name="Times_Bold" isDefault="false" fontName="Times New Roman MS" size = "10" isBold="true" pdfFontName="Times-Bold" pdfEncoding="Cp1252" isPdfEmbedded="true"/> <reportFont name="Times_Normal" isDefault="true" fontName="Times New Roman MS" size = "9" isBold="true" pdfFontName="Times-Bold" pdfEncoding="Cp1252" isPdfEmbedded="true"/> --> <parameter name="MySQLQuery" class="java.lang.String"/> <parameter name="SELECTION" class="java.lang.String"/> <parameter name="date" class="java.lang.String"/> <parameter name="FOOTER" class="java.lang.String"/> <queryString>$P!{MySQLQuery}</queryString> <field name="F410101" class="java.lang.String"/> <field name="USER_ID" class="java.lang.String"/> <field name="F410998" class="java.lang.String"/> <field name="FIRST_NAME" class="java.lang.String"/> <field name="LAST_NAME" class="java.lang.String"/> <field name="F400102" class="java.lang.String"/> <field name="THERAPEUTIC_NAME" class="java.lang.String"/> <field name="THERAPEUTIC_ID" class="java.lang.Integer"/> <field name="F330102" class="java.lang.String"/> <field name="PRODUCT_NAME" class="java.lang.String"/> <field name="PRODUCT_ID" class="java.lang.Integer"/> <field name="F450104" class="java.lang.String"/> <field name="ROLE" class="java.lang.String"/> <field name="DURATION_FROM" class="java.util.Date"/> <field name="DURATION_TO" class="java.util.Date"/> <field name="F450105" class="java.lang.Integer"/> <field name="QUERY_COUNT" class="java.lang.Integer"/> <field name="PERSON_CODE" class="java.lang.String"/> <field name="F410999" class="java.lang.Integer"/> <field name="REC_ID" class="java.lang.Integer"/> <group name="UserBasedGroup" isStartNewPage="false" minHeightToStartNewPage="20"> </group> <!--TITLE SECTION --> <title> <band height="670"> <!-- DATE / TIME --> <staticText> <reportElement x="375" y="0" width="65" height="25" forecolor="#000000" /> <textElement textAlignment="Right"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>Date/Time:</text> </staticText> <textField> <reportElement x="442" y="0" width="120" height="25" forecolor="#000000"/> <textElement textAlignment="Center"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.String"> $P{date} </textFieldExpression> </textField> <!-- TITLE--> <staticText> <reportElement x="140" y="40" width="200" height="25" forecolor="#000000"/> <textElement textAlignment="Center" lineSpacing="Single"> <font isBold="true" pdfFontName="Times-Roman" /> <!--<font size="16"/> --> </textElement> <text>USER BASED REPORT</text> </staticText> <!-- HEADING --> <staticText> <reportElement x="140" y="90" width="200" height="25" forecolor="#000000"/> <textElement textAlignment="Center" lineSpacing="Single"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>Selection Criteria</text> </staticText> <textField> <reportElement x="200" y="145" width="400" height="250" forecolor="#000000"/> <textElement textAlignment="Left"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.String"> $P{SELECTION} </textFieldExpression> </textField> <!--FOOTER --> <staticText> <reportElement x="100" y="640" width="150" height="25" forecolor="#000000"/> <textElement textAlignment="Center" lineSpacing="Single"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>Report generated by </text> </staticText> <textField> <reportElement x="255" y="640" width="150" height="25" forecolor="#000000"/> <textElement textAlignment="Center"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.String"> $P{FOOTER} </textFieldExpression> </textField> <!-- PAGE NUMBER --> <staticText> <reportElement x="450" y="640" width="60" height="25" forecolor="#000000"/> <textElement textAlignment="Right" lineSpacing="Single"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>Page 1 of </text> </staticText> <textField evaluationTime="Report" evaluationGroup="FirstLetterGroup"> <reportElement x="512" y="640" width="30" height="25"/> <textElement textAlignment="Left"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.Integer"> $V{PAGE_NUMBER} </textFieldExpression> </textField> </band> </title> <!-- COLUMN HEADER SECTION --> <columnHeader> <band height="400"> <elementGroup> <!-- FOR HORIZONTAL LINES BELOW THE COLUMN HEADER --> <line> <reportElement x="1" y="30" width="88" height="0" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="91" y="30" width="63" height="0" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="156" y="30" width="98" height="0" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="256" y="30" width="63" height="0" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="321" y="30" width="118" height="0" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="441" y="30" width="108" height="0" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <!-- FOR VERTICAL LINES --> <line> <reportElement x="0" y="-9" width="0" height="375" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="90" y="-9" width="0" height="375" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="155" y="-9" width="0" height="375" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="255" y="-9" width="0" height="375" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="320" y="-9" width="0" height="375" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="440" y="-9" width="0" height="375" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> <line> <reportElement x="550" y="-9" width="0" height="375" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> </elementGroup> <elementGroup> <!-- TOP HORIZONTAL LINE OF THE TABLE --> <line> <reportElement x="0" y="-10" width="550" height="0" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> </elementGroup> <!-- STATIC TEXT : USER NAME --> <staticText> <reportElement x="10" y="-1" width="60" height="28" mode="Opaque" isPrintWhenDetailOverflows="true" isPrintInFirstWholeBand="true"/> <textElement textAlignment="Center"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>User Name </text> </staticText> <!-- STATIC TEXT : PRODUCT --> <staticText> <reportElement x="100" y="-1" width="50" height="28" mode="Opaque" isPrintWhenDetailOverflows="true" isPrintInFirstWholeBand="true"/> <textElement textAlignment="Center"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>Product</text> </staticText> <!-- STATIC TEXT : THERAPEUTIC NAME --> <staticText> <reportElement x="160" y="-1" width="90" height="28" mode="Opaque" isPrintWhenDetailOverflows="true" isPrintInFirstWholeBand="true"/> <textElement textAlignment="Center"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>Therapeutic Name</text> </staticText> <!-- STATIC TEXT : ROLE --> <staticText> <reportElement x="260" y="-1" width="50" height="28" mode="Opaque" isPrintWhenDetailOverflows="true" isPrintInFirstWholeBand="true"/> <textElement textAlignment="Center"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>Role</text> </staticText> <!-- STATIC TEXT : NUMBER OF INQUIRIES ASSIGNED --> <staticText> <reportElement x="323" y="-1" width="110" height="28" mode="Opaque" isPrintWhenDetailOverflows="true" isPrintInFirstWholeBand="true"/> <textElement textAlignment="Center"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>No.of Inquiries Assigned</text> </staticText> <!-- STATIC TEXT : NUMBER OF INQUIRIES --> <staticText> <reportElement x="455" y="-1" width="80" height="28" mode="Opaque" isPrintWhenDetailOverflows="true" isPrintInFirstWholeBand="true"/> <textElement textAlignment="Center"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>No.of Inquiries</text> </staticText> </band> </columnHeader> <!-- DETAIL SECTION --> <detail> <band height="23"> <!-- TEXT FIELD : USER NAME --> <textField isStretchWithOverflow="true" > <reportElement x="2" y="-350" width="86" height="15" positionType="Float" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Center"> <font isBold="false" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.String"> $F{USER_ID} </textFieldExpression> </textField> <!-- TEXT FIELD : PRODUCT --> <textField isBlankWhenNull="true" isStretchWithOverflow="true" > <reportElement x="92" y="-350" width="61" height="15" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Center"> <font isBold="false" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.String"> $F{PRODUCT_NAME} </textFieldExpression> </textField> <!-- TEXT FIELD : THERAPEUTIC NAME --> <textField isBlankWhenNull="true" isStretchWithOverflow="true" > <reportElement x="157" y="-350" width="96" height="15" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Center"> <font isBold="false" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.String"> $F{THERAPEUTIC_NAME} </textFieldExpression> </textField> <!-- TEXT FIELD :ROLE --> <textField isBlankWhenNull="true" isStretchWithOverflow="true" > <reportElement x="257" y="-350" width="61" height="15" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Center"> <font isBold="false" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.String"> $F{ROLE} </textFieldExpression> </textField> <!-- TEXT FIELD : NUMBER OF QUIRIES ASSIGNED --> <textField isBlankWhenNull="true" isStretchWithOverflow="true" > <reportElement x="322" y="-350" width="116" height="15" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Center"> <font isBold="false" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.Integer"> $F{QUERY_COUNT} </textFieldExpression> </textField> <!-- TEXT FIELD : NUMBER OF QUIRIES --> <textField isBlankWhenNull="true" isStretchWithOverflow="true" > <reportElement x="442" y="-350" width="106" height="15" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Center"> <font isBold="false" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.Integer"> $F{F410999} </textFieldExpression> </textField> </band> </detail> <!-- COLUMN FOOTER SECTION --> <columnFooter> <band height="55"> <line> <reportElement x="0" y="-331" width="550" height="0" forecolor="#000000"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> </band> </columnFooter> <!-- PAGE FOOTER SECTION --> <pageFooter> <band height="30"> <!--FOOTER --> <staticText> <reportElement x="100" y="10" width="150" height="20" forecolor="#000000"/> <textElement textAlignment="Center" lineSpacing="Single"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>Report generated by </text> </staticText> <textField> <reportElement x="255" y="10" width="150" height="20" forecolor="#000000"/> <textElement textAlignment="Center"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.String"> $P{FOOTER} </textFieldExpression> </textField> <!-- FOR PAGE NUMBER --> <staticText> <reportElement x="440" y="10" width="40" height="20"/> <textElement textAlignment="Left"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>Page</text> </staticText> <textField> <reportElement x="482" y="10" width="25" height="20"/> <textElement textAlignment="Right"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.Integer"> $V{PAGE_NUMBER} </textFieldExpression> </textField> <staticText> <reportElement x="510" y="10" width="15" height="20"/> <textElement textAlignment="Left"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <text>of</text> </staticText> <textField evaluationTime="Report" evaluationGroup="FirstLetterGroup"> <reportElement x="526" y="10" width="25" height="20"/> <textElement textAlignment="Left"> <font isBold="true" pdfFontName="Times-Roman" /> </textElement> <textFieldExpression class="java.lang.Integer"> $V{PAGE_NUMBER} </textFieldExpression> </textField> </band> </pageFooter> </jasperReport> JAVA file: package com.sysarris.medcomm.app; import java.util.*; import java.sql.*; import java.io.*; import java.net.*; import dori.jasper.engine.JasperExportManager; import dori.jasper.engine.xml.JRXmlLoader; import dori.jasper.engine.design.*; import dori.jasper.engine.util.JRQueryExecuter; import dori.jasper.engine.*; import dori.jasper.engine.export.*; import dori.jasper.engine.util.*; import dori.jasper.view.*; import java.awt.*; public class JasperRepBean{ public static Connection conn = null; private String sqlQuery = null; private String realPath = null; private int reportFormat = 0; private String repTemplate = null; private int reportNo = 0; private String repCriteria = null; private String repUsername = null; private String destPath = null; public void setSqlQuery(String FileStr) { this.sqlQuery = FileStr; } public void setRealPath(String PathStr) { this.realPath = PathStr; } public void setReportFormat(int reportFormat) { this.reportFormat = reportFormat; } public void setRepTemplate(String repTemplate) { this.repTemplate = repTemplate; } public void setreportNo(int reportNo) { this.reportNo = reportNo; } public void setrepCriteria(String repCriteria) { this.repCriteria = repCriteria; } public void setrepUsername(String repUsername) { this.repUsername = repUsername; } public void setdestPath(String destPath) { this.destPath = destPath; } public String getSqlQuery() { return sqlQuery; } public String getRealPath() { return realPath; } public int getReportFormat() { return reportFormat; } public String getRepTemplate() { return repTemplate; } public int getreportNo() { return reportNo; } public String getrepCriteria() { return repCriteria; } public String getrepUsername() { return repUsername; } public String getdestPath() { return destPath; } //This Estabilishes the connection public static Connection getConnection(){ try{ String url = (String)InitApplicationParams.getApplicationProperty("DB_URL"); String userName = (String)InitApplicationParams.getApplicationProperty("DB_USER"); String password = (String)InitApplicationParams.getApplicationProperty("DB_PASSWORD"); String driverName = "oracle.jdbc.driver.OracleDriver"; Class.forName("oracle.jdbc.driver.OracleDriver"); conn = DriverManager.getConnection(url, userName, password); return conn; }catch(Exception se){ se.printStackTrace(); return null; } } // this method gets the sysdate from oracle database public static String getSysdate(){ try{ Connection lcnSysdate=null; Statement lstmtSysdate=null; ResultSet lrsSysdate=null; String repSysdate = null; lcnSysdate = getConnection(); lstmtSysdate=lcnSysdate.createStatement(); lrsSysdate=lstmtSysdate.executeQuery("select to_char(sysdate,'DD-Mon-YYYY HH:MM:SS') from DUAL"); while(lrsSysdate.next()) { repSysdate=lrsSysdate.getString(1); } return repSysdate; }catch(Exception se){ return null; } } private JasperDesign getJasperDesign(String sourceFileName, int repFormat) throws JRException { try { JasperDesign jasperDesign = JRXmlLoader.load(sourceFileName); jasperDesign.setName(getRepTemplate()); System.out.println("Getting Report Template"); //Fonts JRDesignReportFont normalFont = new JRDesignReportFont(); normalFont.setName("Times_Normal1"); normalFont.setDefault(true); normalFont.setFontName("Times New Roman MS"); normalFont.setBold(true); /* normalFont.setPdfFontName("Times-Roman"); normalFont.setPdfEncoding("Cp1252"); normalFont.setPdfEmbedded(false);*/ jasperDesign.addFont(normalFont); JRDesignReportFont boldFont = new JRDesignReportFont(); boldFont.setName("Times_Bold1"); boldFont.setDefault(false); boldFont.setFontName("Times New Roman MS"); boldFont.setBold(true); /*boldFont.setPdfFontName("Times-Bold"); boldFont.setPdfEncoding("Cp1252"); boldFont.setPdfEmbedded(false); jasperDesign.addFont(boldFont); */ if(repFormat == 1) { System.out.println(" Getting into - PDF"); normalFont.setSize(14); boldFont.setSize(13); } else if(repFormat==2) { System.out.println(" Getting into - HTML"); normalFont.setSize(20); boldFont.setSize(25); } else if(repFormat==3) { System.out.println(" Getting into - EXCEL"); normalFont.setSize(12); boldFont.setSize(50); } System.out.println("Getting Report Font"); return jasperDesign; } catch (JRException e) { e.printStackTrace(); System.exit(1); }return null; } public String repNameCompileReport(String sourceFileName, int repFormat) throws JRException { File sourceFile = new File(sourceFileName); System.out.println("Source file"); //JasperDesign jasperDesign = JRXmlLoader.load(sourceFileName); // jasperDesign.setName(getRepTemplate()); JasperDesign jasperDesign = getJasperDesign(sourceFileName,repFormat); System.out.println("Getting into Dest file"); File destFile = new File(sourceFile.getParent(), jasperDesign.getName() + ".jasper"); String destFileName = destFile.toString(); System.out.println("Getting out Destination file"); System.out.println("Starts to compile"); JasperCompileManager.compileReportToFile(jasperDesign, destFileName); System.out.println("Compilation completed"); return destFileName; } // this method converts the xml to HTML public void convertHtml(String repTempFill){ try{ //JasperExportManager.exportReportToHtmlFile(repTempFill); JasperExportManager.exportReportToHtmlFile(repTempFill,getdestPath()); }catch (JRException e){ e.printStackTrace(); System.exit(1); }catch (Exception e){} } //this method converts the xml to Pdf public void convertPdf(String repTempFill){ try{ //JasperExportManager.exportReportToPdfFile(repTempFill); JasperExportManager.exportReportToPdfFile(repTempFill,getdestPath()); }catch (JRException e){ e.printStackTrace(); System.exit(1); }catch (Exception e){} } //this method converts the xml to EXCEL public void convertExcel(String repTempFill,File sourceFile){ try{ JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(repTempFill); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xls"); JRXlsExporter exporter = new JRXlsExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString()); exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); // exporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); exporter.exportReport(); }catch (JRException e){ //e.printStackTrace(); //System.exit(1); }catch (Exception e){ //e.printStackTrace(); } } //This gets the parameters and build the query public void buildReport(){ int repNumber = 0; int repFormat = 0; String repTempFill = ""; String repTemplate = ""; String destfileName=""; //Specify the parameters values and bind it to the key Map parameters =new HashMap(); Connection conObj = null; try{ conObj = getConnection(); if(!(getReportFormat()+"").equals("") ){ repFormat = getReportFormat(); } if(!(getreportNo()+"").equals("") ){ repNumber = getreportNo(); } if(repNumber==1) { System.out.println("Report number one is called"); parameters.put("MySQLQuery",getSqlQuery()); parameters.put("SELECTION",getrepCriteria()); parameters.put("date",getSysdate()); parameters.put("FOOTER",getrepUsername()); String lStrQry = parameters.get("MySQLQuery").toString(); //compiles the xml file destfileName=repNameCompileReport(getRealPath(),repFormat); repTempFill = JasperFillManager.fillReportToFile(destfileName, parameters, conObj); } if(repNumber==2) { parameters.put("MySQLQuery",getSqlQuery()); parameters.put("SELECTION",getrepCriteria()); parameters.put("date",getSysdate()); parameters.put("FOOTER",getrepUsername()); String lStrQry = parameters.get("MySQLQuery").toString(); //compiles the xml file destfileName=repNameCompileReport(getRealPath(),repFormat); repTempFill = JasperFillManager.fillReportToFile(destfileName, parameters, conObj); } if(repNumber==3) { parameters.put("MySQLQuery",getSqlQuery()); parameters.put("SELECTION",getrepCriteria()); parameters.put("date",getSysdate()); parameters.put("FOOTER",getrepUsername()); String lStrQry = parameters.get("MySQLQuery").toString(); //compiles the xml file destfileName=repNameCompileReport(getRealPath(),repFormat); repTempFill = JasperFillManager.fillReportToFile(destfileName, parameters, conObj); } if(repNumber==4) { parameters.put("MySQLQuery",getSqlQuery()); parameters.put("SELECTION",getrepCriteria()); parameters.put("date",getSysdate()); parameters.put("FOOTER",getrepUsername()); String lStrQry = parameters.get("MySQLQuery").toString(); //compiles the xml file destfileName=repNameCompileReport(getRealPath(),repFormat); repTempFill = JasperFillManager.fillReportToFile(destfileName, parameters, conObj); } if(repNumber==5) { parameters.put("MySQLQuery",getSqlQuery()); parameters.put("SELECTION",getrepCriteria()); parameters.put("date",getSysdate()); parameters.put("FOOTER",getrepUsername()); String lStrQry = parameters.get("MySQLQuery").toString(); //compiles the xml file destfileName=repNameCompileReport(getRealPath(),repFormat); repTempFill = JasperFillManager.fillReportToFile(destfileName, parameters, conObj); } if(repFormat==1) { convertPdf(repTempFill); } else if(repFormat==2) { convertHtml(repTempFill); } else if(repFormat==3) { File sourceFile = new File(getdestPath()); convertExcel(repTempFill,sourceFile); } else { System.out.println("unsupported format"); } try{ if(!conObj.isClosed()){ conObj.close(); } }catch(Exception e){} }catch (JRException e){ //e.printStackTrace(); try{ if(!conObj.isClosed()){ conObj.close(); } }catch (Exception e3){} }catch (Exception e1){ //e1.printStackTrace(); try{ if(!conObj.isClosed()){ conObj.close(); } }catch (Exception e4){} } } } By: Vinod Kumar Singh - vinodsingh RE: Problems due to font in HTML,PDF,EXCEL 2004-01-03 03:19 While I am unable to fully understand your problem but to increase the font size in HTML file, without changing the xml source try to modify the <JRHtmlExporter.java> instead of <JRDesignReportFont.java>.
  2. By: G. Madhan Dennis - mdennis_2000 urgent... Empty rows 2003-12-30 03:19 Hi, I am having a wierd problem. I am using a custom data source. My report template has a few text fields, rows and a image. The image is being set programatically by sending it as an object in the parameters map. In the resulting PDF, the image is being displayed properly. However the text fields are empty. The data source returns 800+ fields. There are 800+ rows getting created the PDF's table since I can see the row seperators (horizontal lines), however the values are not getting displayed!! However for reports with row counts of 15-20 the rows are getting displayed properly !! No exceptions are being thrown!! Please help.... By: Anthony Presley - blurngr RE: urgent... Empty rows 2003-12-30 07:21 I've had similar problems, but to solve this, I had to ensure that my band was not including any newline characters, and that the band was of a height capable of displaying the report data (which is currently my largest beef w/ Jasper). IE, if your band is not high enough, your data will not be displayed (but your 1 line horizontal separator likely will be). Hope it helps.... By: G. Madhan Dennis - mdennis_2000 RE: urgent... Empty rows 2004-01-03 02:58 hi anthony, thanks for the info. but the problem is that its not only rows, even the first page in which i am just showing normal fields is not working. And the best joke is, the reports are getting generated fine on one pc and they are not getting generated on another pc!!! I thought fonts might be the problem, but then I installed the same version of JDK (1.4.0) on both machines. Still no luck :( - madhan
  3. By: Justin - jwesbro How to pass in all data 2003-12-10 09:02 If I already have a Collection of data that I want to use in a report, how do I pass that in instead of specifying a query in my report. I looked for examples and searched the archvies, but couldn't find anything about this. Can some one point me to some info on this? By: Teodor Danciu - teodord RE: How to pass in all data 2003-12-10 11:59 Hi, All you have to do is to wrap your collection inside a JRBeanCollectionDataSource. Take a look at the "datasource" sample provided with the project source files. I hope this helps. Teodor By: Ritesh - sharmaritesh RE: How to pass in all data 2004-01-02 03:24 Actually..there is another way to do it...what i did is that i have my data in a databean say "ReportBean"...i put the object as a parameter and pass it to the runreport api... HashMap parameters = new HashMap(); parameters.put("report", retData); here "retData" is an instance of my data bean..having all my data..then... JasperRunManager.runReportToPdf(<name of template>, parameters, <some dummy data source>); in the report i get this parameter (named "report" while putting) and i can use the usual getter methods to get the data... hope that helps
  4. By: Steinberger Jonas - steinberger dynamic column width, stretchOverflow in Head 2004-01-01 04:35 Hi I've adapted JR to our dynamic framework, which allows us by directly creating JasperDesign to have a flexible column width. I've linked our column headers to TextFields for using the feature of stretchWithOverflow. But lik you know I got the Header only once, what is correct. So I tried to add a variable which contains an empty String to outwit JR but I got also the Header only once. In our Framework the user kann define before printing if the output should be portrait or landscape an how many columns the page shold have. The Printing Framework calculates then the width of the flexible columns. So it woult be nice to have the oportunity to have stretchWithOverflow Hearers also for stativ texts, that Headers can be printed over more then one line. Is ther any chance to magage thet? Thanks for answer Jonas
  5. By: trucking2go - t2g passing values from subreport to masterreport 2003-12-26 00:36 hello, The report i am trying to generate is a document with several bills, so i've some subreports and i want to do two things : first i want to give a page number which will reset to each bill second i want to calculate the sum of each page and print this on the next page. This sum is use to calculate the sum of this page. Actually i'm using a combination of group-subreport. Need help, please thanks bye By: Teodor Danciu - teodord RE: passing values from subreport to masterreport 2003-12-30 03:08 Hi, Here's the solution for returning values from a subreport: https://sourceforge.net/forum/message.php?msg_id=1746736 I hope this helps. Teodor By: Teodor Danciu - teodord RE: passing values from subreport to masterreport 2003-12-30 03:08 Hi, Here's the solution for returning values from a subreport: https://sourceforge.net/forum/message.php?msg_id=1746736 I hope this helps. Teodor
  6. By: Steinberger Jonas - steinberger Muliple title using subreports on first page 2003-12-22 06:21 While studying the sample report "subreport" i've detected this proble. Probabely it's already fixed. On the first page of the report, the "title" section will be printed for each group (in this exemple 2 times) and not only ahead of the first group. It's not critical but it does not look very professional. Is there any idea to avoid this problem? Thank's for answer jonas By: Teodor Danciu - teodord RE: Muliple title using subreports on first page 2003-12-22 06:47 Hi, I don't quite see it. Each subreport has its own title. And this title section of the subreport gets printed every time the subreport is generated. Can you be more specific about what the problem is? Thank you, Teodor By: Steinberger Jonas - steinberger RE: Muliple title using subreports on first page 2004-01-01 04:18 Sorry Theodor I missanderstood the way of Pagebreak and Head creating. It's consistent. Sorry waisting your time. Thsak's for answering Jonas
  7. By: Santhanam - santhanam subreport in different pages 2003-12-30 08:55 Hi Friends, I have a master report with 2 subreports. I want first subreport's first page printed on master report's 1st page. second subreport's first page printed on master report's 2nd page and so on. Please kindly help me. Thanks in Advance With Regards Santhanam
  8. By: Yong Wang - wymz group variable w/ Count on null field value 2003-12-29 11:45 I have a group variable that counts the number of records in that group by counting on the grouped field (ACCOUNT_NUMBER). But the field (ACCOUNT_NUMBER) could contain null value. What happens is when ACCOUNT_NUMBER is null, the group works fine by displaying all records with null account number, but the count shows zero even though there many records in this group. <variable name="ACCOUNT_NUMBER_Group_Count" class="java.lang.Integer" resetType="Group" resetGroup="ACCOUNT_NUMBER_Group" calculation="Count"> <variableExpression>$F{ACCOUNT_NUMBER}</variableExpression> </variable> Does anyone know how to make this count work? Thank you! By: Teodor Danciu - teodord RE: group variable w/ Count on null field value 2003-12-30 02:55 Hi, The count variables always count for the non null values of their corresponding expression. But for what you need there is already a predefined variable called GroupName_COUNT. I hope this helps. Teodor
  9. By: kean - cheah418 Please help! How to insert a row number? 2003-12-30 00:41 I need to insert a row number to each row. How to do that? I've try using 'COLUMN_COUNT' but this counter reset on each page... Please advise. Many Thanks! By: Teodor Danciu - teodord RE: Please help! How to insert a row number? 2003-12-30 02:44 Hi, Use REPORT_COUNT instead. I hope this helps. Teodor
  10. By: Matthias Tichy - mtt printing problem: distorted letters 2003-12-29 14:52 hello, i am using jasperreports for generating and printing some reports. I use the JasperViewer class for viewing and printing the generated and filled report. One report (which is pretty easy and does not use many sophisticated features) has problems concerning distorted letters. One one printer it prints vertical bars all over some fields, on another printer it prints fine, while printing to the acrobat pdfwriter printer on windows some fields have distorted letters at the end. I use jasperreports 0.5.0 and jdk 1.4.2. My font declaration is: <reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="11" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> Has anybody experienced a similar problem and can point me to a solution? Thanks mtt By: Matthias Tichy - mtt RE: printing problem: distorted letters 2003-12-29 15:15 I have forgotten to add, that in the jasperview everyting looks ok! mtt
  11. By: Jeffrey S. Hair - jshair Editing reports via web 2003-12-29 12:51 I need to provide the ability for users to modify the layout of reports from a web application. So, can JasperReports be loaded as an applet? Or is there another tool that can be loaded as an applet to provide editing capabilities? Thanx, jsh
  12. By: Amol Purohit - amol_purohit Disable Pagination in HTML 2003-12-29 05:11 Hi, I need to disable pagination in the HTML reports that I am generating. Can anyone help me with this. I know there is a 'nopagebreak' example in the jasper distributions but I want to know exactly how does this work. Secondly I want to disable pagination only for HTML reports. Not for the other formats. So I do not want to change the report design just for HTML. I am writing my own HMTL exporter and so want to do this in the code. Has anyone tried this? Can anyone help me with this? Thanks in advance, Amol
  13. By: Ivan Codarin - codarin tomcat 5.0 2003-12-29 02:58 Dear All, Has anyone tested jasper-reports with tomcat 5.0.16? Is it ok? I'm evaluating the upgrade of this app-server from 4.1 to 5.0.... Thanks Ivan
  14. By: Lokesh Javaji - ljavaji UNABLE to generate PDF on non XWINDOW session 2003-12-28 04:24 Problem Description ------------------- We are not able to generate PDF from a telnet session running on Unix (Solaris falvor). But we are able to generate PDF successfully having an XWindows session open. We are breaking our heads. Help needed ASAP as we are going production. Lokesh By: Vinod Kumar Singh - vinodsingh RE: UNABLE to generate PDF on non XWINDOW ses 2003-12-28 20:40 try to use xvbf
  15. By: Noam Birnbaum - noambir Exporting subreports to HTML/XLS 2003-12-23 00:30 I can't export reports with subreports to HTML or XLS, however they work OK with the applet viewer and PDF/CSV. Any ideas? Noam By: Vinod Kumar Singh - vinodsingh RE: Exporting subreports to HTML/XLS 2003-12-26 21:06 What difficulties yoy are facing?
  16. By: ccatindia - ccatindia how can give report as input for calling prog 2003-12-25 00:57 Dear Sir, We are using jasperreports in our swing application.We designed the report using iReport successfully.We don't know,how to call the jasper report from the swing application.We saw the samples in demo directory.But we could not understand,how we can give the jasper report file as the input of the calling program.And please explain us how should we have to give the input for the calling function. So please help us to call the jasper file from the swing application. Thanking You, CCAT INDIA By: Vinod Kumar Singh - vinodsingh RE: how can give report as input for calling 2003-12-26 20:57 look at the following thread http://sourceforge.net/forum/forum.php?thread_id=994450&forum_id=113530
  17. By: Balaji - balajigs using jasper report in swing application 2003-12-25 00:00 Dear Sir, I'm using Jasper Reports for one swing application. I have tried to call the report from that application. But I could not able to call that.So please help me to call the report from the swing application. And I also saw the samples in the demo directory. I could not understand how can we give the input file to calling function. So please help me sir... Thanking You, Balaji.G.S By: Vinod Kumar Singh - vinodsingh RE: using jasper report in swing application 2003-12-26 20:54 //load report JasperReport report = JasperManager.loadReport(reportName); //fill report JasperPrint print = JasperManager.fillReport(report, parameters, DbConnection); //display report JPanel pnlViewer = new JRViewer(print); Show this panel.
  18. By: ccatindia - ccatindia Error in filling the jasper report 2003-12-26 06:20 Sir , I have got java.io.Out of Memory error whilw filling the jasper report . Please reply me why i am getting this error. Iam swing as my GUI , Calling the Function Fillreport to Fn() in jasper Fill manager. Thankyou
  19. By: Arun Kumar PG - pgarunkumar Printing Special Caracter ?? Urgent! 2003-12-23 22:29 Hi all! I am printing one report in which I need to print the "degree" symbol for temperature.I mean rather than writing 20 degree celcious i wanna write the round symbol for that.i.e. 20 (symbol) C Can any one tell me how to get that in my report ?? Quick response will be highly appreciated! Thankz Arun
  20. By: Anthony Presley - blurngr Grouping variables / if statements with BS 2003-12-23 21:45 Hello all: I'm trying to get Jasper Reports to build a pretty complex report (for me), and here's what I've got. I have a group of user's who paid on a certain date, and there are two types of payments, say, payment 1 and payment 2. I want them arranged as such: DATE (DESCENDING) Payment 1 ALL Payments where payment = 1 Payment 2 ALL Payments where payment = 2 NEXT DATE (DESCENDING) Payment 1 ALL Payments where payment = 1 Payment 2 ALL Payments where payment = 2 Which is fine, I can do this using groups for the date, then a group for the payments. However, at the top of the page, I want a quick summary, which display's the total payment = 1 amount and the total payment = 2 amount (split up). I don't want it reseting the variables when it goes to the next group. In java [or I4GL], I would so something like: [init] sum1 = 0; sum2 = 0; [when printing a user] if (payment == 1) sum1 += paymentAmt else sum2 += paymentAmt However, I seem to have no luck generating this. How do I do it, short of passing it as a parameter (which defeats the purpose of the report)? Please help. --Anthony
  21. By: Mel Seyle - mseyle report overlaying output problem 2003-12-23 10:10 I'm trying to create a simple report that reads some data from a database table and displays the results. The report works fine if the query only returns a small number of rows that will fit on one page. If a large number of rows are returned the data starts overlaying on top of the previous pages instead of starting a new page. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="ActionCodeReport" columnCount="2" pageWidth="595" pageHeight="800" whenNoDataType="BlankPage" columnWidth="250" columnSpacing="1" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30"> <queryString><![CDATA[select serial_key, action_code from action where serial_key < 3050 order by serial_key]]></queryString> <field name="serial_key" class="java.lang.Integer"> </field> <field name="action_code" class="java.lang.String"> </field> <title> <band height="50"> <staticText> <reportElement positionType="Float" x="0" y="0" width="595" height="50"/> <textElement> <font size="16" isBold="true"/> </textElement> <text><![CDATA[]]></text> </staticText> </band> </title> <pageHeader> <band> </band> </pageHeader> <columnHeader> <band height="20"> <staticText> <reportElement positionType="Float" x="0" y="0" width="250" height="20"/> <textElement> <font isUnderline="true"/> </textElement> <text><![CDATA[serial_key]]></text> </staticText> <staticText> <reportElement positionType="Float" x="250" y="0" width="250" height="20"/> <textElement> <font isUnderline="true"/> </textElement> <text><![CDATA[action_code]]></text> </staticText> </band> </columnHeader> <detail> <band height="20"> <textField> <reportElement positionType="Float" x="0" y="0" width="250" height="20"/> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{serial_key}]]></textFieldExpression> </textField> <textField> <reportElement positionType="Float" x="250" y="0" width="250" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{action_code}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band> </band> </columnFooter> <pageFooter> <band height="15"> <staticText> <reportElement positionType="Float" x="0" y="0" width="40" height="15"/> <textElement/> <text><![CDATA[Page:]]></text> </staticText> <textField> <reportElement positionType="Float" x="40" y="0" width="100" height="15"/> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band> </band> </summary> </jasperReport>
  22. By: Salvador Rodriguez Rueda - srrueda Compile problem with Java Web Start 2003-12-23 04:54 Hello, I can't compile my report when I use Java Web Start to download the code from a Server to clients. Everything is fine when I execute my machine's code (I get a very nice report), but when I execute downloaded code (including the Jasper jars) I get the next error: at dori.jasper.engine.design.JRAbstractJavaCompiler.compileReport(JRAbstractJavaCompiler.java:154) at dori.jasper.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:136) at dori.jasper.engine.JasperCompileManager.compileReport(JasperCompileManager.java:196) at PrintForm.verJasper(PrintForm.java:203) It seems there are problems with the classpath and is trying to find a class in the desk (which I don't understand) dori.jasper.engine.JRException: Errors were encountered when compiling report expressions class file: C:WINNTProfilesUSRREscritorioGridDesignReport.java:4: package dori.jasper.engine does not exist import dori.jasper.engine.*; ^ C:WINNTProfilesUSRREscritorioGridDesignReport.java:5: package dori.jasper.engine.fill does not exist import dori.jasper.engine.fill.*; ^ C:WINNTProfilesUSRREscritorioGridDesignReport.java:17: cannot resolve symbol symbol : class JRCalculator location: class GridDesignReport public class GridDesignReport extends JRCalculator Is there anybody who has experienced this? I would appreciate very much any help. By the way, happy Chritsmas averybody. By: pickle - pickle81 How to invoke adobe acrobat 2003-12-22 20:08 I am having problem trying to invoke the adobe acrobat reader. Is there any specific library or anything that I may need to do this? Thanks
  23. By: Peter Korolev - pet_on Subreport not shows... 2003-11-06 00:13 My master report has three subreports. But only single subreport shows. First subreport I put in detail band. Second subreport I put in group header and third subreport in group footer. If I put single subreport in master report it shows well. I don?t understand why? Please somebody help! Here is my xml of master report: <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd";> <jasperReport name="ActReportMain" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <parameter name="ActReportPage1" isForPrompting="true" class="dori.jasper.engine.JasperReport"/> <parameter name="MainDataSource" isForPrompting="true" class="ru.elektra.mcc.reports.SimpleReportDataSource"/> <parameter name="ActReportPage2" isForPrompting="true" class="dori.jasper.engine.JasperReport"/> <parameter name="ActReportPage3" isForPrompting="true" class="dori.jasper.engine.JasperReport"/> <parameter name="ActReportExpelWork" isForPrompting="true" class="dori.jasper.engine.JasperReport"/> <parameter name="ActReportActions" isForPrompting="true" class="dori.jasper.engine.JasperReport"/> <parameter name="ActReportNeedActions" isForPrompting="true" class="dori.jasper.engine.JasperReport"/> <parameter name="ActReportExpelWorkDataSource" isForPrompting="true" class="ru.elektra.mcc.reports.SimpleReportDataSource"/> <parameter name="ActReportActionsDataSource" isForPrompting="true" class="ru.elektra.mcc.reports.SimpleReportDataSource"/> <parameter name="ActReportNeedActionsDataSource" isForPrompting="true" class="ru.elektra.mcc.reports.SimpleReportDataSource"/> <group name="MyGroup" isStartNewColumn="false" isStartNewPage="false" isResetPageNumber="false" isReprintHeaderOnEachPage="false" minHeightToStartNewPage="0" > <groupExpression></groupExpression> <groupHeader> <band height="50"> <subreport isUsingCache="true"> <reportElement mode="Opaque" x="0" y="9" width="535" height="28" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <dataSourceExpression>$P{MainDataSource}</dataSourceExpression> <subreportExpression class="dori.jasper.engine.JasperReport"><![CDATA[$P{ActReportPage1}]]></subreportExpression> </subreport> </band> </groupHeader> <groupFooter> <band height="50"> <subreport isUsingCache="true"> <reportElement mode="Opaque" x="0" y="11" width="535" height="28" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <dataSourceExpression>$P{MainDataSource}</dataSourceExpression> <subreportExpression class="dori.jasper.engine.JasperReport"><![CDATA[$P{ActReportPage3}]]></subreportExpression> </subreport> --> </band> </groupFooter> </group> <detail> <band height="50"> <subreport isUsingCache="true"> <reportElement mode="Opaque" x="0" y="9" width="535" height="28" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <subreportParameter name="ActReportExpelWork"> <subreportParameterExpression>$P{ActReportExpelWork}</subreportParameterExpression> </subreportParameter> <subreportParameter name="ActReportActions"> <subreportParameterExpression>$P{ActReportActions}</subreportParameterExpression> </subreportParameter> <subreportParameter name="ActReportNeedActions"> <subreportParameterExpression>$P{ActReportNeedActions}</subreportParameterExpression> </subreportParameter> <subreportParameter name="ActReportExpelWorkDataSource"> <subreportParameterExpression>$P{ActReportExpelWorkDataSource}</subreportParameterExpression> </subreportParameter> <subreportParameter name="ActReportActionsDataSource"> <subreportParameterExpression>$P{ActReportActionsDataSource}</subreportParameterExpression> </subreportParameter> <subreportParameter name="ActReportNeedActionsDataSource"> <subreportParameterExpression>$P{ActReportNeedActionsDataSource}</subreportParameterExpression> </subreportParameter> <dataSourceExpression>$P{MainDataSource}</dataSourceExpression> <subreportExpression class="dori.jasper.engine.JasperReport"><![CDATA[$P{ActReportPage2}]]></subreportExpression> </subreport> </band> </detail> </jasperReport> By: pandu - pandu16 RE: Subreport not shows... 2003-12-22 08:22 Place each of the SubReports in different Groups Hope this helps
  24. By: CARLOS ALBERTO SILVA - csilva2001 error with JRLoader.class.getClassLoader 2003-01-01 11:52 Please, what means the message: ************************************************************************* * WARNING: Failure using Thread.currentThread().getContextClassLoader() * * in JRLoader class. Using JRLoader.class.getClassLoader() instead. * ************************************************************************* dori.jasper.engine.JRException: Could not load font from location : Helvetica-Bold ? If I load reportA.pdf, it runs ok. If load reportB.pdf, I receive the message above. Both report use Helvetica-Bold font. Why just reportB.pdf send me that error message?... OBS: both reports are compiled with jsperReport compiler. Can you help me? An embrace, Carlos By: Teodor Danciu - teodord RE: error with JRLoader.class.getClassLoader 2003-01-02 01:54 Hi, Are you sure there's no blank space in the pdfFontName attribute, before or after the Helvetica-Bold sequence? Can I see your XML report design? teodord@hotmail.com Thank you, Teodor By: CARLOS ALBERTO SILVA - csilva2001 RE: error with JRLoader.class.getClassLoader 2003-01-02 06:24 OK. <?xml version="1.0" encoding="ISO-8859-1" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="rptFabricante" columnCount="1" printOrder="Horizontal" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="BlankPage" isTitleNewPage="false" isSummaryNewPage="false"> <reportFont name="titulo1" isDefault="false" fontName="sansserif" size="16" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/> <reportFont name="tituloX" isDefault="false" fontName="sansserif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/> <reportFont name="infos" isDefault="false" fontName="sansserif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/> <queryString><![CDATA[ SELECT PAIS_SIGLA, FABRICANTE_NOME, CODEMP, FABRICANTE_ENDERECO FROM TBLFABRICANTE, TBLPAIS ORDER BY FABRICANTE_NOME ]]></queryString> <field name="PAIS_SIGLA" class="java.lang.String"/> <field name="FABRICANTE_NOME" class="java.lang.String"/> <field name="CODEMP" class="java.lang.String"/> <field name="FABRICANTE_ENDERECO" class="java.lang.String"/> <variable name="PAGE_COUNT11" class="java.lang.Integer" resetType="Report" calculation="Nothing"> </variable> <title> <band height="89"> <staticText> <reportElement mode="Transparent" x="2" y="6" width="532" height="21" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Center" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Times-Bold" size="16" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="true" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[Diretoria de Saúde da Aeronáutica]]></text> </staticText> <staticText> <reportElement mode="Transparent" x="4" y="60" width="528" height="21" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Center" lineSpacing="Single"> <font fontName="" pdfFontName="Times-Bold" size="14" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[AgC-S6]]></text> </staticText> <staticText> <reportElement mode="Transparent" x="5" y="32" width="528" height="21" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Center" lineSpacing="Single"> <font fontName="" pdfFontName="Times-Bold" size="14" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[Agência de Catalogação]]></text> </staticText> </band> </title> <pageHeader> <band height="64"> <staticText> <reportElement mode="Transparent" x="3" y="8" width="528" height="22" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Center" lineSpacing="Single"> <font fontName="" reportFont="tituloX" pdfFontName="Helvetica-Bold" size="14" isBold="true" isItalic="false" isUnderline="true" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[Relatório de Fabricante]]></text> </staticText> <textField isStretchWithOverflow="false" pattern="dd/MM/yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="386" y="33" width="139" height="17" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Right" lineSpacing="Single"> <font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.util.Date">new Date()</textFieldExpression> </textField> </band> </pageHeader> <columnHeader> <band height="26"> <staticText> <reportElement mode="Opaque" x="14" y="9" width="37" height="12" forecolor="#400040" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[item]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="55" y="9" width="159" height="12" forecolor="#400040" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[Nome do Fabricante]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="221" y="9" width="62" height="12" forecolor="#400040" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[codeMP]]></text> </staticText> <line direction="TopDown"> <reportElement mode="Opaque" x="3" y="21" width="529" height="0" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <graphicElement stretchType="NoStretch" pen="1Point" fill="Solid" /> </line> <staticText> <reportElement mode="Transparent" x="292" y="8" width="195" height="11" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[Endereço]]></text> </staticText> <staticText> <reportElement mode="Transparent" x="493" y="6" width="36" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[País]]></text> </staticText> </band> </columnHeader> <detail> <band height="19"> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="16" y="4" width="29" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="sansserif" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.Integer">$V{REPORT_COUNT}</textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="55" y="4" width="158" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{FABRICANTE_NOME}</textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="221" y="4" width="65" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{CODEMP}</textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="292" y="4" width="193" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{FABRICANTE_ENDERECO}</textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="493" y="4" width="34" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{PAIS_SIGLA}</textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="16"> </band> </columnFooter> <pageFooter> <band height="40"> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="374" y="9" width="80" height="15" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Right" lineSpacing="Single"> <font fontName="sansserif" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">"Página " + String.valueOf($V{PAGE_NUMBER}) + " de"</textFieldExpression> </textField> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None" > <reportElement mode="Transparent" x="454" y="9" width="75" height="15" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Helvetica" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">" " + String.valueOf($V{PAGE_NUMBER})</textFieldExpression> </textField> </band> </pageFooter> <summary> <band height="3"> </band> </summary> </jasperReport> Embrace. Carlos By: Teodor Danciu - teodord RE: error with JRLoader.class.getClassLoader 2003-01-02 07:41 Hi, I was able to generate report in PDF format using your XML without problems. However, be aware that the pdfEncoding attribute is case sensitive and the correct value would be Cp1252 and not CP1252. Could you post the entire stack trace you have? Thank you, Teodor By: CARLOS ALBERTO SILVA - csilva2001 RE: error with JRLoader.class.getClassLoader 2003-01-02 08:46 OK. <?xml version="1.0" encoding="ISO-8859-1" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="rptFabricante" columnCount="1" printOrder="Horizontal" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="BlankPage" isTitleNewPage="false" isSummaryNewPage="false"> <reportFont name="titulo1" isDefault="false" fontName="sansserif" size="16" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/> <reportFont name="tituloX" isDefault="false" fontName="sansserif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/> <reportFont name="infos" isDefault="false" fontName="sansserif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/> <queryString><![CDATA[ SELECT PAIS_SIGLA, FABRICANTE_NOME, CODEMP, FABRICANTE_ENDERECO FROM TBLFABRICANTE, TBLPAIS ORDER BY FABRICANTE_NOME ]]></queryString> <field name="PAIS_SIGLA" class="java.lang.String"/> <field name="FABRICANTE_NOME" class="java.lang.String"/> <field name="CODEMP" class="java.lang.String"/> <field name="FABRICANTE_ENDERECO" class="java.lang.String"/> <variable name="PAGE_COUNT11" class="java.lang.Integer" resetType="Report" calculation="Nothing"> </variable> <title> <band height="89"> <staticText> <reportElement mode="Transparent" x="2" y="6" width="532" height="21" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Center" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Times-Bold" size="16" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="true" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[Diretoria de Saúde da Aeronáutica]]></text> </staticText> <staticText> <reportElement mode="Transparent" x="4" y="60" width="528" height="21" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Center" lineSpacing="Single"> <font fontName="" pdfFontName="Times-Bold" size="14" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[AgC-S6]]></text> </staticText> <staticText> <reportElement mode="Transparent" x="5" y="32" width="528" height="21" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Center" lineSpacing="Single"> <font fontName="" pdfFontName="Times-Bold" size="14" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[Agência de Catalogação]]></text> </staticText> </band> </title> <pageHeader> <band height="64"> <staticText> <reportElement mode="Transparent" x="3" y="8" width="528" height="22" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Center" lineSpacing="Single"> <font fontName="" reportFont="tituloX" pdfFontName="Helvetica-Bold" size="14" isBold="true" isItalic="false" isUnderline="true" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[Relatório de Fabricante]]></text> </staticText> <textField isStretchWithOverflow="false" pattern="dd/MM/yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="386" y="33" width="139" height="17" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Right" lineSpacing="Single"> <font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.util.Date">new Date()</textFieldExpression> </textField> </band> </pageHeader> <columnHeader> <band height="26"> <staticText> <reportElement mode="Opaque" x="14" y="9" width="37" height="12" forecolor="#400040" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[item]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="55" y="9" width="159" height="12" forecolor="#400040" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[Nome do Fabricante]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="221" y="9" width="62" height="12" forecolor="#400040" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[codeMP]]></text> </staticText> <line direction="TopDown"> <reportElement mode="Opaque" x="3" y="21" width="529" height="0" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <graphicElement stretchType="NoStretch" pen="1Point" fill="Solid" /> </line> <staticText> <reportElement mode="Transparent" x="292" y="8" width="195" height="11" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[Endereço]]></text> </staticText> <staticText> <reportElement mode="Transparent" x="493" y="6" width="36" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <text><![CDATA[País]]></text> </staticText> </band> </columnHeader> <detail> <band height="19"> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="16" y="4" width="29" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="sansserif" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.Integer">$V{REPORT_COUNT}</textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="55" y="4" width="158" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{FABRICANTE_NOME}</textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="221" y="4" width="65" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{CODEMP}</textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="292" y="4" width="193" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{FABRICANTE_ENDERECO}</textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="493" y="4" width="34" height="13" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{PAIS_SIGLA}</textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="16"> </band> </columnFooter> <pageFooter> <band height="40"> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="374" y="9" width="80" height="15" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Right" lineSpacing="Single"> <font fontName="sansserif" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">"Página " + String.valueOf($V{PAGE_NUMBER}) + " de"</textFieldExpression> </textField> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None" > <reportElement mode="Transparent" x="454" y="9" width="75" height="15" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="Helvetica" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">" " + String.valueOf($V{PAGE_NUMBER})</textFieldExpression> </textField> </band> </pageFooter> <summary> <band height="3"> </band> </summary> </jasperReport> Embrace. Carlos By: CARLOS ALBERTO SILVA - csilva2001 RE: error with JRLoader.class.getClassLoader 2003-01-03 14:00 Hi, Teodor. Can you tell anything about that question? Carlos By: Teodor Danciu - teodord RE: error with JRLoader.class.getClassLoader 2003-01-06 02:05 Hi, I don't have any idea. Normally, the "Helvetica-Bold" font is one of the 14 built-in fonts that we could use with iText and the program should not try to load it as a TTF file from disk. Maybe Paulo could give us a hint here. Thank you, Teodor By: CARLOS ALBERTO SILVA - csilva2001 RE: error with JRLoader.class.getClassLoader 2003-01-06 05:38 I also do not understand... That same font works very well in other report. Please, what font you think I can use? By: CARLOS ALBERTO SILVA - csilva2001 RE: error with JRLoader.class.getClassLoader 2003-01-06 16:03 Hi Teodor. Who is Paulo? How can I communicate with Paulo? Thanks, Carlos By: Teodor Danciu - teodord RE: error with JRLoader.class.getClassLoader 2003-01-07 02:36 Hi, I referred to Paulo Soares, one of the iText developers. He answers from time to time to iText related questions posted on this forum. You could try to post this on the iText forum since I think it might be related to iText. The XML you've sent me works fine on my machine. Thank you, Teodor By: CARLOS ALBERTO SILVA - csilva2001 RE: error with JRLoader.class.getClassLoader 2003-01-07 05:23 Hi, Teodor. See the error message: * WARNING: Failure using Thread.currentThread().getContextClassLoader() * * in JRLoader class. Using JRLoader.class.getClassLoader() instead. * Do you have same idea about that message: Failure using Thread.currentThread().getContextClassLoader() * ? Maybe the error be before iText. That failure can be in my application code? Embrace, Carlos By: Teodor Danciu - teodord RE: error with JRLoader.class.getClassLoader 2003-01-07 05:34 Hi, No. The problem is that somehow the font "Helvetica-Bold" is not recognized as a build-in font. Normally, the engine should not go so far and try to load it from disk. Of course, it will fail when trying to load from disk, because there is no such TTF file anywhere. This is where you get the exception. But it should have not tried this in the first place. Teodor By: CARLOS ALBERTO SILVA - csilva2001 RE: error with JRLoader.class.getClassLoader 2003-01-13 16:36 Hi, Teodor. About my question, Paulo talk me: "This is a JR error, not iText. " Very bad, no? Teodor, I can't use JasperReport because pdf error. Will be I can do anything abaout? Reinstall Windows for example? Or maybed, put iText in classpath.... Please, tell me anything... I need builder my reports with JasperReport... Embrace, Carlos By: Ben Plantinga - benplant RE: error with JRLoader.class.getClassLoader 2003-01-13 22:59 Carlos: I believe I had a similar problem to what you are describing. I had an existing JasperReport XML file which I then edited with iReport. I managed to fix an error that was similar to yours by changing how the fonts were used in the body of the XML file. At the beginning of the report posted there are two report fonts set up. These are shown here: <reportFont name="titulo1" isDefault="false" fontName="sansserif" size="16" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/> <reportFont name="tituloX" isDefault="false" fontName="sansserif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/> In the body of the XML file the following font descriptions are used: <font fontName="" reportFont="tituloX" pdfFontName="Helvetica-Bold" size="14" isBold="true" isItalic="false" isUnderline="true" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> <font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> I think the problem has something to do with iReports inserting more information in to the font description, such as the pdfFontName attribute. I think by replacing font descriptions like the two above with a simplified version (shown below), you should be able to fix the problem: <font reportFont="titulo1" size="12" isBold="true" /> <font reportFont="tituloX" isUnderline="true" /> Because the report Font description is already done at the beginning of the XML file, you don't need the whole description, but can add attributes like isBold and isUnderline, etc. (At least it seems to be working for me). I don't know the details of why this would be causing a problem, or if I am describing the solution correctly. But by replacing the full descriptions (including the pdfFontName attribute) with the simplified version in one of my own reports, I was able to solve my problem. Hope that helps you, Ben By: CARLOS ALBERTO SILVA - csilva2001 RE: error with JRLoader.class.getClassLoader 2003-01-16 14:38 Hi, Ben. Thanks a lot for the your attention. But my problem continue... I would like fix the error. JasperReport would be the report generator for my application. Maybe in next version, Teodor can resolve that problem... A embrace, Carlos By: CARLOS ALBERTO SILVA - csilva2001 RE: error with JRLoader.class.getClassLoader 2003-01-16 15:00 Hi, Ben. I created news fonts for reports. Deleted old ones. Compile the report and this time its ok with html and pdf. At least I can compile and execute. I think resolved the problem. Carlos By: CARLOS ALBERTO SILVA - csilva2001 RE: error with JRLoader.class.getClassLoader 2003-01-02 08:55 Here the messages: Compilation running time : 21261 Opening connection.... Executing query SELECT PAIS_SIGLA, FABRICANTE_NOME, CODEMP, FABRICANTE_ENDERECO FROM TBLFABRICANTE, TBLPAIS ORDER BY FABRICANTE_NOME Print generated succesfully. Exporting pdf to file... C:RepSGMSWriterptFabricante.pdf ************************************************************************* * WARNING: Failure using Thread.currentThread().getContextClassLoader() * * in JRLoader class. Using JRLoader.class.getClassLoader() instead. * ************************************************************************* dori.jasper.engine.JRException: Could not load font from location : Helvetica-Bold at dori.jasper.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:850) at dori.jasper.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:316) at dori.jasper.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:270) at dori.jasper.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:214) at IReportCompiler.main(IReportCompiler.java:197) Abnormal termination! OK? By: Teodor Danciu - teodord RE: error with JRLoader.class.getClassLoader 2003-12-19 15:39 Hi, The true cause might be this one: https://sourceforge.net/forum/forum.php?thread_id=954508&forum_id=113530 But it could be any other mismatch between the pdfFontName and the pdfEncoding atttributs. The JasperReports code was update on the CVS repository to give more details about the cause of this exception. I hope this helps. Teodor
  25. By: songzi - songzi setPrintOrder problem 2003-12-21 10:24 I use JasperPrint to print a report, How to set print order??? Thank you!! By: Teodor Danciu - teodord RE: setPrintOrder problem 2003-12-22 06:44 Hi, I'm not sure about to what setting are you refering to. Is it about the "printOrder" attribute available for a report design (Vertical, Horizontal) or the page orientation (Portrait, Landscape)? Thank you, Teodor
×
×
  • Create New...