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. Set you position type like this: Subreport 1 must not float, so Fix Relative to Top. Subreports 2 and 3 must float. All three should stretch with overflow.
  2. The problem is that $P{startDate} is not defined when you try to set the default value of $P{startDate}.getTime() / 1000L to parameter startDateLong. Use a variable instead, and use BigDecimal rather than Integer: <variable name="startDateBD" class="java.math.BigDecimal"> <variableExpression><![CDATA[new java.math.BigDecimal($P{startDate}.getTime() / 1000)]]></variableExpression> <initialValueExpression><![CDATA[new java.math.BigDecimal(0)]]></initialValueExpression> </variable>
  3. To count the records in each group set a variable like this: Variable Class: java.lang.Integer Calculation: Count Reset type: Group Reset group: <The group's name> Increment type: None Variable Expression: new java.lang.Integer(1) Initial Value Expression: new java.lang.Integer(0) Don't worry about the print when expression in the text field, just set the text field expression to $V{<variable name>} and set the type to java.lang.Integer Post Edited by jmurray at 07/12/2011 01:24
  4. The PDF exporter is probably trying to render the text in a foreign font. For example your text element may have a base font of SansSerif, but if it's not available to the JVM then the PDF exporter will try to use an equivalent font like (say) Helvetica. This font substitution can lead to unpredictable results. So you have two solid ways to fix your PDF rendering issue: First you could make sure you specify a font that is available to the JVM and make sure that the default PDF font is the same. Either remove pdfFontName tags from all text elements or force them to reference the same font as the base text element font. Note: the unpredictability can still remain if you don't specify a base font. Alternatively you could export your fonts as a font extension and make them available to the JVM. This feature was made available somewhere around iReport version 3.6 I think. It's not clearly documented on the forum, so here are the basics: Add fonts that you like under Tools - Options - iReport - Fonts. True Type fonts are normally found in the c:WindowsFonts directory, so they're pretty easy to install. Once you're happy you can export your font set as an extension. Select the fonts you want to export from the fonts list in Tools - Options - iReport - Fonts. Press the "Export as extension" button and provide a filename (eg. "c:myfonts.jar") when prompted. To make your new font extensions available to the JVM you simply put the file you created into the JVM's classpath. This issue is covered in other posts on this forum. Search for pdfFontName, export fonts, or font extensions Post Edited by jmurray at 07/11/2011 09:35
  5. Values can only be shared between a report and a subreport. You can have multiple subreports in a report, and you can nest several levels of subreports, so there is plenty of flexibility to exchange data in a variety of ways. But there is no way to pass information between isolated reports.
  6. Your post is not clear. Could you provide a bit more detail on what you are trying to do?
  7. I hope I'm not interpretting what you psted incorrectly. Your variable expression should simply be $F{CATEGORY_DESCRIPTION}+ "........ " +$V{PAGE_NUMBER}
  8. Can you use transactions in mysql query with Jasper? Yes you can, but as matt points out ,they are only useful if you are updating data. JasperReports can only execute a single SQL statement in each report or subreport element. So to execute a series of updates you would simply call a stored function if your dB supports them. eg. SELECT myFunction() as myResult FROM DUAL; You would perform this sort of thing if you were running a report where you need to source data from a temporary table or if you wanted to perform some sort of housekeeping or totalisation before filling the report. In these instances you would call the function from a subreport in the header of the main report because it will be evaluated first. The return value can be used to indicate sucess or failure, the number of rows updated or created, etc. and can therefore influence what is displayed on the main report. Your function should handle all errors gracefully and return an appropriate value should an error occur.
  9. is there a version independent update available? Cannot complete the install because of a conflicting dependency. Software being installed: Jaspersoft Studio 0.0.4 (com.jaspersoft.studio.feature.feature.group 0.0.4) Software currently installed: Eclipse IDE for Java Developers 1.2.1.20090918-0703 (epp.package.java 1.2.1.20090918-0703) Only one of the following can be installed at once: Core File Systems 1.2.0.v20090507 (org.eclipse.core.filesystem 1.2.0.v20090507) Core File Systems 1.2.1.R35x_v20091203-1235 (org.eclipse.core.filesystem 1.2.1.R35x_v20091203-1235) Cannot satisfy dependency: From: Jaspersoft Studio 0.0.4 (com.jaspersoft.studio.feature.feature.group 0.0.4) To: net.sf.jasperreports [0.0.2] Cannot satisfy dependency: From: Eclipse IDE for Java Developers 1.2.1.20090918-0703 (epp.package.java 1.2.1.20090918-0703) To: org.eclipse.epp.package.java.feature.feature.group [1.2.1.20090918-0703] Cannot satisfy dependency: From: net.sf.jasperreports 0.0.2 (net.sf.jasperreports 0.0.2) To: bundle org.eclipse.core.filesystem 1.2.1 Cannot satisfy dependency: From: EPP Java Package 1.2.1.20090918-0703 (org.eclipse.epp.package.java.feature.feature.group 1.2.1.20090918-0703) To: org.eclipse.platform.feature.group [3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7] Cannot satisfy dependency: From: Eclipse Platform 3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7 (org.eclipse.platform.feature.group 3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7) To: org.eclipse.core.filesystem [1.2.0.v20090507] Post Edited by jmurray at 11/01/2010 20:57
  10. kcronin Wrote: EDIT: I found where I should go to view it, View->Docking Panes-> Show output Window It was already checked. When I try to uncheck it and check it again, nothing happens. That's the correct place to look in version 2, so if the toggle is not working for you then it sounds like a problem has crept into your environment. That could be anywhere (your JVM, iReports installation, a third party installation).
  11. Stretch type of "Relative to Tallest Object" will only work with subreports if they have a background color set and the "Opaque" setting is TRUE. Even then the stretch won't extend beyond one page, so it's not a great solution. Since each subreport is evaluated independently it is not possible to exchange information between them about how many rows are being returned. However, you can put a subreport into the page header that returns the count of rows for each query. Those values could then be used to make decisions about how to adjust the output of the subreports. Just how you would do that is up to you. But the easiest way to overcome you problem is to use ONE subreport with one query. Format the subreport to output the information as if there were two. Use printWhenExpression if necessary to remove objects when your query returns NULLs, empty strings, zeroes etc.
  12. Under the Window menu you can select Report Problems and Report Output
  13. Put a trap for space characters into your subreport query: SELECT DISTINCT a.NAME, b.VALUE FROM tablea a LEFT OUTER JOIN tableb b ON a.ID = b.ID WHERE TRIM(UPPER(a.SERIAL_NUMBER)) = TRIM(UPPER($P{SER_NUMBER})) You should also give your subreport parameter a default value of empty string "" <parameter name="SER_NUMBER" class="java.lang.String"> <defaultValueExpression><![CDATA[""]]></defaultValueExpression> </parameter>
  14. Yes, you would use one or two subreports to achieve this depending on how your queries are structured. If one query is the master and the other the slave then you use one subreport. The main query goes in the main report and the slave query goes in the subquery. The subreport is linked to the main report via a parameter in the subreport that is linked to a key field in the main query. If there is no master-slave relationship between your subreports then you use two subreports. The main report need to have a query that provides keys for each subreport. The subreports are linked to the main report via parameters linked to the appropriate key fields in the main query. Check out these articles for information on how to use subreports: http://jasperreports.sourceforge.net/sample.reference/subreport/index.html#subreports http://bytecoded.blogspot.com/2009/12/jasperreports-370demosamplessubreport.html
  15. As you have found out rectangles are only really useful if they don't overflow onto following pages. The solution is to use lines instead of rectangles. There are some subtleties that need to be taken into consideration though. Here's a description of how the example was put together. Just adapt it to suit your needs OK let's start with the layout of the report. The main report's Detail section will display some general information for each record in a box. It will also display some detailed information in another box that must be contained entirely within the main report's box. The detailed information may overflow onto one or more following pages. First you contruct the basic layout of the main report's box, ignoring the subreport for now. Instead of using a rectangle to frame the main display area we use two horizontal lines and two vertical lines. The first horizontal line can define both the top border of the frame and the distance between each row of detail. Simply create a horizontal line across the canvas at position y, where y is the measure of the gap that you want between each record. Now place all of the main report's information elements (eg. Static Text, Text Boxes, etc) underneath that line. Next you need to create another horizontal line below the main report's information elements, leaving enough space to insert a subreport element. The subreport only has to be a few pixels high because subreports expand by themselves, but it's a good idea to make it tall enough to visually understand what type of element it is. The bottom line's Stretch setting needs to be set to FLOAT so it can be repositioned automatically as the subreport's size changes. Join the outer edges of the top and bottom lines with two vertical lines. Let's move on to the subreport now. The canvas for the subreport does not need to have any margins, so set them all to 0. Make sure the body of the subreport is exactly the same width as the body of the main report. This makes it easier to line elements up as you will discover shortly. Add all the information elements to the detail section of the subreport, then minimise the detail section to the smallest vertical size possible. Create a horizontal line in the REPORT HEADER section and position it so that it's flush with the bottom of the section. Now create a horizontal line in the LAST PAGE FOOTER section and position it at the very top of the section (y=0). Now for the fiddly bits that make the whole thing work: the vertical lines. First draw two vertical lines in the subreport's detail area that go from top to bottom and "join" the ends of the horizontal lines in the REPORT HEADER and LAST PAGE FOOTER sections. Now add two more vertical lines in the exactly same position as the vertical lines of the main report. These will provide side walls for the main report's "rectangle" for every row of detail. To avoid nasty gaps appearing you will also need to create vertical lines in the exactly same position as the vertical lines of the main report in the REPORT HEADER and LAST PAGE FOOTER sections of the subreport. They must go from top to bottom to form a continuum. The size of the LAST PAGE FOOTER section will define the gap between the bottom of the subreport's rectangle and the bottom of the main report's rectangle. NOTE: If the subreport has any GROUP or COLUMN sections then these will need to include vertical lines that replicate the vertical lines of the side walls of the rectangles in both the main report and the subreport. Insert the subreport into the Detail section of the main report. It should stretch from the left margin to the right margin. It doesn't matter if it overlaps the vertical lines representing the side walls of the main report's rectangle. It must not overlap any of the main report's information elements. Reduce the vertical size of the subreport element to fit immediately above (ie. 1 pixel above) base of the rectangle in the main report. Format the rest of the report as required. Garnish and serve warm Post Edited by jmurray at 10/29/2010 08:46
  16. You would need to create a subreport that displays all the necessary the summary totals and insert it into the group header. Your subreport's source query can probably do all of the summarisation through aggregate functions.
  17. Since upgrading to iReports 3.7.1 (and subsequent revisions) I have not been able to edit the text inside any expression editor and the XML editor won't display anything. Not really a problem because it's easy enough to open an external editor to make the changes, but annoying just the same. I haven't come across any mention of this elsewhere on the forums so I'm guessing that there's a problem with my JVM installation or the order in which jars are being loaded. But where do I start looking? Any ideas would be greatly appreciated.
  18. Stab in the dark #1: Check that the JasperReports jar on the JasperServer implementation is the same version as you are using for iReports. Stab in the dark #2: If JasperServer is running on headless (no screen) hardware then it might be running a screen emulator (eg. X11 frame buffer) to render the reports (I think only applies to installations running on JDK 1.4 (hopefully this is not you). Make sure that emulator or the server's video driver is able to handle the appropriate color depth. Post Edited by jmurray at 10/28/2010 23:00
  19. The only way I've ever been able to include dynamic content is by inserting an image that references a cgi or php script that can generate and return images on the fly. The following example uses a field called WEEKLY to display a graph of weekly network utilisation: <image hyperlinkType="Reference"> <reportElement key="image-1" x="395" y="10" width="385" height="160"/> <imageExpression class="java.lang.String"><![CDATA[$F{WEEKLY}]]></imageExpression> <hyperlinkReferenceExpression><![CDATA[$F{WEEKLY}]]></hyperlinkReferenceExpression> </image> To get the graph generated the report's query must provide the URL of the script plus all the parameters required to generate the right graph for each row, like this: select REGION, SITENAME, SERVICE_ID, BANDWIDTH , 'http://mywebsite.mycompany.com/weathermap/proxy.php?url=http://cricket.mycompany.com/?type=png;target=' || substr(rrdpath,14,length(rrdpath)-17) || ';inst=0;dslist=ifHCInOctets%2CifHCOutOctets;range=604800;rand=763' as WEEKLY from bw_consumption You may be able to do a similar thing with your PDFs. In the example above the URI reference points to a PHP script that is simply a wrapper that calls a cricket grapher with the appropriate parameters and receives a bitstream back from the cricket grapher. This bitstream is rerendered as an image that can be displayed in the report. The attachment shows how this method was used to create weekly, monthly and yearly views of network traffic on the fly for any number of sites.
  20. Sorry, I misunderstood. You are outputting your report to XLS, and JasperReports is splitting the 4000000 rows returned into blocks that fit within a worksheet. giulio posted a suggestion on this similar thread: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=72364 Maybe that will help. You will need to determine how many rows are in each sheet and make sure that it is consistent. If the number of rows varies by one row on each alternate sheet then you will need to adjust the vertical size of the detail section so that it always outputs the same number of rows
  21. Hi Anil, The number of records in the report is not important. The problem is simply a report design issue. I suggest that you consider moving the column header info that you need to see on every page into the page header section instead.
  22. There is currently no way to embed PDF content in JasperReports. http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=80158
  23. A page break will just force the filler to start filling on a new page. As you have discovered it won't insert a blank page. It's not clear what you want to do, but it sounds like you want to insert a blank page at the end of a group of records. If that's the case then just make the veritcal size of the group footer large enough to force a blank page to be included. You should also set the group up to start on a new page whenever the group changes. If you want to force a blank page so that each group starts on (say) an odd page then you will need to inspect the inbuilt $V{PAGE_NUMBER} variable. There are a number of threads that discuss this, so search the forums to find a solution that best suits your needs.
  24. The classification must be contained within the results of your datasource. That means that you need a field in each record that describes the category that each competitor is in. For example: Name Category Result1 Result2 John Boys U12 10:23.2 10:56.5 Jill Girls U9 13:23.4 14:27.6 In iReport you can then design your report to make use of the categorisation by adding a group for the Category field. There are various formatting options that will help to format the output as you need it, like forcing a new page when the category changes. For more information consult the iReport Ultimate Guide: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=69890
  25. There are many bands available to report developers and the best explanantion of how they work is in the iReport Ultimate Guide: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=69890 The basic explanation is that you can group you report query's results into as many group levels as you need. You normally do this to help construct a report that is easily read and understood. In a basic report that employs groups you would normally put section headings in the group headers and summary totals in the group footers. There are many more things that can be done with groups but detailed explanation is beyond the scope of this forum
×
×
  • Create New...