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: Servizi - jlda Creting Excel stream via web 2003-01-24 00:22 I launch Jasperreports from my web application. When I generate a report in HTML, PDF, CSV file format everything works well, but, using the JRXlsExporter I receive an empty byte stream. Can anybody help me? By: Matt Hall - matt2k RE: Creting Excel stream via web 2003-01-30 16:58 Hey, Just figured this out myself, it looks something like this (I am assuming you already have your JasperPrint object ready to go): JRXlsExporter exporter = new JRXlsExporter(); ByteArrayOutputStream xlsReport = new ByteArrayOutputStream(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, xlsReport); exporter.exportReport(); reportBytes = xlsReport.toByteArray(); Then stream those reportBytes back to the client. Hope that helps. Matt
  2. By: Michel - micheljr Two-page report doubt 2003-01-30 11:40 Hi, I have a report that cannot fit in one page and exceeds to the second page. Is there anyway to generate two-page report provided that each record in the RecordSet generates one set of two-page output? I read the http://jasperreports.sourceforge.net/tips.tricks.html#largebands but I still don't understand how to solve my problem without changing the size A4 to a bigger one. Thanks in advance.
  3. By: Neil H - neilhay Is there way you tell if report was generated 2003-01-30 05:55 I am using JasperRunManager.runReportToPdfFile and need to know if report was generated, may be True or False. is there any way to do that?
  4. By: Tam Nguyen Anh - tamnguyen Error w/ Servlet 2003-01-28 20:21 Hi all, I build an application and compile my xml files to pdf files correctly. But when I devenlope a servlet and use JR, I can't compile those files. Although I did add the jasperreports-0.4.4.jar into my 'WEB-INF/lib' and 'jakarta-tomcat-4.0.3/lib' folders, I still got those errors: dori.jasper.engine.JRException: Errors were encountered when compiling report design: C:JBuilder7jakarta-tomcat-4.0.3binTimesheet.java:4: Package dori.jasper.engine not found in import. import dori.jasper.engine.*; ^ C:JBuilder7jakarta-tomcat-4.0.3binTimesheet.java:5: Package dori.jasper.engine.fill not found in import. import dori.jasper.engine.fill.*; ^ C:JBuilder7jakarta-tomcat-4.0.3binTimesheet.java:17: Superclass JRCalculator of class Timesheet not found. public class Timesheet extends JRCalculator ^ 3 errors My xml file is: D:EBAVER3ReportsTimesheet.xml Anyone helps me? By: Tam Nguyen Anh - tamnguyen RE: Error w/ Servlet 2003-01-29 23:38 I solve my problem myself. It was just because I forgot setting those propeties in my servlet: System.setProperty( "jasper.reports.compile.class.path", context.getRealPath("/WEB-INF/lib/jasperreports.jar") + System.getProperty("path.separator") + context.getRealPath("/WEB-INF/classes/") ); System.setProperty( "jasper.reports.compile.temp", context.getRealPath("/reports/") ); String oldSaxDriver = System.setProperty( "org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser" ); Tam
  5. By: Tam Nguyen Anh - tamnguyen The compiling process slow down! 2003-01-29 23:33 I met this warning when compile my xml file : ******************************************************************************* * WARNING: Failure using Thread.currentThread().getContextClassLoader() * * in JRXmlDigester class. Using JRXmlDigester.class.getClassLoader() instead. * ******************************************************************************* I see the cause of this warning also make the compiling report slow down. In the past, it just took me 3 seconds from compile to export an xml file to pdf file. But now, that process takes 20 seconds. Would you all help me? Thanks Tam.
  6. By: Ricardo Trindade - rjst empty subreport 2003-01-29 16:01 Hi, I'm starting to work with subreorts. To keep it simple in the begining, I created a master report that has a subreport element on the page header. The subreport is a file that has some static text also in the page header. I configured the subreport expression, and I am reasonably sure it can read the subreport .jasper file, because if I make a mistake in file name it complaints about not being able to load the class. If I compile and preview the subreport (without datasource), it displays a pdf with the static text. However, if I try it with the master, nothing is displayed. Please help ricardo
  7. By: Jessica Daniel - jrdorbital sql query not returning results 2003-01-29 07:41 The following sql query is returning an empty result set when executed. I have tried placing Begin and End statements around it since it is a compound query. The query will generate results in query analyzer. Are any bugs or limitations on how a sql query must be set up if it consists of more than one statement? Thanks Jessica SELECT DISTINCT OrganizationName, VehicleName, VehicleSpeed, AirTemp, RoadTemp, EngineTemp, DrySandRate, SandWettingRate INTO #aggregate FROM sde.OrbTrac_geoData data JOIN sde.OrbTrac_VehicleGroupVehicle vgv ON data.VID=vgv.VehicleID JOIN sde.OrbTrac_Vehicle v ON data.VID = v.VehicleID JOIN sde.OrbTrac_Organization org ON v.OrgID = org.OrganizationID WHERE ( GeoTime BETWEEN '12/29/02 9:00 AM' AND '12/29/02 3:00 PM' ) AND vgv.VehicleGroupId = 'cbb3f58e-30c9-4c6e-90aa-7df7229f16c1' SELECT OrganizationName, VehicleName, Avg(VehicleSpeed) as VehicleSpeed, Avg(AirTemp) as AirTemp, Avg(RoadTemp) as RoadTemp, Avg(EngineTemp) as EngineTemp, Avg(DrySandRate) as DrySandRate, Avg(SandWettingRate) as SandWettingRate FROM #aggregate GROUP BY VehicleName, OrganizationName ORDER BY OrganizationName DROP Table #aggregate By: Chuck Deal - cdeal RE: sql query not returning results 2003-01-29 08:31 You may want to stick that query inside a stored procedure. Then you can be sure that all of the complexity is handled properly (on the db server). Since it looks like you are just trying to return a single resultset, then your problem should clear up.
  8. By: Axel Hallez - ahallez NullPointerException 2003-01-28 23:26 Hello, I have a report which does not differ from other reports that I created, but when I try to use it, I get following Exception: java.lang.NullPointerException at java.io.ObjectInputStream.readFullyInternal(Unknown Source) at java.io.ObjectInputStream.bufferData(Unknown Source) at java.io.ObjectInputStream.readShort(Unknown Source) at java.io.ObjectInputStream.readStreamHeader(Unknown Source) at java.io.ObjectInputStream.<init>(Unknown Source) at dori.jasper.engine.util.JRLoader.loadObject(JRLoader.java:176) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:333) at be.scoreexpress.newReports.Report.createPrint(Report.java:96) Does anybody have an idea of what kind of problem causes this excepion? Thanks in advance, Axel Hallez
  9. By: Kuo Lung Ching - ching_kuo load jasperdesign from xml and compile? 2003-01-28 19:56 Hi... I load jasperdesign from xml and compile. Why can't get .jasper file and export report to pdf and html ??? JasperDesign jdesign=JasperManager.loadXmlDesign("BasicReport.xml"); JasperReport jreport=JasperCompileManager.compileReport(jdesign); Map parameters=new HashMap(); parameters.put("ReportTitle", "Basic JasperReport"); parameters.put("MaxSalary", new Double(25000.00)); JasperPrint jprint=JasperFillManager.fillReport(jreport,parameters,new JREmptyDataSource()); JasperManager.printReportToPdfFile(jprint, "BasicReport.pdf"); JasperExportManager.exportReportToHtmlFile (jprint,"BasicReport.html");
  10. By: Jessica Daniel - jrdorbital using variables with group as reset type 2003-01-28 06:28 Receiving an error when trying to use the system generated count variable for my group. The group the xml file is showing the group has been created, but the compiler is throwing an error. Below is the error, the xml code for the group, and the java code used to create the group. Any help appreciated. Thanks Jessica //compiler error Caused by: orbtrac.server.exception.OrbTracException: Error compiling report c:toolsreports1d8f230a-1c20-11d7-8ca8-db79afc f3fe8.class: Report design not valid : 1. Variable not found : VehicleName_COUNT at orbtrac.server.report.ReportGeneratorBean.buildReportDesign(ReportGeneratorBean.java:1964) at orbtrac.server.report.ReportGeneratorBean.generateReport(ReportGeneratorBean.java:110) at orbtrac.server.report.ReportGeneratorBean.fillReport(ReportGeneratorBean.java:2011) //xml code <group name="VehicleName" isStartNewColumn="false" isStartNewPage="false" isResetPageNumber="false" isReprintHeaderOnEachPage="false" minHeightToStartNewPage="0"> <groupExpression>$F{VehicleName}</groupExpression> - <groupHeader> - <band height="23"> - <line direction="TopDown"> <reportElement positionType="Float" x="0" y="2" width="802" height="0" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> <graphicElement pen="2Point" stretchType="NoStretch" fill="Solid" /> </line> - <textField isStretchWithOverflow="false" evaluationTime="Now" isBlankWhenNull="false" hyperlinkType="None"> <reportElement mode="Opaque" x="0" y="4" width="802" height="18" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> - <textElement textAlignment="Left" lineSpacing="Single"> <font reportFont="Group" /> </textElement> - <textFieldExpression class="java.lang.String"> - <![CDATA[ "Vehicle Name : " + $F{VehicleName} ]]> </textFieldExpression> </textField> </band> </groupHeader> - <groupFooter> - <band height="65"> - <textField isStretchWithOverflow="false" evaluationTime="Now" isBlankWhenNull="false" hyperlinkType="None"> <reportElement mode="Opaque" x="0" y="50" width="842" height="13" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> - <textElement textAlignment="Center" lineSpacing="Single"> <font reportFont="Detail" /> </textElement> - <textFieldExpression class="java.lang.String"> - <![CDATA[ $V{VehicleName_COUNT} + " Total Records in Group " ]]> </textFieldExpression> </textField> </band> </groupFooter> </group> //java code JRDesignExpression expression = new JRDesignExpression(); group = new JRDesignGroup(); band = new JRDesignBand(); //set expression expression.setText("$F{VehicleName}"); expression.setValueClass(java.lang.String.class); expression.setName("VehicleName"); group.setExpression(expression); group.setName("VehicleName"); //create header band band.setHeight(23); //get header band children List groupHeaderChildren = band.getChildren(); //create Title Border line = new JRDesignLine(); line.setWidth(sizeInfo.getWidth() - 40); line.setHeight(0); line.setX(0); line.setY(2); line.setForecolor(color.BLACK); line.setMode(line.MODE_OPAQUE); line.setPen(line.PEN_2_POINT); groupHeaderChildren.add(line); //create the text textField = new JRDesignTextField(); font = new JRDesignFont(); textField.setWidth(sizeInfo.getWidth() - 40); textField.setHeight(18); textField.setX(0); textField.setY(4); font.setReportFont(fonts[3]); textField.setFont(font); textField.setForecolor(color.BLACK); textField.setMode(textField.MODE_OPAQUE); textField.setPositionType(textField.POSITION_TYPE_FIX_RELATIVE_TO_TOP); textField.setTextAlignment(textField.TEXT_ALIGN_LEFT); expression = new JRDesignExpression(); expression.setText(" "Vehicle Name : " + $F{VehicleName}"); expression.setName("VehicleName"); expression.setValueClass(java.lang.String.class); textField.setExpression(expression); groupHeaderChildren.add(textField); group.setGroupHeader(band); //create footer band = new JRDesignBand(); band.setHeight(65); group.setGroupFooter(band); //create group groups = design.getGroupsList(); groups.add(0, group); By: Teodor Danciu - teodord RE: using variables with group as reset type 2003-01-28 06:39 Hi, This is where you got it wrong: //create group groups = design.getGroupsList(); groups.add(0, group); You have to use the JasperDesign.addGroup(JRDesignGroup) method to add groups. Adding them to a list that to previously get from the report design object has no effect. I hope this helps. Teodor By: Jessica Daniel - jrdorbital RE: using variables with group as reset type 2003-01-28 06:54 Thanks, the suggestion worked.
  11. By: Jessica Daniel - jrdorbital using variables with group as reset type 2003-01-28 06:37 Receiving an error when trying to use the system generated count variable for my group. The group the xml file is showing the group has been created, but the compiler is throwing an error. Below is the error, the xml code for the group, and the java code used to create the group. Any help appreciated. Thanks Jessica //compiler error Caused by: orbtrac.server.exception.OrbTracException: Error compiling report c:toolsreports1d8f230a-1c20-11d7-8ca8-db79afc f3fe8.class: Report design not valid : 1. Variable not found : VehicleName_COUNT at orbtrac.server.report.ReportGeneratorBean.buildReportDesign(ReportGeneratorBean.java:1964) at orbtrac.server.report.ReportGeneratorBean.generateReport(ReportGeneratorBean.java:110) at orbtrac.server.report.ReportGeneratorBean.fillReport(ReportGeneratorBean.java:2011) //xml code <group name="VehicleName" isStartNewColumn="false" isStartNewPage="false" isResetPageNumber="false" isReprintHeaderOnEachPage="false" minHeightToStartNewPage="0"> <groupExpression>$F{VehicleName}</groupExpression> - <groupHeader> - <band height="23"> - <line direction="TopDown"> <reportElement positionType="Float" x="0" y="2" width="802" height="0" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> <graphicElement pen="2Point" stretchType="NoStretch" fill="Solid" /> </line> - <textField isStretchWithOverflow="false" evaluationTime="Now" isBlankWhenNull="false" hyperlinkType="None"> <reportElement mode="Opaque" x="0" y="4" width="802" height="18" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> - <textElement textAlignment="Left" lineSpacing="Single"> <font reportFont="Group" /> </textElement> - <textFieldExpression class="java.lang.String"> - <![CDATA[ "Vehicle Name : " + $F{VehicleName} ]]> </textFieldExpression> </textField> </band> </groupHeader> - <groupFooter> - <band height="65"> - <textField isStretchWithOverflow="false" evaluationTime="Now" isBlankWhenNull="false" hyperlinkType="None"> <reportElement mode="Opaque" x="0" y="50" width="842" height="13" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" /> - <textElement textAlignment="Center" lineSpacing="Single"> <font reportFont="Detail" /> </textElement> - <textFieldExpression class="java.lang.String"> - <![CDATA[ $V{VehicleName_COUNT} + " Total Records in Group " ]]> </textFieldExpression> </textField> </band> </groupFooter> </group> //java code JRDesignExpression expression = new JRDesignExpression(); group = new JRDesignGroup(); band = new JRDesignBand(); //set expression expression.setText("$F{VehicleName}"); expression.setValueClass(java.lang.String.class); expression.setName("VehicleName"); group.setExpression(expression); group.setName("VehicleName"); //create header band band.setHeight(23); //get header band children List groupHeaderChildren = band.getChildren(); //create Title Border line = new JRDesignLine(); line.setWidth(sizeInfo.getWidth() - 40); line.setHeight(0); line.setX(0); line.setY(2); line.setForecolor(color.BLACK); line.setMode(line.MODE_OPAQUE); line.setPen(line.PEN_2_POINT); groupHeaderChildren.add(line); //create the text textField = new JRDesignTextField(); font = new JRDesignFont(); textField.setWidth(sizeInfo.getWidth() - 40); textField.setHeight(18); textField.setX(0); textField.setY(4); font.setReportFont(fonts[3]); textField.setFont(font); textField.setForecolor(color.BLACK); textField.setMode(textField.MODE_OPAQUE); textField.setPositionType(textField.POSITION_TYPE_FIX_RELATIVE_TO_TOP); textField.setTextAlignment(textField.TEXT_ALIGN_LEFT); expression = new JRDesignExpression(); expression.setText(" "Vehicle Name : " + $F{VehicleName}"); expression.setName("VehicleName"); expression.setValueClass(java.lang.String.class); textField.setExpression(expression); groupHeaderChildren.add(textField); group.setGroupHeader(band); //create footer band = new JRDesignBand(); band.setHeight(65); group.setGroupFooter(band); //create group groups = design.getGroupsList(); groups.add(0, group);
  12. By: Tom Geyzen - tomgeyzen Complex SQL - Out of memory 2003-01-28 02:34 Hi, I am using the followinf SQL in on of my subreports : SELECT ID, Count(*) AS Total, (SELECT Count(*) AS StandardAccept FROM MyTable T2 WHERE T2.User_Profile = 'standarduser' AND T2.Status = 'OK' AND T2.ID = T1.ID), (SELECT Count(*) AS SuperAccept FROM MyTable T2 WHERE T2.User_Profile = 'superuser' AND T2.Status = 'OK' AND T2.ID = T1.ID), (SELECT Count(*) AS StandardOk FROM MyTable T2 WHERE T2.User_Profile = 'standarduser' AND T2.Status = 'CANCEL' AND T2.ID = T1.ID), (SELECT Count(*) AS SuperOk FROM MyTable T2 WHERE T2.User_Profile = 'superuser' AND T2.Status = 'CANCEL' AND T2.ID = T1.ID), (SELECT Count(*) AS Bypass FROM MyTable T2 WHERE T2.Status = 'BYPASS' AND T2.ID = T1.ID) FROM MyTable AS T1 GROUP BY T1.ID ORDER BY T1.ID This SQL works fine if I use it outside Jasper (returns 3 rows in very little time) but Jasperreports gives me the OutOfMemoryError without any stack trace after about 5 minutes... Any ideas someone ? tia tom By: Chuck Deal - cdeal RE: Complex SQL - Out of memory 2003-01-28 04:56 Perhaps you are suffering from the problem where the subreport keeps crossing a page boundary and refilling. Make sure that the subreport can run on its own. Perhaps try a minimal XML (only the query and enough info to produce a report). This way you can determine if it is the query or the way the report is being rendered. By: Teodor Danciu - teodord RE: Complex SQL - Out of memory 2003-01-28 04:57 Hi, Are you using subreports? Thank you, Teodor By: Tom Geyzen - tomgeyzen RE: Complex SQL - Out of memory 2003-01-28 05:00 yes, in fact this query is in the third subreport, if I change that third subreport into something less complicated all goes fine. The whole of the report easily fits onto one page, the goal of the report is to calculate totals so there is not that much information to display. By: Teodor Danciu - teodord RE: Complex SQL - Out of memory 2003-01-28 05:46 Hi, This is a typical layout problem and the engine cannot warn you beforehand. It cannot anticipate it. One of the subreports either contains too large bands or it is placed too low in the master report band. The engine enters an infinite loop trying to create new pages because probably one of the reports has never enough space on the current page to start layout its own bands. Optimize your reports by reducing the band heights using the split band trick explained in the docs. I hope this helps. Teodor By: Tom Geyzen - tomgeyzen RE: Complex SQL - Out of memory 2003-01-28 05:57 Indeed, that fixed it! Thanks a lot for your help Teodor Tom
  13. By: Julie Bé²µbé­ orlibou ClassNotFoundException and System.setProperty 2003-01-24 07:54 Hi! I have a chart with a scriptlet. I have a web application. Like in the exemple I set my jasper.reports.compile.class.path System.setProperty( "jasper.reports.compile.class.path", context.getRealPath("/WEB-INF/lib/jasperreports.jar") + System.getProperty("path.separator") + context.getRealPath("/WEB-INF/classes/") ); I would like to have a directory report with my chart.xml and my chartScriptlet.class. Is it possible to change "/WEB-INF/classes/" for "/WEB-INF/report" ? I tried this, but when my .class is'nt in "/WEB-INF/classes/", I have java.lang.ClassNotFoundException. Thank! By: Teodor Danciu - teodord RE: ClassNotFoundException and System.setProperty 2003-01-24 08:17 Hi, The /WEB-INF/classes directory is a very special one because the Web server will automatically load the classes placed there when running your Web application. If you place the scriptlet class in other directory, the Web server would not be able to load the class and therefore you get the error. It is like placing one of your servlet classes into some other location. The same thing for the /WEB-INF/lib directory in which you normally place your Web application jar files. I hope this helps. Teodor By: Julie Bé²µbé­ orlibou RE: ClassNotFoundException and System.setProperty 2003-01-27 11:14 I understand. Thank you!
  14. By: Muralidhar bp - pmurli Urgent help 2003-01-27 04:15 Hello, I have developed the application and deployed in weblogic server. When I compile the application, it is not able to create a jasper file. So plzz let me know what is the problem, because it is difficult to debug also. My doubt is whether it is a xml file problem or servlet or built file or .......... Thanx in advance Rgds Murli By: Chuck Deal - cdeal RE: Urgent help 2003-01-27 06:09 You will have to be a bit more specific on how you are attempting to accomplish your task so that someone will be able to find where your problem may be. I will explain my setup and you can decide if it is helpful. In my application environment (webapp) I am able to make a few assumptions: 1. Not using dynamic reports, this means that I can have precomplied .jasper files available. 2. Users prefer PDF output. Therefore, I put all of my .jasper files into a location on the webserver. When a report is requested, I load a separate browser window and (after processing any criteria) call JasperRunManager.runReportToPdf(). This basically fills the report and streams the output back to the window (which is set to receive PDF). In this case I don't require anything but the .jasper file path, HashMap of parameters, and a Connection object. I have had much success in this scenario and there are probably multiple ways to accomplish this same scenario as well. Maybe you could start your search for answers by identifing your working environment's parameters...target audience, static or dymanic reports, target brower, target format, etc. Then works towards those goals. By: Muralidhar bp - pmurli RE: Urgent help 2003-01-27 07:56 Hii, Thanks for the reply, this works fine when not using the dynamic reports, but for my requirment it is a dynamic reports. But the same reports works fine as a standalone. But when I try to deploy in the web, i am getting this error. Is there any thing else which I can try out. Please help me. Thanx in advance Rgds Murli By: Chuck Deal - cdeal RE: Urgent help 2003-01-27 08:19 I think that we can assume that JasperReports creates the .jasper file in the same location as the XML file. If this is the case, verify that your wenbserver will let the application WRITE to this directory. I don't know if there is a setting to allow you to specify where the .jasper files will be written. I had a similar need to write files from my web application and I specifically had to configure iPlanet to allow write access. By: Teodor Danciu - teodord RE: Urgent help 2003-01-27 09:39 Hi, If we are still talking about this error: <Jan 27, 2003 11:59:17 AM IST> <Error> <HTTP> <[WebAppServletContext(6931479,Lis tOfCustomer,/ListOfCustomer)] Servlet failed with Exception java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:375) at java.util.Properties.setProperty(Properties.java:97) at java.lang.System.setProperty(System.java:637) at servlets.ListOfCustomerServlet.service(ListOfCustomerServlet.java:33) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:262) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:198) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe rvletContext.java:2637) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm pl.java:2359) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) > Can we see the line 33 of the ListOfCustomerServlet.java file ? Thank you, Teodor
  15. By: jper - jper Dynamic Header 2003-01-27 02:13 For my report i am print totals sales from Shops that are in the database, so the header would be Shop1 Shop 2 Shop 3 etc. how would i dynamically create theses headers, i may not know how many shops i have. Is this possible, or will i have to change the xml each time a new shop comes around Regards
  16. By: lovish Durbha - lovish sub report on page header 2003-01-22 08:28 I need to show data of a sub report only once in the report at page header. is it possible..........please guide. thanks in advance Lovish By: Teodor Danciu - teodord RE: sub report on page header 2003-01-22 09:25 Hi, You simply place the subreport on the page header an maybe use its <printWhenExpression> to display it only once, on the first page or whatever. If it is about displaying it only on the first page, then you might as wel consider placing it on the title section of the report. For details about how to use subreports, check the supplied "subreport" sample. I hope this helps. Teodor By: lovish Durbha - lovish RE: sub report on page header 2003-01-22 09:45 ur right I need only once.....I tried placing subreport on title but it never finished compiling, then I put it on title and changed the subreport band to details then data is visible but report design goes for a toss......... and what should the "print when expresion " have? Its urgent.............. thanks Lovish By: lovish Durbha - lovish RE: sub report on page header 2003-01-22 09:47 ur right I need only once.....I tried placing subreport on title but it never finished compiling, then I put it on title and changed the subreport band to details then data is visible but report design goes for a toss......... and what should the "print when expresion " have? Its urgent.............. thanks Lovish By: Teodor Danciu - teodord RE: sub report on page header 2003-01-22 09:55 Hi, It would be interesting to see the report compilation error before going to complicate things with the printWhenExpression. However, such an expression should check the PAGE_NUMBER variable like this: <printWhenExpression> new Boolean($V{PAGE_NUMBER}.intValue() == 1) </printWhenExpression> I hope this helps. Teodor By: lovish Durbha - lovish RE: sub report on page header 2003-01-22 10:07 Teodor, unless the subreport is placed in detail band ................subreport is blank. I tried with print when expression aswell thanks Lovish By: lovish Durbha - lovish RE: sub report on page header 2003-01-22 10:22 I was wondering if u have a email to which i can send the report ......it would be easy for u to understand...................never mind if u cannot give. thanks Lovish By: Teodor Danciu - teodord RE: sub report on page header 2003-01-22 23:36 Hi, You can send me the file at this address: teodord@hotmail.com Thank you, Teodor By: Teodor Danciu - teodord RE: sub report on page header 2003-01-26 23:44 Hi, You are no supplying to your report any data source. You are only supplying a parameter called "InvoiceNumber" and I'm not sure what the subreport is supposed to do with it. You have to use either <connectionExpression> or <dataSourceExpresison> tags so that the subreport could iterate on something. Since I see that the subreport does not have an SQL query, I guess it is the <dataSourceExpression> that you nees to pass in to the subreport a custom JRDataSource object. Anyway, if you want a report/subreport to generate something even if there are no records in the data source (null data source in you case), use whenNoDataType="AllSectionsNoDetail". If you do that for your subreport, you can see it is there, but it has no records. I hope this helps. Teodor By: lovish Durbha - lovish RE: sub report on page header 2003-01-23 01:55 thanks teodord for your support. I have sent xml files to your mail please revert back. Lovish
  17. By: Chuck Deal - cdeal JDK 1.2.2 and web app 2003-01-22 13:43 Is anyone running a webserver that uses jdk 1.2.2 and has successfully integrated JasperReports into it (via JSP)? How about reports that contain subreports? I am having a problem where I am getting an java.lang.IllegalMonitorStateException: current thread not owner The last time i got this error was when I compiled a jar with JDK 1.4.1 and deployed it my webserver which is still using JDK 1.2.2. Any thoughts? By: Teodor Danciu - teodord RE: JDK 1.2.2 and web app 2003-01-26 23:30 Hi, If you are running JDK 1.2.2, please recompile the jar files using this JDK version. The supplied jar files are compiled using JDK 1.4.1 and it's true that subreports do not work due to this strange error. Recompiling the source files using the appropriate JDK version seems to solve the issue. Thank you, Teodor
  18. By: Muralidhar bp - pmurli Null Pointer exception 2003-01-26 22:47 Hello, I am deploying the war file in weblogic server and I am getting this error. <Jan 27, 2003 11:59:17 AM IST> <Error> <HTTP> <[WebAppServletContext(6931479,Lis tOfCustomer,/ListOfCustomer)] Servlet failed with Exception java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:375) at java.util.Properties.setProperty(Properties.java:97) at java.lang.System.setProperty(System.java:637) at servlets.ListOfCustomerServlet.service(ListOfCustomerServlet.java:33) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:262) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:198) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe rvletContext.java:2637) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm pl.java:2359) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) > The error indicates that it is throwing null pointer excepton in my servlet class because it is not able to create .jasper file . JRLoader is not able to load the file. Please let me know what would be the error. Is it in the xml file or anything else. Thanx Murli
  19. By: Muralidhar bp - pmurli Do I have to use subreports or not 2003-01-12 04:44 Hi, I have a query like this which reads 2 tables... SELECT TF_PAR_BRANCH_PERSONALIZATION.BRANCH_CODE,TF_PAR_BRANCH_PERSONALIZATION.BRANCH_NAME, COUNT(TF_M_CUSTOMER.CUSTOMER_ID) AS CUSTOMERCOUNT FROM TF_PAR_BRANCH_PERSONALIZATION, TF_M_CUSTOMER WHERE TF_PAR_BRANCH_PERSONALIZATION.BRANCH_CODE=TF_M_CUSTOMER.BRANCH_CODE GROUP BY TF_PAR_BRANCH_PERSONALIZATION.BRANCH_CODE, TF_PAR_BRANCH_PERSONALIZATION.BRANCH_NAME Do I have to use subreports or not The error i am getting is... java.sql.SQLException: Column not found at sun.jdbc.odbc.JdbcOdbcResultSet.findColumn(JdbcOdbcResultSet.java:1790) at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:383) at dori.jasper.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:263) at dori.jasper.engine.fill.JRBaseFiller.next(JRBaseFiller.java:702) at dori.jasper.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:158) at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:457) at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:373) at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:114) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:217) at dori.jasper.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:138) at dori.jasper.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:106) at servlets.ListOfCustomerNumberServlet.service(ListOfCustomerNumberServlet.java:68) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) NESTED BY : dori.jasper.engine.JRException: Unable to get value for field 'CUSTOMER_ID' of class 'java.lang.String' at dori.jasper.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:272) at dori.jasper.engine.fill.JRBaseFiller.next(JRBaseFiller.java:702) at dori.jasper.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:158) at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:457) at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:373) at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:114) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:217) at dori.jasper.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:138) at dori.jasper.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:106) at servlets.ListOfCustomerNumberServlet.service(ListOfCustomerNumberServlet.java:68) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) By: Teodor Danciu - teodord RE: Do I have to use subreports or not 2003-01-25 02:40 Hi, As you can see, you have renamed the CUSTOMER_ID column CUSTOMERCOUNT using an alias in the SELECT. The engine does not find a matching column in the ResultSet for your report field. I hope this helps. Teodor
  20. By: jper - jper XML Design 2003-01-13 02:10 If i genereate the html using a tool such as dreamweaver and convert this html to xml can jasper use this form of xml of does it need to have its own style xml. Would there be a lot of modification to the xml to make it jasper compliant. Just have difficulty desingning a report using the reporting tools. Many thanks By: Teodor Danciu - teodord RE: XML Design 2003-01-25 02:29 Hi, I don't think it worths the effort. Improving existing JasperReports specific GUI tools would be a better approach. Thank you, Teodor
  21. By: Vani - itsme123 NullPointerException- Urgent please help 2003-01-16 18:27 I am using Tomcat 4.0 and getting NullpointerException. Same code works well on commandline. Thanks. java.lang.NullPointerException at org.apache.commons.digester.FactoryCreateRule.getFactory(FactoryCreat eRule.java:246) at org.apache.commons.digester.FactoryCreateRule.begin(FactoryCreateRule .java:172) at org.apache.commons.digester.Digester.startElement(Digester.java:915) at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1371) at org.apache.xerces.validators.common.XMLValidator.callStartElement(XML Validator.java:705) at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumen tScanner.java:1852) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp atch(XMLDocumentScanner.java:1000) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS canner.java:380) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861) at org.apache.commons.digester.Digester.parse(Digester.java:1144) at dori.jasper.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:353) at dori.jasper.engine.xml.JRXmlLoader.load(JRXmlLoader.java:309) at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCom pileManager.java:115) NESTED BY : dori.jasper.engine.JRException: Error at (13, 35: null at dori.jasper.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:357) at dori.jasper.engine.xml.JRXmlLoader.load(JRXmlLoader.java:309) at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCom pileManager.java:115) at com.dialog.avalon.ui.web.report.ReportManager.buildReport(ReportManag er.java:203) at com.dialog.avalon.ui.web.report.ReportServlet.doGet(ReportServlet.jav a:72) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:247) By: Teodor Danciu - teodord RE: NullPointerException- Urgent please help 2003-01-25 01:53 Hi, What version of JasperReports are you using? Thank you, Teodor
  22. By: Arsenio - jaspinoy Problem with the Report Format(Newbie) 2003-01-16 19:18 Hello World! I have a problem figuring out how to get my report working. I am using JRTableModelDataSource as DataSource but i get this error everytime i run my report. java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.commons.beanutils.ConvertUtils.<clinit>(ConvertUtils.java:318) at org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:280) at org.apache.commons.digester.Digester.endElement(Digester.java:757) at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403) at org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1550) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1149) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098) at org.apache.commons.digester.Digester.parse(Digester.java:1170) at dori.jasper.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:353) at dori.jasper.engine.xml.JRXmlLoader.load(JRXmlLoader.java:309) at dori.jasper.engine.JasperManager.loadXmlDesign(JasperManager.java:1016) at ph.edu.smu.Repos.smuSheet.getReport(smuSheet.java:615) at ph.edu.smu.Repos.smuSheet.access$1400(smuSheet.java:35) at ph.edu.smu.Repos.smuSheet$13.actionPerformed(smuSheet.java:463) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1767) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1820) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:258) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:227) at java.awt.Component.processMouseEvent(Component.java:5021) at java.awt.Component.processEvent(Component.java:4818) at java.awt.Container.processEvent(Container.java:1525) at java.awt.Component.dispatchEventImpl(Component.java:3526) at java.awt.Container.dispatchEventImpl(Container.java:1582) at java.awt.Component.dispatchEvent(Component.java:3367) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3359) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3074) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3004) at java.awt.Container.dispatchEventImpl(Container.java:1568) at java.awt.Window.dispatchEventImpl(Window.java:1581) at java.awt.Component.dispatchEvent(Component.java:3367) at java.awt.EventQueue.dispatchEvent(EventQueue.java:445) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:191) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130) at java.awt.EventDispatchThread.run(EventDispatchThread.java:98) org.xml.sax.SAXParseException: Error at (13, 26: org/apache/commons/logging/LogFactory at org.apache.commons.digester.Digester.createSAXException(Digester.java:1766) at org.apache.commons.digester.Digester.createSAXException(Digester.java:1795) at org.apache.commons.digester.Digester.endElement(Digester.java:763) at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403) at org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1550) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1149) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)........... I guess i have a problem the way i format my report in my XML file. Could anyone in the forum show me the right way. Below is my XML file. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="BasicReport" > <field name="ID" class="java.lang.String"> <field name="Last" class="java.lang.String"> <field name="First" class="java.lang.String"> <detail> <band height="20"> <textField> <textFieldExpression class="java.lang.String"> $F{ID} </textFieldExpression> </textField> <textField> <textFieldExpression class="java.lang.String"> $F{Last} </textFieldExpression> </textField> <textField> <textFieldExpression class="java.lang.String"> $F{First} </textFieldExpression> </textField> </band> </detail> </jasperReport> Thanks a lot! Arsenio By: Teodor Danciu - teodord RE: Problem with the Report Format(Newbie) 2003-01-25 01:37 Hi, Add Jakarta Commons Logging Library to your classpath. Same location as the other libraries that JasperReports uses. You can download it from here: http://jakarta.apache.org/commons/logging.html I hope this helps. Teodor
  23. By: Igor Karp - ikarp using KOI8-R or Cp1251 encoding 2002-12-11 03:30 Have anyone been successfull in using KOI8-R or Cp1251 encoding within jasperreports. I have problem trying to display static text using these encodings. Thanks. By: Oleg - oleg_vn RE: using KOI8-R or Cp1251 encoding 2002-12-12 03:48 JasprerReport 0.4.3 мог компилировать файлы в юникоде 0.4.4 почему-то разучился. Попробуй найти редактор, который работает с юникодом, и используй 0.4.3. У меня все работает. Олег By: Oleg - oleg_vn RE: using KOI8-R or Cp1251 encoding 2002-12-12 04:10 Sorry, You can use JasperReport 0.4.3 and write report in unicode. Oleg By: Oleg - oleg_vn RE: using KOI8-R or Cp1251 encoding 2002-12-12 07:51 JasprerReport 0.4.3 мог компилировать файлы в юникоде 0.4.4 почему-то разучился. Попробуй найти редактор, который работает с юникодом, и используй 0.4.3. У меня все работает. Олег By: Bazhenov PAvel - pvb RE: using KOI8-R or Cp1251 encoding 2003-01-18 02:37 What is object send messages like "Character conversion error: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (line number may be too low)." or "Declared encoding "UTF-8" does not match actual one "UTF8"; this might not be an error." (I try System.setProperty("file.encoding","windows-1251") or other non-UTF-8 encodings in application under jboss version 3.0.3) ? By: Teodor Danciu - teodord RE: using KOI8-R or Cp1251 encoding 2003-01-25 01:26 Hi, Try to specify the XML file encoding using the "encoding" attribute in the XML file header. You might also have to try this patch, if you are using the 0.4.4 version: http://sourceforge.net/tracker/index.php?func=detail&aid=663125&group_id=36382&atid=416705 I hope this helps. Teodor
  24. By: lovish Durbha - lovish tmp files while creating reports 2003-01-20 01:20 I was wondering if its possible to generate reports with out any tmp files, my reports are to be compiled and viewed on web dynamically ????. Lovish By: Teodor Danciu - teodord RE: tmp files while creating reports 2003-01-25 01:20 Hi, For the moment, this is not possible because the report compilation process actually compiles a java source file along the way. In the future, using BeanShell or other libraries like this, that allow runtime execution of Java code, we should be able to avoid source file compilation. Thank you, Teodor
  25. By: Neil H - neilhay Datasource Issue 2003-01-20 16:34 I am playing around with Datasource example. I created my own XML file and created a CustomerData class exactly the same way in example. When i try to generate a file, report comes back as blank. How does Jasper XML files knows that we are passing datasource? is there any tag that i missing ? Thanks for help! By: Teodor Danciu - teodord RE: Datasource Issue 2003-01-25 01:13 Hi, It knows because when you call the "fill" method, you supply a JRDataSource instance, instead of a Connection object. Don't you? I hope this helps. Teodor
×
×
  • Create New...