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

ktrinad

Members
  • Posts

    1,134
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by ktrinad

  1. By: Dmitry Beransky - dberansky packaging multiple reports into a single pdf 2004-03-25 09:57 we are using jasperreports to generate monthly reports for 20+ departments in our organization. Each department gets to have 3 different reports. We would like those 3 reports to be packaged within a single PDF file. What's the best way to approach this? Can this be done with JR? If not, which PDF library should I be using alongside JR? By: Chuck Deal - cdeal RE: packaging multiple reports into a single pdf 2004-03-25 10:18 As I understand it, iText (the PDF library used by JasperReports) has a concat utility. However, I use a patch for JR that allows you to export all your reports in one PDF. The general idea is that each report is filled on its own and then the PDFBatchExporter (part of the patch) generates one file PDF from all of the filled reports supplied. Works like a champ. By: Dmitry Beransky - dberansky RE: packaging multiple reports into a single pdf 2004-03-25 10:51 I can't find any info on PDFBatchExporter. Is that a publicly available patch? By: Chuck Deal - cdeal RE: packaging multiple reports into a single pdf 2004-03-25 11:08 Here is the patch: https://sourceforge.net/tracker/index.php?func=detail&aid=779751&group_id=36382&atid=416705
  2. By: Claudio Pi - claudiopi jCV released - A JasperReports powered app. 2004-03-24 09:58 Hi JasperReports community ! I'm pleased to announce the first release of jCV. Following is a brief description of jCV, for more detailed information, screenshots and a sample PDF report you are welcomed to visit http://jcv.sourceforge.net. jCV is a powerful multilingual J2EE web application designed for the creation and administration of resumes. jCV is 100% developed in Java using "best-of-breed" Open Source J2EE frameworks (SOFIA) and reporting tools (JasperReports, iReport). Release 1.0 includes: - Resume creation wizard: 10 different sections included to structure your resume in a clean way). - Exporting to a well structured PDF format. - Sharing of common information: Information such as names of companies, institutions, skill areas, and skills are shared among all resumes to provide standardization. - Resume search engine: search for keywords in any resume section and export the resulting resumes to PDF. - Administrator interface: mantain shared information and give access to other administrators. - i18n (English and Spanish frontends). Tested configurations: - Servlet Container: Tomcat 4.1.24, 4.1.30, 5.0.x - Databases: MySQL 4.0.x, 3.23.x, 5.x. - Web Browser: IE 5.0, IE 6.0, Netscape 7.1, Opera 7.23 You can download source and binaries versions of jCV at http://sourceforge.net/project/showfiles.php?group_id=101903 I hope you find this application, useful for your company or personal use. Let me know your comments and suggestions about jCV. Regards, Claudio. PS: 1. I'm currently seeking for developers interested in joining the development of jCV. If you are interested please contact me. 2. Is there a powered by logo of jasperreports that I can include in my next release ? By: Teodor Danciu - teodord RE: jCV released - A JasperReports powered ap 2004-03-24 13:49 Welcome to the JasperReports community! Since you asked, there is now such a logo available here: http://jasperreports.sourceforge.net/powered.by.jasperreports.gif I hope you like it. Thank you, Teodor By: Teodor Danciu - teodord RE: jCV released - A JasperReports powered ap 2004-03-25 01:57 Hi, This one is a little cleaner: http://jasperreports.sourceforge.net/powered.by.jasperreports.png Thank you, Teodor By: Claudio Pi - claudiopi RE: jCV released - A JasperReports powered app. 2004-03-25 03:38 Thanks Teodor for the logo ! I would include it in the next release of jCV. Claudio
  3. By: Jason Henriksen - drake42 CSV and XLS patch now available for download 2002-07-10 09:23 I just posted the patch that allows jasper to output these formats. I originally added the patch, but didn't notice that it didn't like the file size. Now you'll have to download a couple of jars to get the patch to work, but they're easy to find. Let me know what you think, Drake42 By: Jason Henriksen - drake42 RE: CSV and XLS patch now available for downl 2002-07-11 09:04 There is a weird column thing that jasper supports that the printer doesn't support well. If you have two grids of data, each in a seperate report column, the spacing will be weird. I highly encourage you to use one grid of data per page width if you need to go to XLS. The reason for this is that Jasper only gives me the exact pixel location of each text element. So if I have an element at y=10, y=12 and y=11 event thought they would appear to be on the same row, the printer can't be certain. I divide the pixel location by 10 to get the cell location (and checking to ensure that I will never write over data in the process) However, rounding errors introduced by this technique make two grids on the same page look weird. I can't cull out empty spaces vertically because that might mess up other spacing within the grid. I really encourage you to try the printer on one-grid per page report and see what you think. Jason By: mannu - mannu RE: CSV and XLS patch now available for downl 2004-03-25 03:31 hey drake42 you had posted a message for on 2002-07-10 16:23 for jasperreports patch to allow export to xls for files with large size , I am looking for those,con you provide me those.
  4. By: Jan Dieckmann - jandieck Have defaults for the x-coordinate 2004-03-24 04:18 Sometimes I would like to have as a possible default behavior of Jasper the following: I like to define only the width and the order of the header fields in the xml file. Jasper should then calculate the x coordinates of the header field and use the same values (width and x-coordinate) for the data fields in the detail band. Is there something I was missing or is this a kind of a feature request? regards Jan By: Teodor Danciu - teodord RE: Have defaults for the x-coordinate 2004-03-24 13:54 Hi, I don't see this being added to the library soon. It is more like a wizard that could be introduced in one of the GUI tools available. If not, I think that is the responsability of the parent application that uses JasperReports to add such a custom layer. Thank you, Teodor By: David Lim - aberrant80 RE: Have defaults for the x-coordinate 2004-03-24 17:52 I would like that too. My workaround was to either get the user to specify the width in percentages, or to estimate the width based on the font size.
  5. By: Mohamed - maewonline Sub-report Problem 2004-03-24 03:02 How i can pass a data source to a subreport different from the datasource passed to the Master Report?? By: Gregory A. Swarthout - gswarthout RE: Sub-report Problem 2004-03-24 08:54 We do it by passing a JRDataSource as a parameter to the Master Report and the pass it to the subreport like this: <subreport isUsingCache="false"> <reportElement x="0" y="260" width="720" height="130" backcolor="#FFCC99" isPrintRepeatedValues="false" isPrintWhenDetailOverflows="false" isRemoveLineWhenBlank="false"/> <parametersMapExpression> $P{REPORT_PARAMETERS_MAP} </parametersMapExpression> <dataSourceExpression> $P{REPORT_PARAMETERS_MAP}.get("clientHistoryDataSource") </dataSourceExpression> <subreportExpression> $P{REPORT_PARAMETERS_MAP}.get("clientHistoryJasperReport") </subreportExpression> </subreport>
  6. By: Samanth Athrey - samanth_athrey QueryString 2002-04-08 23:19 Hi, Is it possible for me to call a stored procedure instead of directly passing the SQL query?? thanx in advance sva By: Samanth Athrey - samanth_athrey RE: QueryString - solved it 2002-04-09 04:39 Hi All, I just did some tweeking and to my luck, it worked. I don't know if i did the right thing. in the queryString tag just pass the stored procedure name and if it accepts any parameters, pass in brackets ([]).. u have the report working ;) thanx sva By: Outey Ky - chhunak RE: HOW? - QueryString - solved it - HOW? 2002-11-01 11:39 What is being returned as the OUPUT???? Is it a SQL statement that is built by the Stored Procedure, or as in the case of PL/SQL (Oracle) is a set of OUT parameters that represent the fields (Columns of data being returned) of data being returned???? Our stored procedures accept x number of IN parameters & return Y number of OUT parameters (resultant fields of data as table types (arrays of data)) What would the syntax look like in the QueryString tag? Thanx - Your reply would be MOST appreciated!!! By: Sri - annesrinivas RE: HOW? - QueryString - solved it - HOW? 2004-03-24 02:31 Just wondering if anyone managed to figure out how we could handle a stored proc returning OUT parameters ..... Thanks in advance. By: Outey Ky - chhunak RE: HOW? - QueryString - HOW? 2002-11-01 12:22 Here is our Query string: <queryString><![CDATA[ exec GEDIT_FSR_REPORTPKG(423,TO_DATE('29-Sep-1989','dd-mon-yyyy'),TO_DATE('29-Sep-2002','dd-mon-yyyy'),?,?,?,?,?,?,?,?,?,?,?,?,?) ]]></queryString> <field name="t_fsrprotonum" class="java.lang.String"/> <field name="t_fsrrptnum" class="java.lang.String"/> <field name="t_fsrtitle" class="java.lang.String"/> <field name="t_fsrdate" class="java.sql.Timestamp"/> <field name="t_datesent" class="java.sql.Timestamp"/> <field name="t_fileloc" class="java.lang.String"/> <field name="t_submnum" class="java.lang.String"/> <field name="t_indiccode" class="java.lang.String"/> <field name="t_indictext" class="java.lang.String"/> <field name="t_compnum" class="java.lang.String"/> <field name="t_compname" class="java.lang.String"/> <field name="t_apptype" class="java.lang.String"/> <field name="t_serialnum" class="java.lang.String"/> By: Outey Ky - chhunak RE: HOW? - QueryString - HOW? 2002-11-01 15:37 Here is our Query string: <queryString><![CDATA[ exec GEDIT_FSR_REPORTPKG(423,TO_DATE('29-Sep-1989','dd-mon-yyyy'),TO_DATE('29-Sep-2002','dd-mon-yyyy'),?,?,?,?,?,?,?,?,?,?,?,?,?) ]]></queryString> <field name="t_fsrprotonum" class="java.lang.String"/> <field name="t_fsrrptnum" class="java.lang.String"/> <field name="t_fsrtitle" class="java.lang.String"/> <field name="t_fsrdate" class="java.sql.Timestamp"/> <field name="t_datesent" class="java.sql.Timestamp"/> <field name="t_fileloc" class="java.lang.String"/> <field name="t_submnum" class="java.lang.String"/> <field name="t_indiccode" class="java.lang.String"/> <field name="t_indictext" class="java.lang.String"/> <field name="t_compnum" class="java.lang.String"/> <field name="t_compname" class="java.lang.String"/> <field name="t_apptype" class="java.lang.String"/> <field name="t_serialnum" class="java.lang.String"/> By: Teodor Danciu - teodord RE: HOW? - QueryString - HOW? 2002-11-03 12:21 Hi, Unfortunately, JasperReports is not yet specialized in executing stored procedures as SQL queries. It ca do that only with simple stored procedures that return result set and do not have OUT parameters. This type of stored procedure can be called using a PreparedStatement object, like JasperReports always does. However, stored procedures should be called using CallableStatement objects, in order to be able to register OUT parameters. JasperReports does not support them yet. This would probably be my next target. Until then, the only way around the problem is to execute the JDBC call outside JasperReports, because the default SQL query executor of the library cannot handle such JDBC calls yet. You could still put the SQL query in the report design, but you should manually load the JasperReport object and get the query text and execute it yourself in your application. Then you could wrap the return array of data into a custom JRDataSource before passing it to the report filling routines. I hope this helps. Teodor By: Outey Ky - chhunak RE: QueryString 2002-11-04 07:03 Hi, Actually, I didn't quite understand your last paragraph(forgive me). What do you mean by manually load the JasperReport object, and wrap the return array of data into a custom JRDataSource before passing it to the report filling routines. Thank you. By: Teodor Danciu - teodord RE: QueryString 2002-11-04 13:03 Hi, Explaining all this in detail would be equivalent to rewriting the "ultimate guide" on this forum. Anyway, manually loading means using the dori.jasper.engine.util.JRLoader class to load dori.jasper.engine.JasperReport objects. Wrapping the array into a data source means using a custom made implementation of the dori.jasper.engine.JRDataSource interface in order for engine to use this data when filling the report. Check the "datasource" sample to see how the library's implementations of this interface are used. I hope this helps. Teodor By: Outey Ky - chhunak RE: QueryString 2002-11-04 13:24 Thank you, I understand.
  7. By: Francisco Figueiredo Jr. - fxjr PDF field data not showing on windows :( 2004-03-23 04:27 Hi all, I'm having some problems showing my data from database in a pdf generated by jasperreports on windows. On GNU/Linux, it works perfectly, but on windows, only static text can be shown. I think this may be related to encoding on windows, but I'm using the default iReport values, cp1252 encoding and Helvetica font name. Am I missing something? Is there something else I can do to have the fileds appearing? I'm using jasperreports 0.5.1 Thanks in advance By: Chuck Deal - cdeal RE: PDF field data not showing on windows :( 2004-03-23 04:58 It could be a font SIZE problem. try decreasing the font size or increasing the size of one of your text elements. By: Francisco Figueiredo Jr. - fxjr RE: PDF field data not showing on windows :( 2004-03-23 07:21 Thanks very much Chuck Deal!!! It worked like a charm! I just reduced my font size from 12 to 11 and it appeared! :) I will modify the text field to be a little bigger so I can continue using font size 12 :) JasperReports is great!! :) Thanks guys.
  8. By: pirunporn - pirunporn Problem !!! JRDefaultScriptlet not found 2004-03-23 00:29 I have a serious problem when call fill report. this error show:(don 't new subclass that extends JRDefaultScriptlet but can new JRdefaultScriptlet() under the same environment) 2004-03-23 15:06:48 - Ctx( /TBDC ): Exception in: R( /TBDC + /BNTR007/bntr007.jsp + null) - javax.servlet.ServletException: dori/jasper/engine/JRDefaultScriptlet at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:508) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:479) Root cause: java.lang.NoClassDefFoundError: dori/jasper/engine/JRDefaultScriptlet
  9. By: Adeline Ng - adeline_ng Including chart in JasperReport 2002-08-25 21:13 Anybody tried to include a chart in JasperReport? I'm trying to do so, but have problem creating the chart using real data from a datasource. Please help. Thanks in advance! :) By: Adeline Ng - adeline_ng RE: Including chart in JasperReport 2002-08-29 01:09 Thank you for your reply. I can gather the data. The problem is building it. I place the image element in <summary> block, so that it will be evaluate only at the end of the report. (I assume this is the same as setting the evaluationTime="Report" for image element.) I have a method in the scriptlet class that will build the chart, I tried to call the method from my xml file, but I got errors when I compile the xml file. Following is the part of code where I call the method. <imageExpression class="java.awt.Image"> com.enmeta.carwash.report.scriptlet.ChartScriptlet.createChart() </imageExpression> The createChart() method returns a BufferedImage object. Can you please tell me what's wrong with my code? Thanks a lot! Adeline By: Teodor Danciu - teodord RE: Including chart in JasperReport 2002-08-29 05:04 Hi, Make sure the createChart() method is static, otherwise you have to instantiate yourself the ChartScriptlet in the image expression. Also, check the classpath to ensure that the ChartScriptlet class is in the classpath when you compile the report. Could you post the exact exception that you got? I think you need a reference to the scriptlet object instantiated by the report engine when filling the report. This is a great idea!!! I'll probably introduce a new default parameter called REPORT_SCRIPTLET. This is very easy to do and I think will be very useful. Thank you, Teodor By: Adeline Ng - adeline_ng RE: New method vs new parameter 2002-09-02 08:40 Hi, Thanks for your reply. I have no problem compiling the report xml after I instantiate the ChartScriptlet in the image expression. But as you said, I need the reference to the scriptlet object instantiated when filling the report. Otherwise, like what I get now it will just create a blank report. I think there is no easy and straight forward way to get the reference to the instantiated scriptlet object right now. I assume the new default parameter you say you might going to create is to provide a way to get the scriptlet object. After thinking about all the possible way to do the chart, I still think that if there is a method like endOfReport() in the chartscriptlet class that will be triggered when the report reach the end, that will be easiest. What do you think? Do you think that intorducing the parameter REPORT_SCRIPTLET is easier to do and more usefull? Thank you, Adeline By: Teodor Danciu - teodord RE: New method vs new parameter 2002-09-02 23:24 Hi, The introduction of the REPORT_SCRIPTLET is already done for the next version. It required only a few lines of code. I'll study this endOfReport callback issue. Thank you, Teodor By: Adeline Ng - adeline_ng RE: 2002-09-06 02:03 Hi Teodor, Thanks for your reply, looking forward to the next JasperReport release. :-) Adeline By: Teodor Danciu - teodord RE: 2002-09-06 02:17 Hi, The 0.4.0 version with the default REPORT_SCRIPTLET parameter is now available. Thank you, Teodor By: Lars Kristensen - llk RE: Including chart in JasperReport 2003-11-06 01:00 Hi, This is not a classpath problem, it's a parsing problem. The class type 'dori.jasper.util.Renderable' is not allowed. If you look in the jasperreport.dtd (srcdorijasperenginedtds) you can find a definition for the imageExpression tag (ver. 0.5.0): <!ELEMENT imageExpression (#PCDATA)> <!ATTLIST imageExpression class (java.lang.String | java.io.File | java.net.URL | java.io.InputStream | java.awt.Image) "java.lang.String" > Here you can see the allowed values for the class attribute. If you wish to include a chart of type 'dori.jasper.util.Renderable' try the patch: [ 745617 ] Vector graphics (inc. chart) support http://sourceforge.net/tracker/index.php?func=detail&aid=745617&group_id=36382&atid=416705 After including this patch your new dtd will look like this: <!ELEMENT imageExpression (#PCDATA)> <!ATTLIST imageExpression class (java.lang.String | java.io.File | java.net.URL | java.io.InputStream | java.awt.Image | java.awt.Component | dori.jasper.util.Renderable) "java.lang.String" > If you wish to use this patch let me know you need a few minor corrections. Lars By: Arumugam - arumugam RE: Including chart in JasperReport 2003-11-07 10:21 Yes, I need to use the patch. Infact, I had already downloaded the patch and compiled it, by changing the import statement for the Drawable obj (referring to org.jfree.ui.Drawable) from the jcommon jar. Is this the correction, you are talking about? If so, I did that already and compiled the patch classes and included in my application classpath. I think, the dtd is the problem. How do I fix that? Do i need to generate the dtd by any other means or I can simply modify it manually. While waiting for your reply, let me try changing it manually and try it out. Please help me immediately, as I am stuck with this. Thanks -Aru By: Lars Kristensen - llk RE: Including chart in JasperReport 2003-11-10 01:20 The import statement change is one of the changes if you wish to use the patch with a newer version of JFreeChart. The patch is for JasperReports ver. 0.4.6 and a rather old version of JFreeChart. The latest version of JFreeChart can be used if you change an import statement as you mention. If you wish to use the patch with the latest version of JasperReports (0.5.0) you can't follow the recipe mentioned in the patch and simply copy the patch. You need to carefully look at the differences between version 0.4.6 and 0.5.0 and merge the patch with version 0.5.0. I have tried this and it seems to work - no problems yet.. If you have any problems with this you can post your email and I will mail you the source code. The dtd should be no problem - just merge the two dtd's. I had problems including simple bitmaps and AWT's - the patch seemed to crash the application (java.lang.NullPointerException). Adrian (who made the patch) suggested the following change to avoid this: Change line 1034 in the JRPdfExporter.java file from: printImage.getImageRenderer().render(g2, rect); to: Renderable imRenderer = printImage.getImageRenderer(); if (imRenderer != null) { imRenderer.render(g2, rect); } this requires an extra import statement: import dori.jasper.util.Renderable; This will remove the crash and everything seems to work as without the patch. Another minor problem exist in JRHtmlExporter.java: line 1146: new Rectangle2D.Float( 0, 0, image.getHeight(), image.getWidth() ) ); The order of image.getHeight() and image.getWidth() is wrong should have been: new Rectangle2D.Float( 0, 0, image.getWidth(), image.getHeight() ) ); Finally when you fill the report don't fill the report to a file or you will get a java.io.NotSerializableException. The JCommon Drawable interface isn't serializable. Do something like this (just an example) to generate a pdf file: JasperDesign jasperDesign = JRXmlLoader.load("docs/Example.xml"); JasperReport jasperReport = JasperManager.compileReport(jasperDesign); JasperPrint jasperPrint = JasperManager.fillReport(jasperReport, parameters, new DataSource(conn)); JRPdfExporter pdfExporter = new JRPdfExporter(); pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); pdfExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "docs/example.pdf"); pdfExporter.exportReport(); I had a bit of trouble making the patch work myself. But it's differently worth it!. Vector Charts looks so much better :-) Hope this helps. Lars By: Arumugam - arumugam RE: Including chart in JasperReport 2003-11-12 11:37 Just by changing the dtd alone, I got my stuff working. I was able to create pie/bar charts and export it in Pdf and Html format. Still, I havent implemented the patch you suggested. I am using jasperreports-0.5.0. May be it is already fixed in it. Anyways, I will look into it, if not I will follow your suggestion. Thanks. I now have problem in exporting it to CSV format. I dont see anything in the excel sheet. Any clues.... Also, for the bar and pie charts, do you know how to set colors for different bars or pies. The default RED seems to be so BRIGHT :( Thanks -Aru By: Teodor Danciu - teodord RE: Including chart in JasperReport 2003-11-18 23:39 Hi, Images do not appera in XLS format because POI does not support them. Also, POI has a limited number of colors: http://jasperreports.sourceforge.net/tips.tricks.html#excel Thank you, Teodor By: Teodor Danciu - teodord RE: Including chart in JasperReport 2002-08-27 02:24 Hi, There are two issues here: 1) gather the data; 2) build the chart and display it. In order to gather the data, the best solution is to use scriptlets. They allow you to gather the data in custom data structures while the engine iterates through the data source of the report. I have to admit there is no way to know when the report ends, from the scriptlets perspective. There is no particular scriptlet callback for that. However, if you need to display a chart that is generated only after the report reaches the last row of data, you use the attribute evaluationTime="Report" for your image element containing the chart. In the corresponding expression of this image element, you make sure you're calling the code sequence that produces the chart from the data already gathered using scriptlets. Note that you can use in report expression any class, if it is available in the classpath of your application and you reference it using the complete name (package included). Thus, you can use the chart generating classes directly in the image expression after the data is ready. I hope this helps. Teodor By: Pattraporn - plain_text RE: Including chart in JasperReport 2004-01-06 01:27 Hi, I can complie ChartReport into .jasper But I can not Fill it and Export to PDF Format. I got an exception like this: "Error Creating Scriptlet Class Instance:Chart Scriptlet" What did I do wrong? Thanks :) By: Arumugam - arumugam RE: Including chart in JasperReport 2003-11-05 16:03 Teodor, u said we can use any class in the expression. But, when I tried to use "dori.jasper.util.Renderable", I am getting the foll error.... JasperReports encountered this error : org.xml.sax.SAXParseException: Attribute "class" with value "dori.jasper.util.Renderable" must have a value from the list "java.lang.String java.io.File java.net.URL java.io.InputStream java.awt.Image ". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) I do have the required class in the classpath of my application. I am sorry, if u feel that I am deviating this thread. As I got some answer for my question in this thread, I used this. Thanks -Aru By: SCB - cardsapp RE: Including chart in JasperReport 2004-03-21 23:58 Hi , I have a scriptlet class, which will get data from the database and will form a pie chart, i have another standalone application jasperreport application, which will export the data to excel. When i perform the export, I am not getting any errors and export is successful, but the pie chart is not getting exported and it is a blank excel or html or csv sheet. Where i am going wrong and also how to generate the jrprint file out of the xml ?? By: Nitin Umranikar - login144 Calling user defined class methods. 2004-01-07 01:27 Hi all, What if you want to call a static method m() from a class C.The following expression gives error.Assume that method returns a String object,and classpath is correct. <textFieldExpression class="java.lang.String"> C.m() </textFieldExpression> In short what's the rule of calling user defined classes in jasper expressions(apart from classpath) Thanks By: Teodor Danciu - teodord RE: Calling user defined class methods. 2004-01-07 01:31 Hi, Use the fully qualified name of the class (including the package). I hope this helps. Teodor By: Jothikumar - kbmkumar RE: Including chart in JasperReport 2004-03-22 04:11 Hi, I am just starting to use charts in my reports ( i cannot find much abt how to use and fill data in charts).In the Report design part using (iReports) I placed image<data type> instead of placing it with charts. And by using JfreeChart Api's i created charts myself and added as a BufferedImage over there.I am not using scriptlets and dynamically building charts. Before calling the jasper Api to fill the report i get the data from database and generate charts (as BufferedImages) and send it to the jasper reports as parameters.Will there be any performance overhead due to this approach ?. If this is bad,Can anybody guide me how to use the charts (in a series of steps) Thanks JK
  10. By: Preethi N - preethin Problem In ReportFont 2004-03-22 03:59 Hello, I am creating the jasperreport programmatically I have defined 3 or 4 reportFonts. But when I use the any of these reportFonts, it is using the normalFont.I mean to say that eventhough the reportFont size if 12 and isBold, still it prints with the normal size and without Bold. Here is the code. These are the reportFonts : JRDesignReportFont normalFont = new JRDesignReportFont(); normalFont.setName("Arial_Normal"); normalFont.setDefault(false); normalFont.setFontName("Arial"); normalFont.setSize(8); normalFont.setPdfFontName("Helvetica"); normalFont.setPdfEncoding("Cp1252"); normalFont.setPdfEmbedded(false); jasperDesign.addFont(normalFont); JRDesignReportFont boldFont = new JRDesignReportFont(); boldFont.setName("Arial_Bold"); boldFont.setDefault(false); boldFont.setFontName("Arial"); boldFont.setSize(8); boldFont.setBold(true); boldFont.setPdfFontName("Helvetica-Bold"); boldFont.setPdfEncoding("Cp1252"); boldFont.setPdfEmbedded(false); jasperDesign.addFont(boldFont); JRDesignReportFont bigBoldFont = new JRDesignReportFont(); boldFont.setName("Arial_Big_Bold"); boldFont.setDefault(false); boldFont.setFontName("Arial"); boldFont.setSize(12); boldFont.setBold(true); boldFont.setPdfFontName("Helvetica-Bold"); boldFont.setPdfEncoding("Cp1252"); boldFont.setPdfEmbedded(false); jasperDesign.addFont(bigBoldFont); JRDesignReportFont italicFont = new JRDesignReportFont(); italicFont.setName("Arial_Big_Normal"); italicFont.setDefault(false); italicFont.setFontName("Arial"); italicFont.setSize(10); italicFont.setBold(false); italicFont.setPdfFontName("Helvetica"); italicFont.setPdfEncoding("Cp1252"); italicFont.setPdfEmbedded(false); jasperDesign.addFont(italicFont); This is how I use it - JRDesignTextField textField = new JRDesignTextField(); textField.setX(0); textField.setY(0); textField.setWidth(500); textField.setHeight(15); textField.setTextAlignment(JRTextElement.TEXT_ALIGN_CENTER); textField.setFont(bigBoldFont); JRDesignExpression expression = new JRDesignExpression(); expression = new JRDesignExpression(); expression.setValueClass(java.lang.String.class); expression.setText("$P{printtexthandler}.getValue("report_title_1")"); textField.setExpression(expression); band.addElement(textField); textField = new JRDesignTextField(); textField.setX(0); textField.setY(15); textField.setWidth(500); textField.setHeight(15); textField.setTextAlignment(JRTextElement.TEXT_ALIGN_CENTER); textField.setFont(bigBoldFont); expression = new JRDesignExpression(); expression = new JRDesignExpression(); expression.setValueClass(java.lang.String.class); expression.setText("$P{printtexthandler}.getValue("report_title_2")"); textField.setExpression(expression); band.addElement(textField); Where did I go wrong?Plz help me out.
  11. By: karuppaiah kailasam - karupg How do i a build query at runtime using param 2004-03-17 22:18 Is there any way of checking the parameters and build a run time query using the parameters for example select * from address is the simple query and i have the following parameters city_param name_param select * from address where city = $P{city_param} and name = $P{name_param} here, how do i check if city_param is null or empty value .. and if it is empty i want to ignore the city_param like select * from address where name = $P{name_param} is it possible to do this ? By: David Lim - aberrant80 RE: How do i a build query at runtime using p 2004-03-17 23:23 If you want it so complex, why don't you generate the SQL query first, then load the .jasper file, and set the query, before filling the data. By: Travis Hoffman - travis_stc RE: How do i a build query at runtime using p 2004-03-18 10:29 Alternatively, you can just make the parameter encapsulate more of the query: SELECT * FROM address WHERE city = $P!{city_param} $P!{name_param} Of course, that doesn't work well if it's possible that neither are provided. But then, you could do: SELECT * FROM address $P!{where_clause} and simply pass in 'WHERE city = 'foo' AND name = 'bar'' as the where_clause... Hope that helps! -Travis By: karuppaiah kailasam - karupg RE: How do i a build query at runtime using param 2004-03-18 14:51 sorry, i should have mentioned that i need to use the jasper (the compiled jasper designer file) in openreports if i just use jasper (embed with my application) then i can follow the above tips ! the problem i have is, openreport loads the jasper file and allows as to pass some parametes if anything required to generate reports using the jasper file, so i don't get chance to check or validate the parameters passed through openreports .. passing the full where class sounds good, but again if i look at from the end-user point of view, the end-user needs some skills/understanding of SQL !! Thanks karup. By: Chuck Deal - cdeal RE: How do i a build query at runtime using param 2004-03-19 05:57 Perhaps you should investigate Scriptlets or a Custom DataSource
  12. By: Simon Ouellet - souellet Newbie Question 2004-02-19 08:50 Through a servlet, I'm trying to dynamically generate a pdf file containing 3 different reports. My question is the following: Is it possible to merge Jasper reports? I mean could I put many reports in the .xml file or in the .jasper file? I know the easiest would be to generate as many pdf files that I need then merge the files but as there will be many users accessing to the report at the same time, it's not option... Thanks for helping! By: Vincent Hikida - vhikida RE: Newbie Question 2004-02-27 08:54 Hi I've created several different reports in one report using subreports. If you want I can post the code perhaps over the weekend if I have time. By: Simon Ouellet - souellet RE: Newbie Question 2004-03-19 05:33 Thanks! That would helps a lot!
  13. By: lemon - lemonz support shape and Graphics at xls format 2004-03-18 19:42 Hi, Teodor the POI2.5 was released and it can support shape and graphics at xls, I hope jasperreport can support shape and graphics in xls report at next version. regards Lemon
  14. By: jonathan - jonathan78wong Hello ! How to display Chinese datasource ? 2004-03-16 08:14 Dear All , I can display the Chinese static content at JasperReport . However , the Chinese data from the database can't be display properly . How can I solve this ? Thank you ! Jonathan By: lemon - lemonz RE: Hello ! How to display Chinese datasource ? 2004-03-18 18:50 Hi, we need convert the chinese charator to unicode, if we store the chinese data at datasoure in GB2312 or Big5, i alway store the chinese data in unicode,i need settle both Simplified Chinese Traditional Chinese at my database.so i don't need convert at here yet. hope this can help. regards Lemon
  15. By: jonathan - jonathan78wong Can I use relative path ? 2004-03-18 00:22 Could I use relative path in "pdfFontName" to point to the enternal TTF file ? By: lemon - lemonz RE: Can I use relative path ? 2004-03-18 18:40 Hi I think you can copy the font file to your classpath. if you have download ireport 2.3.1, you can find a new directory fonts, when you copy you font file to here, you can use this font(include chinese font) at ireport2.3.1 regards Lemon
  16. By: jonathan - jonathan78wong Chinese Encoding ? 2004-03-14 21:58 Dear All , I want to know how the nono-English content , such as Chinese can be display in JasperReport ? Thank you ! By: David Lim - aberrant80 RE: Chinese Encoding ? 2004-03-14 22:16 I assume "nono" is "non". JasperReports supports unicode. So if you have the font, there shouldn't be any problems. By: jonathan - jonathan78wong RE: Chinese Encoding ? 2004-03-14 22:45 Dear David , I have the font in my computer (can type Chinese in MS Word) , but don't know whether I have the PDF font . Also , should I need to set the attribute of "PDF Embedded" , "PDF Encoding" and "PDF Font Name" ? Thank you ! By: David Lim - aberrant80 RE: Chinese Encoding ? 2004-03-14 23:34 if you're exporting to pdf, then yes, it's better to embed the font into the report file. i'm not sure about the pdf encoding, you'll have to look it up somewhere else. but the pdf font name attribute must be set to the actual .ttf font file. By: jonathan - jonathan78wong RE: Chinese Encoding ? 2004-03-15 00:18 Dear David , I try to embed the Chinese font to my PDF in jasperReport's xml : <font fontName="細明體" pdfFontName="mingliu" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="true" isStrikeThrough="false" /> However , there is an error : com.lowagie.text.DocumentException: Font 'mingliu' with 'Cp1252' is not recognized. How can I solve this ? Thank you ! By: chenlibing - linux_china RE: Chinese Encoding ? 2004-03-18 01:17 this is my setting: <reportFont name="chinese" isDefault="false" fontName="DialogInput" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="false"/> key: 1 pdfEncoding :UniGB-UCS2-H 2 pdfFontName: STSong-Light 3 fontName: your chioce maybe you need itext asian package. By: lemon - lemonz RE: Chinese Encoding ? 2004-03-18 18:33 Hi, the itext asia package support one Simplified Chinese font (STSong-Light) and two Traditional Chinese (MHei-Medium, MSung-Light), but we can register new chinese font at jasperreport . such as: <reportFont name="simkai" isDefault="false" fontName="Arial" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="simkai.ttf" pdfEncoding="Identity-H" isPdfEmbedded="true"/> you must keep the font file "simkai.ttf" at your classpath. or you can give a fullpath at here two. I think you can get more information from http://www.csdn.net/develop/read_article.asp?id=22936 regards Lemon
  17. By: Jessica - xuh Is there a way to make title grow dynamically 2004-03-17 09:35 I am working on some reports. The situation is: We want a section to put all user selected criteria(It can grow very large).On the report we only want that section to show once at the begining of each report. So I choose "title". But I don't see there is a way to make title grow dynamically. What we want to achieve is the section will grow dynamically in height according to user selection. I am not sure if there is any other solution vs. title, so I can manage the height. Thank you very much for your inputs in advance By: Jessica - xuh RE: Is there a way to make title grow dynamically 2004-03-18 07:51 Hi, Gurus, I haven't got any answer for my question. Is it something too obvious? I have searched the forum, could not figure out a solution. Please do give me some hints if you have any. Many thanks By: Travis Hoffman - travis_stc RE: Is there a way to make title grow dynamic 2004-03-18 10:25 The title is a band, just like the detail. So, to get the title to expand do the following: * Place a textField in your title * Use a parameter (something like $P{Title}) as the expression for that text field. * Define the <textField> with attribute isStretchWithOverflow="true" Now, if you pass in the parameter in the parameter map, it'll grow the title band to fit whatever is in the text field. That should make your title expand to fit. Best of luck, Travis By: Jessica - xuh RE: Is there a way to make title grow dynamically 2004-03-18 11:49 Thank you, Travis, I actually had two such kind of <textField> in title with attribute isStretchWithOverflow="true" already. The problem is:(My code kinda looks like the following) <title> <band height="300" ...> ... </band> </title> I have to specify the height, even with the textField set :isStretchWithOverflow="true". Once the height is reached, my text field will be blurred. So I am not sure if there is a easy way to make the height variable. Thank you very much again for any suggestion
  18. By: Gregory A. Swarthout - gswarthout Word lost on line wrap 2004-03-11 16:34 Teodor, On outputting to PDF, I am losing the last word of a column header. The field text is "Cand In Cred Process". The field is just over twice as tall as it needs to be to show a single line of text. What happens is that "Cand In Cred" is shown on the first line, and the second line is blank. If we remove the "e" from "Cred", then the word "Process" correctly shows up on the second line. I have encounted similar problems before when the text width was very close to the field width, but in the past, a strategically placed n let me break the line where I wanted. Replacing the space just before "Process" with a n in this case doesn't change the outcome. Here is the smallest report def which shows the problem: <?xml version="1.0"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="TestReport" pageWidth="760" pageHeight="842" columnWidth="720" columnSpacing="0" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenNoDataType="AllSectionsNoDetail"> <reportFont name="columnHeader" isDefault="false" fontName="Arial" size="12" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false" isBold="true" isUnderline="false"/> <columnHeader> <band height="32"> <textField> <reportElement x="0" y="0" width="80" height="32" forecolor="#FFFFFF" backcolor="#333333" mode="Opaque"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font reportFont="columnHeader"/> </textElement> <textFieldExpression>"Cand In Cred Process"</textFieldExpression> </textField> </band> </columnHeader> </jasperReport> By: David Lim - aberrant80 RE: Word lost on line wrap 2004-03-11 17:46 Yup. I've had vertical alignment problems with text that just fit into the text field. It's probably due to the end of string character or something, and the whole text just aligns to the top as though there's actually a second line of text. By: Teodor Danciu - teodord RE: Word lost on line wrap 2004-03-15 01:48 Hi, I have posted a comment on the bug report here: https://sourceforge.net/tracker/index.php?func=detail&aid=914599&group_id=36382&atid=416703 If you confirm it is exactly what happens in your case, I would remove the bug report since it is not quite a bug. Thank you, Teodor By: Gregory A. Swarthout - gswarthout RE: Word lost on line wrap 2004-03-16 15:35 Teodor, It seems very likely that your response to the bug report describes the effect that I am seeing. Greg By: Gregory A. Swarthout - gswarthout RE: Word lost on line wrap 2004-03-16 16:23 > The solution is to chose a "fontName" that you are sure is > available as an installed font on the machine that you are > running on Would this be chosen from the list of fonts that Java can "see" via: GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); By: Teodor Danciu - teodord RE: Word lost on line wrap 2004-03-16 23:38 Hi, Use the GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() method to get the available font names. Then, for exporting to PDF, you'll need the TTF file from which the font that you chose in Java originated from. Thank you, Teodor
  19. By: Heiner Jostkleigrewe - kdzjost Different fonts in one field 2004-01-24 10:52 Hello, i have to print a String from 3 database-columuns like this: xxxx yyyy, zzz where yyyy is bold. The 3 parts are different in size in every row. First time i put it in one field. But could not change the format for the yyyy-part. Second time i put it in 3 different fields. But I could not change the size and position of the fields. Any idea? Heiner By: Teodor Danciu - teodord RE: Different fonts in one field 2004-01-24 11:40 Hi, This kind of functionality is not yet available. I hope to do it soon. Thank you, Teodor By: Pepe P rez - pepeperez RE: Different fonts in one field 2004-03-15 02:04 Hi, I'm needing this functionality and I'm about to begin working on it. Before I began, what is the status of this, please?. TIA, Pepe.
  20. By: RoyalScorpion - mohamedfakhry20 Error on Windows XP and NT 2004-03-15 00:14 my project and the jar file runs well on Windows 2000 Professionla, but on XP and Nt it displays the following error: IOException: Create Process : javac -classspath ./test.jar C:....MyReport.java Please help me.
  21. By: Thomas Leverwitz - tleish Tagged PDF files for PDA 2004-03-14 13:43 I would like to request the PDF files be generated with Tags for PDA devices. Is this possible to do?
  22. By: RoyalScorpion - mohamedfakhry20 view without print 2004-03-13 15:48 i want to view the report without recompileling the report each time. i mean i want to compile the reoirt one time, and view it as more as i want without recompiling it. Is any way to do that. By: RoyalScorpion - mohamedfakhry20 RE: view without print 2004-03-13 15:50 sorry for spelling, i just was harry.
  23. By: bonacigi - bonacigi Memory optimization for huge reports 2004-03-12 04:54 I've just started to use JasperReports. I read that the filling process take a JasperReport as input and fill it with data producing a JasperPrint object. This object is then serialized to disk. If the report is filled with a large amount of data (and this happens frequently in my case) there will be a big use of memory because the JasperPrint object is completely built in memory. I tried a very simple report with (only the detail with 2 small fields) 100000 records and the JVM allocated 60-70 Mb of memory to complete the task. It's not possible to swap or serializa to disk the single pages as they are filled and not the entire JasperPrint at the end ? I think this will be a very useful feature, one that other report writers (which costs a lot of money:-)) actually don't have. Thanks Giovanni Bonacini Azienda Usl di Reggio-Emilia bonacinig@ausl.re.it
  24. By: rathna - rathna30 How to use CSS stylesheet in jasper report 2004-03-11 09:14 How to use CSS classes in jasper report. Please give the sample code.
  25. By: David Lim - aberrant80 Internal reports expression class 2004-03-08 22:48 My project uses an ant environment for our product. So we have something like this: <base>/src/<packages> Everything's fine with Jasper until it became necessary to specify a resource directory (eg. for images) and an output directory. Due to the build, the runtime base directory is not the same as the compile time base directory. Being unable to hardcode the full path into the code, I was wondering if anyone has a solution as to how to let the Jasper-internally generated reports expression class know about the runtime base directory? Was wondering about the "jasper.reports.compile.temp" property, but still doesn't solve the fact that I can't hardcode any absolute path information. Any ideas or suggestions appreciated. Thanks. By: Jorge Augusto Pizzato - pizzato RE: Internal reports expression class 2004-03-11 03:01 I also found this problem and I didn't get to solve in another way. I use a ini file (FileProperties) and put the App.folderReport and App.logoReport absolute path then and load de ini file. In class report I use: ...code.. parameters.put("folderReport", App.folderReport); parameters.put("ImageIcon", App.logoReport); ...code... JasperReport jr = JasperManager.loadReport(App.folderReport+"xx.jasper"); ...code.... JasperPrint jp = JasperFillManager.fillReport(jr, parameters, conn.getConnection()); ...code... In xml I use: <image scaleImage="FillFrame"> <reportElement x="25" y="10" width="240" height="55"/> <graphicElement stretchType="RelativeToTallestObject"/> <imageExpression>$P{ImageIcon}</imageExpression> </image> For subreports: <subreportExpression class="java.lang.String"> $P{folderReport}+"xx.jasper" </subreportExpression>
×
×
  • Create New...