Jump to content
Changes to the Jaspersoft community edition download ×

TimeSeries Chart: Null Period argument error


godbole

Recommended Posts

Hello,

I'm trying to create a timeseries chart for a report that looks like the example given below. The data is retrieved from an Oracle database, where the time axis values come from a date field. The query selects data for a month. When I try to select Day as the Time Period (as this is what I want the plotting by), I'm getting a "null 'period' argument" error. The settings for the timeseries chart are shown in the attached images

Please help!

The report looks like:

Application: ABC

Date  Total Msgs  Total Bytes

=============================

Sept 10

.

.

Sept 30

=============================

Application:XYZ

Date  Total Msgs  Total Bytes

=============================

Sept 1

.

.

Sept 30

=============================

The error I get on the TimeSeries chart is:

Error filling print... Null 'period' argument. java.lang.reflect.InvocationTargetException      at java.awt.EventQueue.invokeAndWait(Unknown Source)      at javax.swing.SwingUtilities.invokeAndWait(Unknown Source)      at com.jaspersoft.ireport.designer.compiler.prompt.Prompter.promptForParameters(Prompter.java:259)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:731)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)  Caused by: java.lang.NullPointerException      at com.jaspersoft.ireport.designer.compiler.prompt.Prompter$1.run(Prompter.java:65)      at java.awt.event.InvocationEvent.dispatch(Unknown Source)      at java.awt.EventQueue.dispatchEvent(Unknown Source)      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)      at java.awt.EventDispatchThread.run(Unknown Source)  java.lang.IllegalArgumentException: Null 'period' argument.      at org.jfree.data.time.TimeSeries.addOrUpdate(TimeSeries.java:693)      at net.sf.jasperreports.charts.fill.JRFillTimeSeriesDataset.customIncrement(JRFillTimeSeriesDataset.java:150)      at net.sf.jasperreports.engine.fill.JRFillElementDataset.increment(JRFillElementDataset.java:179)      at net.sf.jasperreports.engine.fill.JRCalculator.calculateVariables(JRCalculator.java:152)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:682)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:255)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:113)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:888)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:791)      at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:234)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:890)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) 

Print not filled. Try to use an EmptyDataSource...

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

The field I'm querying  to get the date is of type DATE in the Oracle database. iReport reads it as Timestamp and I've also tried changing the type in iReport to java.util.Date but still get the same error.

I don't know if this is related but Oracle's way of interpreting date fields is a bit of a mystery to me. For instance, I have two tables that have date fields in them yet a select statement on one table such as:

SELECT *
FROM TABLE_STAT
WHERE INTERVAL_STARTDATE >= '1-SEP-08' and INTERVAL_STARTDATE <= '30-SEP-08';

works fine but the same statement does not work on the second table with the exact same field and data! I get an empty result set with no error so I've to use something like this:

SELECT *
FROM TABLE2_STAT
WHERE to_date(INTERVAL_STARTDATE,'dd-mm-yy') >= '01-SEP-08'
and to_date(INTERVAL_STARTDATE,'dd-mm-yy') <= '30-SEP-08';

The above second format is what the chart uses. I'm wondering if this is what is messing up the chart.

Another thing is is that for a time range of six months the chart is shown fine but not for a month or less of data. My problem is that the date range is gotten dynamically from a web app so I cannot predict what it'll be!

Please help if anyone has any idea.

Thanks!



Post Edited by Rajeshwari Godbole at 01/21/09 16:22
Link to comment
Share on other sites

  • 10 months later...

sorry has this post found any answer?

 

It looks like timeseries chart don't allow to have gaps in the values received from DB. i.e. It needs to receive a value for each day in a year (when we want to express data by day).

 

But often in a dataset we can have missing days and hence JChart throws the Null period argument exception!

 

How can we deal with those missing values in Jasperrepport TimeseriesChart.

 

Thanks!

Link to comment
Share on other sites

Actualy I don't think it is a problem with missing dates (i.e. gaps) in the data on which to base the time series.

See the following case...

 

OK try

------------

a datasource with a "OK_Date" field on which to base the timeserie in the graph (TimePeriodExpression). The data source is ORDERED on this field "OK_Date", and the field values aren't continuous on a daily basis.

 

displaying the graph with a time period expressed by DAY is OK!

 

 

KO try (null argument when express by day!)

---------------------------------------------

using the same datasource with a "OK_Date" field . The data source is ORDERED on this field "OK_Date".

BUT this time we use a variable "Display_Date" ,(validated with business logic),on which to base the timeserie in the graph (TimePeriodExpression). N.B. The "OK_Date" and "Display_Date" don't have the same chronological order. The day and month parts retain the same but some years are changed to YEAR-1.

 

displaying the graph with a time period expressed by WEEK is OK!

displaying the graph with a time period expressed by DAY is KO, with the following error:

<<

Error filling print... Null 'period' argument.

java.lang.IllegalArgumentException: Null 'period' argument.      at org.jfree.data.time.TimeSeries.addOrUpdate(TimeSeries.java:693)      at net.sf.jasperreports.charts.fill.JRFillTimeSeriesDataset.customIncrement(JRFillTimeSeriesDataset.java:146)      at net.sf.jasperreports.engine.fill.JRFillElementDataset.increment(JRFillElementDataset.java:175)      at net.sf.jasperreports.engine.fill.JRCalculator.calculateVariables(JRCalculator.java:148)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:736)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:252)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:923)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:826)      at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:59)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:858)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) 

Print not filled. Try to use an EmptyDataSource...

>>

 

 

The only explaination I can think of is the fact that the "Display_Date" isn't chronologicaly ordered anymore (eventhought when expressed by week it is OK??).

 

Does anyone have advices on how to resolve this  "Null 'period' argument" error?

 

Thanks in advance

 

Link to comment
Share on other sites

  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...