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

rsilverns.sympatico.ca

Members
  • Posts

    151
  • 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 rsilverns.sympatico.ca

  1. The workarounds involved an extra step after producing the report, which really limits the ability to preview the report or integrate it easily with frameworks such as AppFuse or even JasperIntelligence. Plus when dealing with large scale reports, this workaround is probably not practical as per the number of system resources that it would tie up to read in 10,000+ pages of two pdf files and interleave these two large pdf files to account for the two page layouts. My thought as to how to solve it was posted in the feature request. If these points are not detailed enough, just let me know and I will draft a longer description of how I see the feature request functioning.... my design easily expands to accomodate multiple datasources which could be used for the same report (1 data source per each "page"), among other features. Essentially the FR combines two aspects of JasperReports that I have had to use work arounds for... The first being trying to have portrait and landscape pages in the same report (typically in pdf export format). It's easy enough to do this with iText so the impact on JasperReports to implement should be minimal. The second being that I want to have a non-workaround method to dictate page breaks. I am finding that the "group header and isStartNewPage method" appears to be buggy when there is enough room on the existing page to fit some of the next group headers contents etc. To summarize my Feature Request, I envision having a "ReportPage" element which is essentially a stand-alone JasperReport file minus Title and Summary bands. This ReportPage can have its own groups and bands and detail band and has its page margins set on the page. A Jasper Report then is 1 or more ReportPage elements. It would be backwards compatible in that if there is no <ReportPage> element, the XML parser could create one by default when reading in older versions of JasperReports.
  2. Sorry.. was thinking of another element re: stretch. The subreport should stretch automatically. To help you understand what is happening... Think of the report as having two logical parts. The page structure parts (everything BUT the detail band) and then the "dynamic" part, which is the detail band ONLY. The detail band is printed once for every record in the datasource. When it is printed, it is combined with the other portions to create the produced output. So a simple example.. 5 records... A | 1 | test1 A | 2 | test2 A | 3 | test3 A | 4 | test4 B | 5 | test5 Our report structure is GroupHeader1 Detail GroupFooter1 Since we have 5 records... Detail band is printed 5 times and stacked one on top of another. The height of the group header/detailbands (1 instance for each record)/groupfooter are calculated and then bands are laid out on pages accordingly. So our pages consists of... The group expression is "test", a constant value so the expression never changes and a new group never starts. The output from this is.... Page1: Group1Header DetailBand For Record 1 DetailBand For Record 2 DetailBand For Record 3 (we ran out of room so a new page is started) Page 2: DetailBand For Record 4 DetailBand For Record 5 Group1Footer As you can see, although the detail band was printed 5 times the group header band was only printed once, since the group expression hasn't changed. So if you were printing the field $F{field2} and expecting to see 1, 2, 3, 4, 5 you would only see $F{field2} value of "1" if you placed the field in the group header. This is because at the time the group header is evaluated and "printed" onto the page of the report, the 1st record is still the current record. Then the detail band is hit, and the records are iterated over and many detail bands are evaluated and "printed" onto the final report one on top of another (adding new pages as needed). Now lets do the same thing, but change the group expression to be $F{field1}. Now the group expression will stay same for first 4 elements, then a new group will be started for the 5th element. The report output will now be... Group1Header (for $F{field1} = "A") detail1 detail2 detail3 (new page is started since we ran out of room) detail 4 Group1Footer (this is because the first 4 elements are in the same group remember. IF isStartNewPage group option is on, we will go to a new page.. if it isn't we will stay on the same page. The rest of the report will be structured... Group1Header($F{field1} = "B") detail5 Group1Footer So... if you have 5 data elements and your only seeing the first one, you have put the field into the group header which is only printed when the first record in your dataset is being used. If your group expression changes with every record (i.e. $V{REPORT_COUNT}) then you would see 5 records, each showing up in a group header. But this is NOT THE SAME group header.. it is 5 of them sequentially. (imagine a really thin detail/group footer seperating them.. height could even be 0 ... i.e. no group Footer). So it looks like it is printing all 5 fields, but it is printing them in 5 different groups. HTH, Robin Post edited by: rsilver@bfm.bm, at: 2006/10/27 19:41 Post edited by: rsilver@bfm.bm, at: 2006/10/27 19:43
  3. Sorry I am not sure what you are meaning by your post. The structure you are showing should work if the sub-report is structured to stretch as needed and your sub-report contains the "dynamic" elements, if you know what I mean.
  4. That is how groups work... they combine the records so you can have detail bands that are related by the group expression. So if you have.... Fruit Type | Ammount | Color Apple | 1 | Green Apple | 43 | Blue Apple | 24 | Orange Grapes | 243 | Purple And you group by $F{fruitType} as an expression, you would print group headers - detail band - group footer for $F{fruitType} = Apple and then you would have the same for $F{fruitType} = Grapes. HTH, Robin
  5. It's a java system option. I use Geronimo/Tomcat, so not sure about websphere, but in Geronimo/Tomcat I have to find the script that starts the server running and add the option -Djava.awt.headless=true to that script as part of the command options... JAVA_OPTS="$JAVA_OPTS "-Djava.awt.headless=true" HTH, Robin
  6. Are your elements in the group header of the main report? Try moving them to the detail band of the main report. HTH, Robin
  7. Are you familiar with the java language at all? Its a fairly straightforward bit of code if you are. The only tricky part is getting the right data source depending on the requirements of your report. Here is a sample program I would use, where the only thing that is left to change is the datasource: Code:import net.sf.jasperreports.engine.JREmptyDataSource; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperCompileManager; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperReport; public class JavaReportRunner { //args[0] - full path to .jrxml file //args[1] - full path to output pdf file public static void main(String[] args) { JasperReport jasperReport; JasperPrint jasperPrint; try { jasperReport = JasperCompileManager.compileReport(args[0]); Map customParameters = new HashMap(); jasperPrint = JasperFillManager.fillReport( jasperReport, customParameters, new JREmptyDataSource()); JasperExportManager.exportReportToPdfFile( jasperPrint, args[1]); } catch (JRException e) { e.printStackTrace(); } } } you would then compile this code to a java .class file and call this file using the appropriate java commands. HTH, Robin
  8. The image expression within the jasperreport would need to change to point to the new image in order for it to find the image. If your reports have been compiled to a .jasper file and you no longer have access to the .jrxml file you can re-create the original .jrxml file with the following java code: Code: JRXmlWriter.writeReport(jasperReport, "c:\xml_output_file.jrxml", "ISO-8859-1"«»); Where jasperReport is the JasperReport object.
  9. First Group: Your group expression is $V{REPORT_COUNT} which is a count of how many records are returned from your data source. Since it changes with every record, your group changes constantly, each record is being displayed. Second/Third Group: You have isStartNewPage="true" which places each new group onto a new page. Also I suspect that you are printing the information in a band other than the detail band? Try moving the fields into the detail band of the main report and see if every record is printed. HTH, Robin
  10. When a jasperreport does not have any records to display it does one of 3 things, does not print anything, prints blank page, or prints all sections but ignores the detail band.
  11. And you have confirmed that the 2nd sub-report .. the sub-sub report has "All Sections No Detail" option set. Could it be that the 1st sub-report has no records being retrieved from the database so it is printing its all sections no detail option and the 2nd sub-report is in the detail band? The $P!{nameOfParam} is used when creating parameterized query strings. It is analagous to using the ? notation in your SQL query as far as I know. Am a bit fuzzy on the distinction between $P{} and $P!{} in querySTrings myself ;). HTH, Robin
  12. This sounds a lot like the post concerning the headless exception. Try running your tomcat with -Djava.awt.headless=true flag set and see what happens.
  13. Did you check that sub-report as well for the option to be properly set?
  14. I have encountered that same problem. It is related to a bug in the underlying java graphics environment with how the graphics objects are being created to render report portions on unix/linux. To counteract this error, use -Djava.awt.headless=true, which resolves the issue. What the -Djava.awt.headless flag does is instructs the JVM to ignore any exceptions thrown that have to do with not having a GUI when initializing the GraphicsContext.
  15. If you open up each sub-report in iReport it should list it under report properties. Each report should have the expression set to "All Sections No Detail" which means that the headers/footers/title etc. will be printed even if no records are passed to the subreport.
  16. Still haven't heard anything concerning this issue. If the powers that be could address it, it would be great. I am sure that there are many that have similar concerns on the topic. I appreciate that you are probably being kept quite busy as the popularity of JasperReports seems to be growing in leaps and bounds, just hoping that this issue is under discussion or development even. :) Thx, Robin
  17. Your using a JREmptyDataSource() to fill your report with. You would need to either A. Pass a connection object to your database or B. pass a JRResultSetDataSource object. The empty datasource does not contain any data to populate your report with. HTH, Robin
  18. There has to be a condition, it will be either... - Blank Page - All Sections No Detail - No Pages
  19. What is the condition of the subreport and sub-subreport for "When No Data Print"? Could this be hiding one or more reports? Post edited by: rsilver@bfm.bm, at: 2006/10/24 14:32
  20. Should this be posted as a bug lucianc/teodord? Post edited by: rsilver@bfm.bm, at: 2006/10/24 11:45
  21. Sorry I forgot to mention, my groups all have the expression of $V{REPORT_COUNT}. I even tried making my own report_count type variable, and tacking "-Group2" onto end of group 2's expression in hopes of mixing up group expressions but they all behaved the same. I will go to your feature request and check it out. Thx Cbox, Robin
  22. I usually divide my report into pages by implementing dummy groups and having the group header contain each "page" of the report (with sub-reports etc. as required). When implmenting a new report I noticed something odd... Consider the following test report that has 2 groups, each with just a header band. Each group has the "isStartNewPage" option set to true. Code:<?xml version="1.0" encoding="UTF-8"?> <!-- Created using JasperAssistant (http://www.jasperassistant.com) --> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="Test" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" isFloatColumnFooter="true"> <property name="ireport.scriptlethandling" value="0"/> <property name="ireport.encoding" value="UTF-8"/> <import value="java.util.*"/> <import value="net.sf.jasperreports.engine.*"/> <import value="net.sf.jasperreports.engine.data.*"/> <style name="Arial" isDefault="true" fontName="Arial" fontSize="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <variable name="Variable_1" class="java.lang.Integer" calculation="Count"> <variableExpression><![CDATA["test"]]></variableExpression> <initialValueExpression><![CDATA[new Integer(0)]]></initialValueExpression> </variable> <group name="Group_1" isStartNewPage="true"> <groupExpression><![CDATA[$V{REPORT_COUNT}]]></groupExpression> <groupHeader> <band height="55"> <staticText> <reportElement key="staticText" mode="Opaque" x="0" y="0" width="555" height="55" forecolor="#FFFFFF" backcolor="#8080FF"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000" rightBorder="None" rightBorderColor="#000000"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="16" isBold="true"/> </textElement> <text><![CDATA[GROUP 1 HEADER BAND]]></text> </staticText> </band> </groupHeader> </group> <group name="Group_2" isStartNewPage="true"> <groupExpression><![CDATA[$V{REPORT_COUNT}]]></groupExpression> <groupHeader> <band height="55"> <staticText> <reportElement key="staticText" mode="Opaque" x="0" y="0" width="555" height="55" forecolor="#FFFFFF" backcolor="#FF00FF"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000" rightBorder="None" rightBorderColor="#000000"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="16" isBold="true"/> </textElement> <text><![CDATA[GROUP 2 HEADER BAND]]></text> </staticText> </band> </groupHeader> </group> </jasperReport> When I run the report with no extra space except that required for the header text field, I have both group1 header and group2 header showing up on the same page, 1 after the other. I use an empty data source to test, with a size of 5... on each page I have.. ---- Page Start----- [ GROUP 1 HEADER ] [ GROUP 2 HEADER ] (misc. whitespace to fill page) ---- Page End ------ Shouldn't the [ GROUP 1 HEADER ] be on 1 page, and then [ GROUP 2 HEADER ] be on next page? If I set the "isStartNewPage" option for group 1 to be false, then what happens is that every time group 2 header is encountered a new page starts. So with an empty datasource of size 5, this looks like... Page 1: [ GROUP 1 HEADER ] [ GROUP 2 HEADER ] [ GROUP 1 HEADER ] Page 2, 3, 4: [ GROUP 2 HEADER ] [ GROUP 1 HEADER ] Page 5: [ GROUP 2 HEADER ]
  23. Please refer to my feature requests, artf1732 being the primary one related to this, however artf1661 is the most elaborate suggestion I had for format. (artf1624 is another related feature request) Thx, Rob
×
×
  • Create New...