Jump to content
Changes to the Jaspersoft community edition download ×

ballinascreen

Members
  • Posts

    8
  • Joined

  • Last visited

ballinascreen's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Folks, I'm trying to plot data on a simple line chart - lets assume I'm trying to plot the following values: 960, 1010, 1200, 1110, 890 By default, I do not specify a Range Axis Min/Max Value Expression - I had assumed that if a value were not specified then by default the min/max values for the Range axis would be set to the min/max values of the data being plotted (i.e. 890, 1200) however it seems that it assumes the minimum Range Axis value is 0 (if none is specified)- therefore not making efficient use of the available chart area when many of the values are similar and much greater than 0. If I manually set the Range Axis Min Value expression (i.e. new Integer(890)) then the output scales as I would expect. Is there any way to tell Jasper Reports to autofit/autoscale the Range Axis based on the min/max values of the data being plotted? I can't hardcode a specific min/max value since I don't know what the min/max values are until the user runs the report? Am I missing something obvious?
  2. Folks, I have designed a Jasper Report which is designed to be hosted on a web server and executed via a Web App via the clients browser. The client may or may not reside in the same timezone as the web server (which will always be running as UTC) so obviously I want to ensure that any dates displayed to the user are in their local timezone. So, I intend to pass the client timezone to the report via the REPORT_TIME_ZONE parameter - after some testing I have noticed that Jasper Reports only adjusts certain dates to the appropriate timezone. Consider the attached JRXML test file which prints out the current date in serveral different ways: 1. Text Field, Expression Class: java.lang.String: new Date() 2. Text Field, Expression Class: java.util.Date: new Date() 3. Text Field, Variable, Expression Class: java.lang.String: new Date() 4. Text Field, Variable, Expression Class: java.util.Date: new Date() 5. Text Field, Localised Property String with formatted parameter, Expression Class: java.lang.String: msg("{0,date,EEE, d MMM yyyy HH:mm:ss Z}", new Date()) 6. Text Field, Localised Property String with formatted parameter, Expression Class; java.util.Date: msg("{0,date,EEE, d MMM yyyy HH:mm:ss Z}", new Date()) 7. Text Field, Expression Class: java.lang.String: "" + new Date() 8. Text Field, Expression Class: java.lang.Util: "" + new Date() For completeness I've included each test date twice - with an Expression Class of java.lang.String and java.util.Date respectively - although I'm not sure it makes any difference. Let's assume that my local environment is currently in British Summer Time (BST or GMT+01) and I've configured iReport so that the report Time Zone is set to US/Pacific (Pacific Standard Time). These are the results I obtain: Sun, 10 Jun 2012 12:42:15 -0700 Sun, 10 Jun 2012 12:42:15 -0700 Sun, 10 Jun 2012 12:42:15 -0700 Sun, 10 Jun 2012 12:42:15 -0700 Sun, 10 Jun 2012 20:42:15 +0100 Sun, 10 Jun 2012 20:42:15 +0100 Sun Jun 10 20:42:15 BST 2012 Sun Jun 10 20:42:15 BST 2012 You'll notice that the first four results conform to the REPORT_TIME_ZONE whilst the latter four default to the timezone of my local environment - so if a Date is passed as an object parameter to msg() or a String is concatenated with a Date() object, the REPORT_TIME_ZONE seems to be bypassed/ignored. Is this expected behaviour? Obviously I could get around this problem by ensuring that anywhere I wish to print a simple Date value that I create a dedicated Text Field and only define new Date() in the expression and then manually add the remaining text required via another appropriately aligned Text Field - but should I have to - am I messing something?
  3. Product Version: Jaspersoft iReport Designer 4.5.1 Java: 1.7.0_02; Java HotSpot Client VM 22.0-b10 System: Windows 7 version 6.1 running on x86; Cp1252; en_US (ireport) Folks, I have designed a report which plots financial information - the report can be executed by users in a number of different locales, and therefore the currency symbol which I want to appear needs to be specific to the locale. There are two places where I wish currency values to appear: (a) in the chart subtitle (b) in the Value Axis tick labels Therefore, I configured my chart subtitle expression as follows: msg("blah blah blah {0,number,¤#,##0.##} blah blah blah", 123.45) I also updated the Value Axis Tick Label mask for my chart to the following: ¤#,##0.## My system locale is en_GB. When I run my report as normal, the subtitle text will display the GBP/STG (£) currency symbol correctly, both in the chart subtitle (i.e. blah blah blah £123.45 blah blah blah) and each of the tick labels are also correctly prefixed with a £ symbol, i.e. £100, £200, £300 etc... However, if I now change the locale to something else, en_US for example, the chart subtitle text will change to show the dollar ($) currency symbol as expected (i.e. blah blah blah $123.45 blah blah blah), but the currency symbol on the value axis tick labels is still the £ symbol - it's as if iReports/Jasper Reports library is ignoring the specified report locale for the Value Axis Tick Labels and picking it up from my local system. Is this expected behaviour? Or is there a possible workaround? I know I could always remove the currency symbol from the tick label mask and add it to the Value Axis Label expression instead (which is picked up from a property file and thus translated correctly). Post Edited by ballinascreen at 06/06/2012 13:51
  4. Folks, I'm using a DataSet as a datasource for a table in on of my report detail bands. The DataSet comprises of three separate groups and therefore I have 3 corresponding header column groups. Each header column group contains a single Text Field which is used to print out pertinent headers as the groups change. However, one of my groups will not always contain a value and in these cases I would prefer that the group header cell was hidden/removed - rather than leaving a fixed space matching the predefined height of the cell. I've tried setting various combinations of 'Remove Line When Blank' at the table level, and 'Remove Line When Blank' & 'Blank When Null' at the Text Field level and nothing seems to work. Is it possible to do this? Or am I missing something obvious? Would appreciate any info/workrounds.... thanks. Post Edited by ballinascreen at 05/31/2012 12:12
  5. Further update: Seems like the following works instead: ((ArrayList) $P{REPORT_PARAMETERS_MAP}.get( "MY_REPORT_PARAM_LIST" )).contains($F{myIdField}.toString()) where I extract the list from the built-in report parameter REPORT_PARAMETERS_MAP Still doesn't explain why the value of my dedicated report parameter is not made available to the dataset filter expression, but I'm happy at least that I can get the filter working another way.
  6. A little further testing seems to confirm that the report parameter value is not being passed to the filter expression of the dataset. For example, if I set the filter expression to: $P{MY_REPORT_PARAM_LIST} == null all my records are displayed, that is, none are filtered because the MY_REPORT_PARAM_LIST appears to be null $P(MY_REPORT_PARAM_LIST} != null all my records are now filtered out So, why is the value of the report parameter seemingly not made available to dataset filter expressions but can be used elsewhere in the report - or am I missing something fundamental here?
  7. Folks, Consider the following scenario. I have a dataset which I'd lile to filter the contents of. The dataset query defines a call to a stored procedure which returns a resultset containing a small number of columns - one of which contains an 'id' value which I wish to filter on. I can already successfully filter the results using something along the lines of: $F{myIdField}.equals(1) || $F{myIdField}.equals(2) || ... and so on. However, I'd really like to pass in a list of filter ID's as a report parameter and perform the filtering like this: $P{MY_REPORT_PARAM_LIST}.contains($F{myIdField}) where MY_PARAM_LIST is defined as type java.util.List and contains multiple ID's (in this case Integers) that I want to match on. But this doesn't seem to work and all records in my dataset are filtered out. As a test, I created a dummy Text Field on the title page of my report and added the following expression: $P{MY_REPORT_PARAM_LIST}.contains("1") which successfully returned the correct results based on input, i.e.: 1,2,3,4 - true 2,3,4,5 - false So, why does this seem to work as a simple text field expression, but not as a dataset filter expression. I even tried updating the dataset filter expression to this: $P{MY_REPORT_PARAM_LIST}.contains("1") and ran the report, passing in a list of 1,2,3 - so I would have expected this to evaluate to true and not filter any results - but everything was filtered as before. Product Version: Jaspersoft iReport Designer 4.5.1 Java: 1.7.0_02; Java HotSpot Client VM 22.0-b10 System: Windows 7 version 6.1 running on x86; Cp1252; en_US (ireport) Any ideas? Post Edited by ballinascreen at 05/29/2012 21:17
×
×
  • Create New...