Home
Analytics
Report Beforefactory chart drop errors in interactivity
abhiallen
I am working on the report which changes the design mased on user input date range params which is set in initialize. I wrote a script in beforefactory which drop 2 charts based on the daterange param and only render and execute only 1 chart and corresponding dataset.
Report execute successfully but during interactivity, any action would throw exception of cannot execute beforefactory script below:
DaysChart = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("dayschart");
HoursChart = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("hourschart");
WeeksChart = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("weekschart");
if (chartType == "days"){
HoursChart.drop();WeeksChart.drop();
}
else if( chartType == "hours"){
WeeksChart.drop();DaysChart.drop();
}
else if(chartType == "weeks"){
HoursChart.drop();DaysChart.drop();
}
else{
}
How do i change this script so that this run only with the initial report generation/rendering and not during with any interactivity action.
Thanks
Abhishek
Find more posts tagged with
Comments
kclark
Can you post the full output of the error you are getting and recreate this with the sample db and attach it?
abhiallen
<blockquote class='ipsBlockquote' data-author="'kclark'" data-cid="111742" data-time="1353507540" data-date="21 November 2012 - 07:19 AM"><p>
Can you post the full output of the error you are getting and recreate this with the sample db and attach it?<br /></p></blockquote>
<br />
<br />
There are errors evaluating script "DaysChart = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("dayschart"); HoursChart = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("hourschart"); WeeksChart = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("weekschart"); if (chartType == "days"){ HoursChart.drop();WeeksChart.drop(); } else if( chartType == "hours"){ WeeksChart.drop();DaysChart.drop(); } else if(chartType == "weeks"){ HoursChart.drop();DaysChart.drop(); } else{ }": TypeError: Cannot call method "drop" of null (/report/method[
@name="
;beforeFactory"]#7) (Element ID:1)
JasonW
Are you sure this script is in the beforeFactory? If this script is in the initialize you will get an error.
Jason