Home » Archived » BIRT » DataException from 3.7 runtime when rpt designs have scripts(DataException from 3.7 runtime when rpt designs have scripts)
DataException from 3.7 runtime when rpt designs have scripts [message #908285] |
Wed, 05 September 2012 00:54  |
Eclipse User |
|
|
|
Hi All
I am using 3.7.2 run time engine in our application. when i try to view the report which has script in before open method which modifies the query text by inserting report parameters, I get the following error:
org.eclipse.birt.report.engine.api.EngineException: invalid expression to retrieve value in presentation. (Element ID:376)
A small snippet of the script is like below:
var dbtype = "mysql";
var db_string="SUBSTRING";
if(dbtype=="mysql")
{
db_string="SUBSTRING";
}
else
{
db_string="SUBSTR";
}
var date = params["dateAll"].value;
var nodeid = params["nodeidAll"].value;
var accName = params["accnameAll"].value;
var serCode = params["servicecodeAll"].value;
var year = date.substr(0,4);
var month =parseInt(date.substr(5,2) -1);
if(month <10)
{
month="0"+month;
}
var month1 = date.substr(5,2);
var day = date.substr(8,2);
var hour = date.substr(11,2);
var min = date.substr(14,2);
var sec = date.substr(17,2);
var mydate =year+month1+day;
var input_date =new Date(year,month,day,hour,min,sec);
var today = new Date();
if( date.match( /^([0-9]{4})\-([0-9]{2})\-([0-9]{2}) ([0-9]{2}):([0-9]{2}:([0-9]{2}))$/ ) )
{
if(input_date <= today )
{
if(accName == "All" )
{
if(serCode == "All" )
{
this.queryText ="select TIMESTAMP,USSD_ACC_NAME,SERVICE_CODE,NODE_ID,UNIQUE_ID, " +
"AVG_TPS,PEAK_TPS,AVG_TPS_DETAILS,AVG_SPS,PEAK_SPS,AVG_SPS_DETAILS, " +
"AVG_PULL_TPS,PEAK_PULL_TPS,AVG_PULL_TPS_DETAILS,AVG_PULL_SPS, " +
"PEAK_PULL_SPS,AVG_PULL_SPS_DETAILS,AVG_PUSH_TPS,PEAK_PUSH_TPS, "+
"AVG_PUSH_TPS_DETAILS,AVG_PUSH_SPS,PEAK_PUSH_SPS,AVG_PUSH_SPS_DETAILS " +
"from USSD_REPORT_TPS_STATS " +
"where "+db_string+"(TIMESTAMP,1,8) = "+mydate+" " +
"and NODE_ID = "+nodeid +
" order by TIMESTAMP desc "
}
Please guide how to proceed.
Thank you,
Anita
|
|
|
Re: DataException from 3.7 runtime when rpt designs have scripts [message #908606 is a reply to message #908285] |
Wed, 05 September 2012 12:27   |
Eclipse User |
|
|
|
Can you write out the query to make sure it works externally. To do this
add the following to the bottom of your beforeOpen script:
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/myquery.txt", true ) );
out.println( "The Query is: " + this.queryText);
out.close();
Jason
On 9/5/2012 12:54 AM, anita tolety wrote:
> Hi All
>
> I am using 3.7.2 run time engine in our application. when i try to view
> the report which has script in before open method which modifies the
> query text by inserting report parameters, I get the following error:
> org.eclipse.birt.report.engine.api.EngineException: invalid expression
> to retrieve value in presentation. (Element ID:376)
>
> A small snippet of the script is like below:
>
> var dbtype = "mysql";
>
> var db_string="SUBSTRING";
> if(dbtype=="mysql")
> {
> db_string="SUBSTRING";
> }
> else
> {
> db_string="SUBSTR";
> }
> var date = params["dateAll"].value;
> var nodeid = params["nodeidAll"].value;
> var accName = params["accnameAll"].value;
> var serCode = params["servicecodeAll"].value;
> var year = date.substr(0,4);
> var month =parseInt(date.substr(5,2) -1);
> if(month <10)
> {
> month="0"+month;
> }
> var month1 = date.substr(5,2);
> var day = date.substr(8,2);
> var hour = date.substr(11,2);
> var min = date.substr(14,2);
> var sec = date.substr(17,2); var mydate =year+month1+day;
> var input_date =new Date(year,month,day,hour,min,sec);
> var today = new Date();
> if( date.match( /^([0-9]{4})\-([0-9]{2})\-([0-9]{2})
> ([0-9]{2}):([0-9]{2}:([0-9]{2}))$/ ) )
> {
> if(input_date <= today )
> {
> if(accName == "All" )
> {
> if(serCode == "All" )
> {
> this.queryText ="select
> TIMESTAMP,USSD_ACC_NAME,SERVICE_CODE,NODE_ID,UNIQUE_ID, " +
>
> "AVG_TPS,PEAK_TPS,AVG_TPS_DETAILS,AVG_SPS,PEAK_SPS,AVG_SPS_DETAILS, " +
>
> "AVG_PULL_TPS,PEAK_PULL_TPS,AVG_PULL_TPS_DETAILS,AVG_PULL_SPS, " +
>
> "PEAK_PULL_SPS,AVG_PULL_SPS_DETAILS,AVG_PUSH_TPS,PEAK_PUSH_TPS, "+
>
> "AVG_PUSH_TPS_DETAILS,AVG_PUSH_SPS,PEAK_PUSH_SPS,AVG_PUSH_SPS_DETAILS " +
> "from USSD_REPORT_TPS_STATS " +
> "where "+db_string+"(TIMESTAMP,1,8) =
> "+mydate+" " +
> "and NODE_ID = "+nodeid +
> " order by TIMESTAMP desc "
> }
>
>
>
> Please guide how to proceed.
>
> Thank you,
> Anita
|
|
| | | | | | | |
Re: DataException from 3.7 runtime when rpt designs have scripts [message #955143 is a reply to message #909707] |
Tue, 23 October 2012 10:52  |
Eclipse User |
|
|
|
Hi Jason.
I am trying to run your spring and intergration example. it worked on tomcat6.0.35 but if i run on WAS6.1 I get this error
Caused by: java.lang.RuntimeException: Could not start the Birt engine!
at momentum.wealth.wlisp.report.birt.engine.core.BirtEngineFactory.getObject(BirtEngineFactory.java:53)
at momentum.wealth.wlisp.report.birt.engine.core.BirtEngineFactory.getObject(BirtEngineFactory.java:1)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 117 more
Caused by: org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:81)
at momentum.wealth.wlisp.report.birt.engine.core.BirtEngineFactory.getObject(BirtEngineFactory.java:50)
... 119 more
Caused by: org.eclipse.birt.core.framework.FrameworkException: Cant register the ExtensionRegistry classpath
at org.eclipse.birt.core.framework.jar.ServiceLauncher.startup(ServiceLauncher.java:99)
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:75)
... 120 more
Caused by: org.eclipse.core.runtime.CoreException: Extension registry provider is already set.
at org.eclipse.core.internal.registry.RegistryProviderFactory.setDefault(RegistryProviderFactory.java:31)
at org.eclipse.core.runtime.RegistryFactory.setDefaultRegistryProvider(RegistryFactory.java:126)
at org.eclipse.birt.core.framework.jar.ServiceLauncher.startup(ServiceLauncher.java:84)
... 121 more
,
[12/10/23 14:32:42:851 GMT+
Quote:Anita
I am not sure what is happening here. I assume in your post that was two different classes? For your application you should only be starting the platform once. Is this the case?
If you put in a working report and add any script does it fail? BTW I do not know if you have seen this, but here is an article Josh Long and I worked on:
//www.springsource.org/BusinessIntelligenceWithSpringAndBIRT
Jason
|
|
|
Goto Forum:
Current Time: Tue Jul 22 22:53:01 EDT 2025
Powered by FUDForum. Page generated in 0.89280 seconds
|