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. Here is an example of passing the subreport data source programatically... Code: Map customParameters = new HashMap(); customParameters.put("SubDataSource", new CustomDataSource(new File("file.csv"«»)); //could be CSV datasource jasperPrint = JasperFillManager.fillReport( jasperReport, customParameters, ds); JasperExportManager.exportReportToPdfFile( jasperPrint, "c:\output.pdf"«»); The main report then has a parameter declared for "SubDataSource", and the sub-report configured to have a datasource expression of "$P{SubDataSource}"
  2. Are you asking why you don't have more detail bands being wrapped onto a single page? It sounds like either .... A. You have groups implemented and have chosen an option under groups such as "Start Each Group On A New Page" B. Your detail band is high enough to generate a new page for each pass through. Could you post the report please?
  3. Try following the steps in that article up to where it talks about exporting a public key. If you do that, does it let you run your applet, but with first prompting for permission? That is what I usually did... prompts the user to approve the applet rather than an automatic approval. This is more feasible since you don't want to distribute the cert "always". If you require more assistance lets take this offline till we resolve it, email me and we can start working on it.
  4. So I was creating a simplified version and it did in deed shrink up the missing sections. So it must be something in my report design I am not thinking of. I will try to figure out the issue by making the two reports "meetin in the middle" so to speak and will post when I solve the issue. Thanks for the input!
  5. Could you use a custom data source and group by these sub-reports? I am sorry to say I still can't "envision" your design and what your goal is. You would create 'n' sub-reports programaticially then pass those to the main report as parameters which should be used as sub-reports?
  6. The report isn't structured with any other elements in the vertical space... is there a global report option that should be set? My elements touch... i.e. row 4 overlaps row 5 by 2 pixels for spacing reasons.. would this cause the issue? I would post the report, but a lot of the fields, SQL Query etc. is confidential. :(
  7. Could you clarify this question please? I am not sure what your asking...
  8. BigDecimal supports various rounding schemes. TO modify the scheme use in your field something like... $F{DOLLAR_FIELD} becomes.... $F{DOLLAR_FIELD}.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
  9. When I used the methods above, I never really worried about signing permissions... since I am signing my applet I wanted the applet to be able to print and do File IO so I just signed for all permissions I guess. As for implementing specific permissions I am not sure... why not just implement them all?
  10. I think you may have incorrectly signed the jar file. Your applet's web browser it is being run in should just read the jar file signature and take the authorization confirmation from there... if I was going to sign a jar file I would.... 1. Generate a key: c:\keytool -genkey -alias <ALIAS> -keystore <KEYSTORE FILE> where <ALIAS> is alias for your cert... anything really. <KEYSTORE_FILE> is file that the cert will be stored in... I prefer to use a .jks extension just for conventions sake. 2. Sign your jar file: c:\jarsigner -keystore <KEYSTORE_FILE> -signedjar <FINAL_JAR_NAME> [uNSIGNED_JARFILE] <ALIAS> 3. Verify signature: jarsigner -verify <FINAL_JAR_NAME> The example is a bit basic, but you should be able to follow through start to finish if you follow these basic guidelines. Post edited by: rsilver@bfm.bm, at: 2006/09/26 18:10
  11. Hey there, I read your sample chapter 4... just a general comment that the book is quite readable and well formatted! Cheers, Rob
  12. Has anyone found any good books on JasperReports? I have come across "JasperReports for Java Developers" by Heffelfinger (link from this website actually).. but when I google I don't find any others.
  13. What are the benefits of using either approach? It seem s to me that you would want to always use $P!{var} would you not? I have a situation where I have the WHERE clause being modified as WHERE name='$P!{PERS_NAME}' AND ID='$P!{PERS_ID}' But at some times I dont want the ID check used so I have that all extracte to an even bigger parameter... WHERE name='$P!{PERS_NAME}' $P!{ID_BIG_PARAM} Where I have ID_BIGPARAM = "" or... " AND ID='123' " So is it more efficient to use $P!{var} or $P{var} for the name parameter? Thx, Rob
  14. Hmmm.. I restarted the server several times and the problem persisted, then one last time seemed to be the charm... the problem has gone away. Very odd.
  15. I havn't loaded the report from within a jar file yet, although I am sure there is some mechanism to do so. However, another option is to place the .jrxml file in the same folder on your web server as your APPLET jar... and then in the applet class you can call the getCodeBase() method which will return that folder as a URL. Then append the filename to it and it should work.
  16. I was experiencing an error when using jasperreports 1.2.5 embedded into a servlet running on Geronimo 1.1 on a Linux box which has java 1.5.0_07, giving me the exception: java.lang.NoClassDefFoundError java.lang.Class.forName0(Native Method) java.lang.Class.forName(Class.java:164) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68) etc. etc. So I did some research and came across the fix of adding the -Djava.awt.headless=true flag to the startup script for Geronimo. I did this, and restarted the server and the problem went away. 1 week later this problem seems to have come back. I am wondering if anyone has any additional experience with this issue that they could share? I verified under the Geronimo console that the headless option is set for the server. Post edited by: rsilver@bfm.bm, at: 2006/09/25 17:41
  17. Is it the title/page header that is throwing off the CSV algorithm is what I was meaning by my post. So if you have .... [field1,field2,field3,field4,field5] without any header info.. but then you insert a title at the top of the page, you have.... [title,,,,] [field1,field2,field3,field4,field5] Is this correct? Then if so, you need to remove the title header etc. as per the FAQ posting concerning non-essential data.
  18. You need to refer to the other library jar files in your applet tag for the print applet. <applet code=Animator.class archive="jars/animator.jar, jars/jasperreports.jar" width=460 height=160> <param name=foo value="bar"> </applet> etc. etc. The archive tag will point to the relevant jar files. To print you will also need to sign your applet for appropriate security abilities. Do a google on this for more info.
  19. The CSV exporter logic is pretty strict about how you can place the fields in the report to have them properly interpreted when exported in CSV format. For my reports I try to use all fields with a constant height/width and make sure they are touching each other 1 by 1. Page headers and footers are not a great idea for CSV export format. Review http://jasperforge.org/sf/wiki/do/viewPage/projects.jasperreports/wiki/FAQ9 for more info on best practices for CSV exporting. Thx, Rob
  20. Hey all, I have a simple report using a custom data source. The data source returns an account descr, account number, value of account for each item in the result set. I organize my fields into a table like... Code: Account Descr Account # Value Savings 12345 100000.00 (I wish) Chequing 54321 422.00 Savings 2 666 41443.00 <Empty Row> <Empty Row> <Empty Row> <Empty Row> <Empty Row> Total: X00.00X My database is configured to have a maximum of 8 accounts so I am attempting to list them one after another stacked on top of each other as pictured above. My goal for this report, is to have the "Total: " line be sticky to the last displayed account row, so if there are only 1 accounts displayed, it would be the 2nd line down rather than 9th (as shown above). In the past I have setup a custom sub-datasource object and created a sub-report to have this section grow/shrink appropriately, keeping the Total line immediately below the last Account line (would put total in the column footer area of subreport). Given that there was a guaranteed number of accounts (8) I am hoping to simplify my design by not having to introduce a subreport. To do this, I tried grouping each row of this above table and then choosing the "Remove Line When Blank" option for all the fields. I also setup the fields to be blank when null, so "null" doesn't get printed for the rows that have no account. My thinking was that the Total line would be moved upwards to reflect each account line that was removed because the entire line was blank. But when I produced the report, the Total line was still 8 rows down from the top of the values. I also tried to change "Total:" positioning to be float/relative to bottom and also each row to be float. My question is, am I mis-interpreting the functionality of "Remove Line When Blank", or is there additional steps I must take to acheive this? As I said, I can make it happen using a sub-report but would like to understand this Jasper feature properly for simple instances like this. Thanks! Rob Post edited by: rsilver@bfm.bm, at: 2006/09/22 12:22 Post edited by: rsilver@bfm.bm, at: 2006/09/22 12:22
  21. Thanks Lucian! As a workaround for anyone reading this... just hide a small line of regular stroke/pen within the dotted line, just have to make sure it is the next element listed in the jasperreport.
  22. I am using jasperreports version 1.2.5, JRE 1.5.0_06 and created 2 reports in iReports and jasperassistant respectively to produce this issue. The following is my iReports report.... <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="Untitled_report_1" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <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.*" /> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="50" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="50" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="30" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="100" isSplitAllowed="true" > <staticText> <reportElement x="9" y="3" width="153" height="16" key="staticText-1"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font isUnderline="true"/> </textElement> <text><![CDATA[First Element]]></text> </staticText> <staticText> <reportElement x="8" y="23" width="153" height="16" key="staticText-2"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font isUnderline="true"/> </textElement> <text><![CDATA[second Element]]></text> </staticText> <line direction="TopDown"> <reportElement x="10" y="43" width="203" height="0" key="line-1"/> <graphicElement stretchType="NoStretch" pen="Dotted"/> </line> <staticText> <reportElement x="7" y="48" width="154" height="33" key="staticText-3"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font isUnderline="true"/> </textElement> <text><![CDATA[Fourth Element (After line)]]></text> </staticText> </band> </detail> <columnFooter> <band height="30" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="50" isSplitAllowed="true" > </band> </pageFooter> <lastPageFooter> <band height="50" isSplitAllowed="true" > </band> </lastPageFooter> <summary> <band height="50" isSplitAllowed="true" > </band> </summary> </jasperReport> Post edited by: rsilver@bfm.bm, at: 2006/09/21 15:47
  23. If I understand what your asking properly.... Your SQL query in your data source would create fields which you insert into your report with syntax $F{startDate} (e.g.) to use the getMonth you would refer to the month via $F{startDate}.getMonth() as the expression for the field.
  24. I create 4 text fields with underlined text and then create a line object and assign it a stroke of dashed line. My datasource has multiple elements in it. The first element has the 4 text fields with normal solid underlining, and then a dashed line, the second element in the data source now has dashed lines for all of the underlined text. If I move the dashed line up or down in my report elements list, the underlined text AFTER the dashed line inherit the dashed line, even on the first datasource element. Is it a "feature" reflective of how I am creating my elements or something, or is this a known bug that others have experienced? To reproduce this bug.. use iReports (or JasperAssistant) simply create 3 static text elements in the columnHeader and set them to be underlined. Then create a line and make it a dashed line, then another text elment and make it underlined as well. The last text element inherits the underline from the line element.
  25. I am not sure if it is Axis 2.0 or not. Are there any comments from devs or admins on this post? I am evaluating this software for use within my company and the key component is a reliable webservice. Thx, Rob
×
×
  • Create New...