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

jmurray

Members
  • Posts

    401
  • 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 jmurray

  1. Please post the source xml for your report. Without it it will not be possible to diagnose your problem properly. It sounds like your printWhenExpression is invalid. Remember it is inline java, so it has to be properly constructed. A well formed expression is something like these examples: $V{myvariable}where myvariable is a java.lang.Boolean new java.lang.Boolean($F{aTextField}.equals("testvalue")) where aTextField is a text field from your report query new java.lang.Boolean($V{PAGE_NUMBER}.intValue()<3 ) where PAGE_NUMBER is the system variable that describes the current page number. The example shown will display the object only on pages 1 and 2. new java.lang.Boolean($F{anIntegerField}.intValue()<100) where anIntegerField is an integer field from your report query Post Edited by jmurray at 10/28/2010 21:42
  2. Your expression syntax is correct, so the obvious thing to check is the actual value of the $P{RequestedLocationIdDisplay} parameter. It isn't null because an exception isn't thrown, so you need to see if it contains a non-zero value. Since it is a string it might be that you actuall have a zero but there's a space character beside it. Create a text box in the report header to display the contents of the parameter like this: ">" + $P{RequestedLocationIdDisplay} + "<" The carats help to identify whether any spaces are in the parameter, but you can obviously use any character you like. Change the font of the textbox to a fixed space font like courier and see what happens.
  3. There may be a ready made solution for your problem. See if this old thread helps: http://sourceforge.net/projects/ireport/forums/forum/217622/topic/1351349
  4. The best solution is to create separate repositories for DEV, TEST and PROD. It's strongly recommended that you check them out to build separate directories, but this can cause headaches when trying to reference external objects like images and subreports because paths will no longer match the report source. To overcome this you would need completely separate environments for development, test and production work.
  5. Is there any reason you can't put the text into the subreport as a report footer? It will always be positioned underneath the subreport's contents. If you wish to leave the statitic text box on the main report then you can change its Position Type attribute to Float. That should allow it to move down the page as the subreport grows past its top edge.
  6. No. You can only reference web resources via hyperlinks that are attached to textfields, images, etc. So if your html page is reasonably static you could save it as a jpg and embed that with a link to the real thing.
  7. You should really post the snippet of xml relating to the Detail section of your report. This would make diagnosis a lot easier. Where is the bottom of the Detail section in your report design? Is it just undeneath your fields or a long way below? The reason I ask is that the report design is based on a canvas rather than something the size of your output page. The Detail section should generally be only 1 or two pixels longer than the vertical size of your fields, otherwise your will get large gaps between the rows. If those gaps are large enough they will force a page break.
  8. You're trying to use summary values before the report has completed filling, so mdahlman is correct. You will create a subreport to calculate the summary values that you need. Place it in the report header so that it evaluated before the main report begins filling. Yes, you will be running you query twice but there's no other way to make the summary values available before the report is filled.
  9. I cannot replicate the problem, but I have seen it before. Unfortunately i can't remember how I solved it. Looks like something in your Java-land is expecting the quote marks to be escaped. Can you post the snippet of XML that contains your report query and the field definitions please? It would also be handy to see the xml for the textbox that displays the multiple quotes, so post that too. Post Edited by jmurray at 10/26/2010 20:49
  10. Do you mean "in a table" or "returned from a table"? You generally don't want to limit the number of rows in a table, so I'll assume you want to limit the number of rows returned from a table or query. You can do this within the query itself: MySQL: select field1, field2, field3 from table1 limit 100; Oracle: select field1, field2, field3 from table1 where rownum<100; but this has two problems. The first problem is that you won't necessarily get the correct subset of records back using simple quries like that. Sometimes you'll need to add a subquery to put thing in the correct order first. For example, if you wanted to list the best 100 sales staff by sales total you would need to do something like this: MySQL: select * from (select staffname, salestotal from table1 order by salestotal DESC) a limit 100; Oracle: select staffname, salestotal from table1 order by salestotal DESC where rownum<100; The second problem is shown by the examples: the query isn't portable across different database platforms. To overcome this problem you can use a vanilla query that will work on any database platform (eg. select staffname, salestotal from table1 order by salestotal DESC) and set the REPORT_MAX_COUNT parameter in you report.
  11. More information is needed. Could you state which database you are using and post the snippet of xml from you report design that describes your parameters and the report query please?
  12. Oracle example: jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = tcp.world) (PROTOCOL = TCP) (Host = server1.company.domain) (Port=1521)) (ADDRESS = (COMMUNITY = tcp.world) (PROTOCOL = TCP) (Host = server2.company.domain) (Port=1521))) (CONNECT_DATA = (service_name = mysrvc)))
  13. Have you looked at the results when you run the query directly from the database. You don't specify which dB you are using so that could be the source of your problem. If you are using Oracle you could also try enclosing your double quotes in single quotes: SELECT '"' || 'myname' || '"' or using CHR(34) instead SELECT CHR(34) || 'myname' || CHR(34) as bob from dual
  14. If the PDF is static you could save it as a jpg and insert it as an image in the last page footer
  15. It's probably not a bug, but simply a report design issue. Extra blank pages generally come about because an empty footer is being rendered as overflow.
  16. Suggest simply breaking up the contract details into individual records in a new table and sorting by the clause numbers to get the records to come out in the correct order. You won't be able to use text for the clause number field(s) as it won't sort numerically. You might need to use a few numeric fields and concatenate them together during report population. The clause number and text fields then bind to a simple textbox or two that are set as wide as you need and not very tall. An additional field can then be used to provide conditional formatting.
  17. From Real's How To: If your program allocates a lot of memory, you may need to increase this value to give more room to the garbage collector. When starting the JVM, two parameters can be adjusted to suit your memory needs : -Xms<size> specifies the initial Java heap size and -Xmx<size> the maximum Java heap size. To set the minimum at 512Mb and the maximum at 1024Mb java -Xms512m -Xmx1024m ... The default value for the minimum is 2Mb, for the maximum it's 64Mb.
  18. Rita, I suggest that you make Sub2 a subreport of Sub1. Sub1 will need to pass any parameter values from the main report on to Sub2, and Sub2 will need to return the total to Sub1. Sub1 can return values to the main report as necessary. If you need to return values from Sub2 to the main report then Sub1 will have to pass them on.
  19. You can also use the REPORT_COUNT variable to control your line thickness. You can't do it directly though, because the pen thickness attribute is a static value. You can set up two lines in the detail section of your report, stacked on top of each other. Set the pen weight on each line statically or using a style. Then use the PrintWhen expression to control when the thick line is displayed. The thin line will also be displayed when the thick line is displayed, but it doesn't matter because they have the same origin and width. <line> <reportElement style="thin_line" x="0" y="20" width="555" height="1" backcolor="#FFFFFF"> </reportElement> </line> <line> <reportElement style="thick_line" x="0" y="21" width="555" height="1" backcolor="#FFFFFF"> <printWhenExpression><![CDATA[new java.lang.Boolean(new java.lang.Integer($V{REPORT_COUNT}.intValue()% 5).equals(new java.lang.Integer(0)))]]></printWhenExpression> </reportElement> </line>
  20. You don't need to use scriptlets to display the record count as there is an inbuilt system variable that counts records for you: $V(REPORT_COUNT) Simply set up a text box with $V(REPORT_COUNT} as the control source in the Detail band and you're done. <textField hyperlinkType="None"> <reportElement x="413" y="12" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.Integer"> <![CDATA[$V{REPORT_COUNT}]]> </textFieldExpression> </textField> As for the line height, can you post an example of what you want to do (eg. make every fifth line double the height)
  21. You don't need to set up your own variable as there is an inbuilt system variable that counts records for you: $V(REPORT_COUNT) Simply set up a text box with $V(REPORT_COUNT} as the control source in the Detail band and you're done. <textField hyperlinkType="None"> <reportElement x="413" y="12" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.Integer"> <![CDATA[$V{REPORT_COUNT}]]> </textFieldExpression> </textField> Post Edited by jmurray at 12/20/2009 22:48
  22. One more thing: if you are using relative paths to point to your images (eg. ../images/myimage.png) you may not get the result you were after when you deploy the reports to the server. The root path on the server will be the directory where the application is running (eg. for tomcat /usr/share/tomcat5/) NOT the reports directory. I found it easier to reference the full path to image and subreport repositories in variables and use those whenever you need to point to an image or subreport. Sorry to go on about tomcat all the time, but it's all I know /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif
  23. 1) Yes you do, and it should be the same version as the copy of JasperReports that you use on your development box if you want to avoid compatibility issues. You'll need to include any addons (eg. mysql or ojdbc drivers, etc.) in the server's classpath too. 2) If you will be pointing your deployed reports at a different database you should make that change on the server engine, not the reports. This could be a hardcoded connection string in ReportEngine.java (yuk!), or if you're using something like Torque under Apache then you would define your database connections in the WEB-INF/conf/Torque.properties file of your JasperReports project so that they can be read by ReportEngine.java. 3) Paths for images and subreport jasper files are almost always different and will definitely need to be changed when you deploy each report. The paths for images don't need to point to a web resource as http://, they just need to reference the correct location for the source file(s) on the server. For example: on your development PC an image might be referenced as "c:/myreports/images/myimage.png", but when you deploy it you might need to specify "/usr/share/tomcat5/webapps/ROOT/reports/src/images/myinage.png". The exact path to your images and subreport files will depend on how your JasperReport engine is deployed and the structure of your reports diectory. I hope I have provided enough clues for you to follow up on. It's not really possible to provide specific answers or examples because server implementations can vary remarkably.
  24. I'm trying to compile a report in nb-3.5.2 that was created under version 3.0.0 and has scriptlets. The compile fails with the error "java.lang.NoClassDefFoundError: it/businesslogic/ireport/IReportScriptlet" In version 3.0.0 the IReportScriptlet class was found in iReport.jar. This jar does not exist in the new version and none of the nb-3.5.2 jars contain a class called IReportScriptlet. As a workaround I have included the v3.0.0 iReport.jar in the classpath to get reports going, but this is not an acceptable solution. Does anyone have any idea how to correctly implement scriplets under nb-3.5.2?
  25. Simplest method is to return the number of rows from the subreport to a local variable in the main sheet. In the main report simply calculate space taken as: (number of subreport rows * size of each subreport detail row) + size of subreport headers and footers.
×
×
  • Create New...