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

lshannon

Members
  • Posts

    182
  • 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 lshannon

  1. I think the best practice for this is to export your 2.1 repository using the export tool that ships with JS. Install the new JS (3.0) and then import the 2.1 repository. If you made any UI customization to 2.1 you will have to reapply them to the newly installed 3.0. The documentation that ships with JS has a section addressing this. I have not upgraded to 3.0 yet myself, but I have done previous upgrades like this without issue. HTH
  2. The samples svenn pointed you too would be the best place to start. If you download the JR source and look in the demo/sample folder you will find even more examples. There is a hibernate sample I think you might find interesting. HTH
  3. Ensure the evalationTime on the variable calculating the subtotal is 'Report' instead of 'Now'. It should work like you want if you have this in place. HTH
  4. Sounds like this is a pie chart. Using iReport check out the Chart Properties -> Chart Data -> Details and check the key expression. Make sure the key expression is something that will not return a null. For a test you can put a static string.
  5. Great! That sounds like a pretty good solution to me, simpler than what I was suggesting.
  6. Ok, so what you need to do on the report side are 3 things. 1. Package up your helper class in a Jar, ensure the method that checks the image is static and returns a Boolean object (not boolean primative). 2. Ensure the jar from step one is in the classpath (for iReport you can just put it in the lib directory, make sure to restart iReport after adding it). 3. On the image element in the report (I am assuming you are working in iReport), right click on it and select Properties -> Common. In the print when expression put something like this: com.mypackage.HelperClass.printSignature() You can add a import to your report in iReport by going to Edit -> Report Import Directives. Here you can add com.mypackage.* which will allow you to reference HelperClass without the full path name. Hope this makes things more clear.
  7. Does the copying of this file occur before you fill the report? If so, you could write a helper class with a static method call printSignature() that checks this image file to see if it is the blank image (I am not a image expert when it comes to Java programming so I am not totally sure how this could be done). If it is the blank this method would return a false. Then in your report design you could add a PrintWhenCondition to the image element for the signature that is simply a call to the helper. It will then only print the element in the report when it is not the blank. This might do the trick. Let me know if you have any questions.
  8. In the text field expression you can do something like this: "$" + $F{total_amt} Make sure the class of the text field is a String after doing this. Also when using iReport, in the textfield properties, click the text field tab and then the create button next to the Pattern drop down. You will see a Currency pattern. Try playing with this as well. I hope this helps.
  9. I am a little confused about "pass the parameters from Jasper server". Do you mean you would like to use Jasperserver to collect parameter values that will be passed into the report? When it comes to params you need to define them in the report template using iReport. Once this is done, it is up to the parent application that is actually filling and exporting the report to collect the parameters values. When you fill you report you need to pass in the compiled template, a Map of parameters and their values, and a data source to the Fill Manager. Jasperserver gives you a mechanism called input controls that allows for easy creations of UI elements that users can interact with to populate values for parameters. Check out the Jasperserver user guide for examples on how to set up input controls. For working within your own application download the JasperReports source and take of look at the folder demo/samples/webapp for an example of working with a report with parameters in a Java application. I am not sure about using .NET. Perhaps someone else can comment on this. I hope this helps.
  10. When you say running from main do you mean from the command line vs running the class in Eclipse as a Java Application (or are you using ant)? It looks like when running in Eclipse the JRCompiler can't find the source for com.sabre.dataobjects.SeatInfo. Normally the JRCompiler resolves classes like this: http://www.jasperforge.org/sf/wiki/do/viewPage/projects.jasperreports/wiki/Tutorial_Compile But Eclipse has its own build path on a project to project basis. My guess is you need to either add a jar (containing the SeatInfo class) to the build path of the project containing createReport() or associate that project with the project that contains SeatInfo (provided both projects are available in Eclipse. I hope this is of some help.
  11. I am not very good with XPath so I am not sure if I can help much with this. I can suggest an alternate approach. Perhaps you can create a query executer that takes in the XML and returns a JavaBean collection? http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/data/JRBeanCollectionDataSource.html You could use an API like this to convert the XML to JavaBeans: http://xmlbeans.apache.org/ Once you get the data in a bean collection, processing it in the report might be easier than messing with XPath. Just a thought.
  12. You should be able to do this in a text field expression. You can make your class of type Date and then your expression can use the date String you are getting and a combination of the DateFormat class and the SimpleDateFormat to convert to the Date you want (this is going to get a bit tricky). Does it have to be of type Date? If it is just for display in the report could you not just format the string using the SimpleDateFormat and display it to the user (so the textfield would be of type String)?
  13. I think you need to have a main report with an xpath query that gets you the invoice nodes and writes out the creation date, etc. This will be written out in the detail band of the main report. Also included in this detail band will be subreport. You can feed the subreport with a data expression that creates a new JRXmlDataSource off the main document, but with an Xpath query that gets the invoice details for the invoice node you are on. HTH
  14. I have not seen this behavior. Perhaps the changes you have made are not being updated to the JRXML, which would be a different problem altogether. I have seen this occasional when making changes to charts and stylesheets. One thing that can cause this type of symptom is when testing in PDF and not closing Acrobat after you have exported a report. If you make a change and then run against the Datasource again, if Acrobat is still open with the last version of the report, it will just show this version again. I have lost a fair amount of time in the wee hours of the morning thinking my changes were not being picked up because of this. HTH
  15. In your main report you can make the subreport have a datasource expression and then make the expression itself this: Code: new JREmptyDataSource(1)
  16. Take a look at this FAQ: http://www.jasperforge.org/jaspersoft/opensource/business_intelligence/jasperreports/faq.html#FAQ28 You will probably need to put some time into your design to ensure there are no overlapping elements and you are using a grid layout. Also you can check out the excel exporter options: http://www.jasperforge.org/jaspersoft/opensource/business_intelligence/jasperreports/config.reference.html#net.sf.jasperreports.export.xls.detect.cell.type These can be set at the application level in the jasperreports.properties file or on a report by report basis by adding the properties to the JRXMLs manual. Here is the set I start with, this can be pasted in the JRXML right under the import statements: Code: <property name="net.sf.jasperreports.export.xls.exclude.origin.band.2" value="pageFooter"/> <property name="net.sf.jasperreports.export.xls.collapse.row.span" value="true" /> <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true" /> <property name="net.sf.jasperreports.export.xls.font.size.fix.enabled" value="true" /> <property name="net.sf.jasperreports.export.xls.ignore.cell.border" value="false" /> <property name="net.sf.jasperreports.export.xls.ignore.graphics" value="true" /> <property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true" /> <property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true" /> HTH Post edited by: lshannon, at: 2008/05/20 14:07 Post edited by: lshannon, at: 2008/05/20 14:09
  17. Ok, I made a few changes to calculation types and the class type of the ID parameter in report 2 didn't match the type of the variable being passed in. Unfortunately I can't test this. Take a look at the changes I made and see if any of them are helpful. [file name=example_updated.zip size=3468]
  18. Ah, I understand now. I think you are going to have to implement your own ImageServlet and call it from the report to do something like that. Maybe someone else has a better idea but I don't think there is a feature in JasperReports to assist with this.
  19. Ok, I am assuming at the main level you have 6 arraylist of beans for the 6 subreports. Each subreport can have a "Datasource Expression" like the following: Code: new JRBeanCollectionDataSource($F{collectionOfBeans1}) HTH
  20. Maybe I am not understanding the question but the image element does have a Vertical Alignment property. You will find it in the properties of the image element in the Image tab. When you say Vertical alignment do you mean in relation to itself (ie: Moving the image up and down within its own containing element) or are you referring too in relation to another image element in the design?
  21. If have not worked with the printer API. But I am pretty sure it just wraps the Sun Print API: http://java.sun.com/j2se/1.4.2/docs/guide/jps/index.html I was just looking over the PrintServiceLookUp class: http://java.sun.com/j2se/1.4.2/docs/api/javax/print/PrintServiceLookup.html It looks like you can look up a PrintService based on DocFlavor and Attribute. One the types of Attributes is PrinterLocation: http://java.sun.com/j2se/1.4.2/docs/api/javax/print/attribute/standard/PrinterLocation.html Maybe you could use one of these attributes to locate the printer?
  22. Sorry for the delay. Can you post the JRXML you are working with? I could put a sample together myself, but unless I send you a DB to go with it you won't be able to run it. Perhaps if I see where you are having trouble I might be able to suggest something.
  23. Sorry I didn't look at the error log closely enough (I thought this error was related to the report template itself). I see now this is actually a Tag issue. Take a look a this thread, seem like a similar problem: http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=50&t=008194
  24. 1. JasperReports doesn't have anything to do with the collections of the parameter. When you fill a report it takes a Map containing the parameter information ("name", class). It is up to the application running the report to obtain this list and pass it in when the report is filled. Parameters can be used in the report for expression logic and in the report query for the most part without "programming" (well you may to massage a Date to be more SQL friendly but this is not major). That being said it all depends on your requirements. Sometimes you need to do write some code within the report. 2. Yes, all the out of the box functionality for graphs is defined in the JRXML (can be configured with iReport). The chart does need a data expression but more often than not this is a field from the data source or a variable calculated in run time. To add functionality beyond what is available out of the box you will need to do some programming (this involved working with the JFreeChart API). 3. What do you mean by attaching extra java programming? The reports support Java, Groovy and Beanshell for the languages to write expressions in. You can call a helper class from within the report. I have only every used java to do this. I don't think it would be possible with JRuby but I am not sure. You should check out the sample reports that ship with the JasperReport source. There is a firstJasper.jrxml report that demonstrates a lot of features you might be interested in. Also there are examples of charts. HTH Post edited by: lshannon, at: 2008/05/16 16:08
  25. This could be a compatibility issue for sure. What version of JR did you make this report with and what version of JR does your application have?
×
×
  • Create New...