Jump to content

jmurray

Members
  • Posts

    401
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Everything posted by jmurray

  1. $P{} returns a quoted string like "hello", $P!{} returns an unquoted string like hello. Unquoted strings are very important when placing parameter values inline with (say) and SQL query. Take the following valid example: SELECT * FROM mytable WHERE mystringfield like '%$P!{someparametername}%' and compare it to the invalid example: SELECT * FROM mytable WHERE mystringfield like '%$P{someparametername}%' If $P{someparametername} = "hello" then the first statement's like value will be '%hello%' and the second example's like value will be '%"hello"%'.
  2. It's common to get the wrong field data types when you view the report query and have the code try to work out what data types to use. No problem though, just edit the field data types manually in the source xml. Just remember that if you view the report query again you could undo your changes, especially if you have iReports set to automatically read the field values
  3. You can create a Boolean expression like these examples: Variable myVar is a java.lang.String: new java.lang.Boolean( $V{myVar}.equals("hello world") ) Field myFld is (say) a java.lang.Integer: new java.lang.Boolean( $F{myFld}.intValue()>0 ) If you want to create an expression that actually performs an action based on a boolean comparison the you would do something like this: new java.lang.String( $P{myParm}.intValue()=0 ? "Zero" : $P{myParm}.toString() )
  4. The page footer of a subreport is part of the detail band of the main report. That means that the page footer becomes more like a section footer when the main report gets rendered. That's why you see the output that you describe. The solution is to either: pass the information you are interested in back to variable(s) in the main report and use the variables to display information in a page footer in the main report or use a separate subreport in the page footer band of the main report. Typically this type of subreport would have a query that is based on the query of the subreport used in the detail band of the main report, but would return only summary information using aggregate functions (eg. sum, count, avg, etc.)
  5. You need to establish a link between the parameter in the main report and the parameter in the sub-report. To do this you edit the subreport's properties in the main report and set up the parameter settings under the Subreport Parameters tab.
  6. On another note, you should avoid using field names like 'name' and 'id' that can clash with reserved words in your database. Try to use more meaningful field names like 'jobname' and 'job_id'. It'll save you from headaches in the future.
  7. $P{sel_job} contains a list of numbers, so if you print its contents then you'll only see a list of numbers as you point out. Getting a list of jobs in a subreport is easy enough, you just use a lookup query like this: SELECT name FROM job WHERE id in ( $P{sel_job} ) The problem is that this list will be VERTICAL, and you want it to be horizontal. For that you will need a variable. In your subreport create a new variable called JOBLIST. Variable Class Type is "java.lang.String", Calculation Type is "Nothing", Reset Type is "Report", Increment Type is "None", and Initial Value Expression is simply "". Your Variable expression will be ( $V{JOBLIST}.equals("") ? $F{NAME} : $V{JOBLIST} + ", " + $F{NAME} ) If $V{JOBLIST} is empty is simply adds the job name, otherwise it adds a comma and the job name. Now you can either set up your subreport to display nothing (don't worry the query will still run and the variable will get filled) and return the variable to the main report for display there, or setup a Text Field in the Summary band of the subreport to display the variable in the subreport (the subreport doesn't need any other elements).
  8. You certainly can do this. Edit the Chart Properties, select the Chart Data tab, and then select the Details sub-tab. You should see your Category Series listed. Modify the series and select the Item Hyperlink tab. Change the Hyperlink Type to "Reference". This will display a new sub-tab labelled "Reference". Enter your hyperlink expression there (eg. $F{SITE_URL} ). If you want tooltips for each bar as well then you put an expression in the ToolTip Expression box under the ToolTip sub-tab. Easy.
  9. shubh is on the money. For an example of dealing with floating report elements see http://www.jasperforge.org/index.php?option=com_mamblog&Itemid=109&task=show&action=view&id=228&Itemid=109
  10. Export settings are found under Options - Export Options. There is only one option that can be set for CSV - the delimiter character. So it looks like you'll have to do it in the source query or each text field expression in the report design. Both methods are tedious.
  11. AFAIK the page footer does not print on pages containing these bands because the bands actually define a special report page. If you're in a hurry you can simply copy the contents of the page footer band into those bands. Of course you will have to adjust the vertical size of the bands and the layout yourself. The vertical size is going to be quite large (around the vertical size of the stationary your report is destined for) so navigating your way through the report design in iReport could become a tad annoying. An alternate and better method is to use separate sub-reports. These subreports would have a dummy query that returns a single row of unused info (eg. SELECT 1 AS A_ROW FROM DUAL), static content, and a clone of your main report's page footer so you don't have any layout problems. You will, however, need to pass any required dynamic information into these subreport using parameters.
  12. The script on creates five tables ADDRESS, PRODUCT, DOCUMENT, POSITIONS, ORDERS. Strangely the ORDERS table references CUSTOMERID but there is nothing in the entire distribution that creates a CUSTOMERS table. Sloppy work indeed. Worth posting a bug report on the forge to try and get the sample dataset synchronised with the example in the documentation.
  13. No. The size of the a report's output page is defined by you in the report properties and it is static.
  14. Sorry dogmac, way past the limits of my ken. Maybe someone else might be able to give you some pointers.
  15. You haven't provided enough information. Does anything get displayed (eg. header text)? Does the report's query actually return any rows? Are the elements in the page footer hidden behind another object (eg. a filled rectangle)? Are any of the page footer elements static (eg. Static Text Box, Rectangle, Circle, etc)?
  16. Copy the contents of the file demo/hsqldb/test.script into an SQL command window and run the script to create the Northwind sample database.
  17. NVL is for Oracle, ifNULL is for mySQL. http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html#function_ifnull
  18. codyjasperForge's reply is not correct. You can pass the value of any variable, field, parameter, or expression on the main report to a parameter in the subreport. When passing the values back from the subreport to the main report you can only do so using variables. The return value of a variable defined in the subreport is passed to a variable defined in the main report. The subreport variable can have any calculation type. The variable in the main report must have a calculation type of "System". ---------- Now back to rubenwise's Q. Passing a field value to a parameter in order to pass it to a subreport doesn't make much sense as jasperReports will always fill subreports before other report elements, including parameters. Just set the Subreport Parameter Expression to be $F{field1}
  19. The error message says that it can't find the getErrors() method within apache commons. This error message could be masking one or more other errors. It looks like your classpath is not defined correctly or you are missing one of the commons*.jar files.
  20. Bug report raised: http://jasperforge.org/sf/tracker/do/viewArtifact/projects.ireport/tracker.bugs/artf2345?_message=1183693643920
  21. I reckon that's almost worthy of a bug report. I can't think of a case where any statically defined object could make sensible use of that property... :unsure: Well done on nutting it out svenn
  22. This answer on the JasperReports forum may answer your question http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=8&id=1793#1793 It is NOT provided in the iReport distribution, so you'll have to download the jasperReports distribution and extract it to get the demo database. . Post edited by: jmurray, at: 2007/07/06 03:33
  23. 1. There is insufficient information to determine where the problem might be. Please post your source xml as a file. XXXXX out any any sensitive/proprietary bits first. 2. The legend information is sourced from the data behind the chart, so you would have to modify the souirce data or the relevant chart expression. The follow example shows how to modify a chart expression to append a $ prefix: "$" + $F{yourfieldname}.toString() . Post edited by: jmurray, at: 2007/07/06 03:01
  24. Your explanation of the problem isn't quite clear. Can you be specific about what it is you want to do please? Also let us know which database platform you are using.
×
×
  • Create New...