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 04:54 |
anita tolety Messages: 9 Registered: September 2012 |
Junior Member |
|
|
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 16:27 |
|
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 #908864 is a reply to message #908606] |
Thu, 06 September 2012 06:16 |
anita tolety Messages: 9 Registered: September 2012 |
Junior Member |
|
|
Thank you for your reply Jason.
Script should be fine because the same report runs perfectly in Birt Report Designer 3.7.2.
Also it runs fine with 2.5.2 run time engine.
All I have done to migrate run time from 2.5.2 to 3.7.2 in my application is:
1. downloaded the birt-runtime-3_7_2
2. copied the Report Engine folder to my application.
3. Added all the jar files in ReportEngine/lib to the class path of application.
4. Correspoding Code changes
The reports without scripts are working fine. But when there is script, run time engine is giving problem.
Is there something that I have missed?
Thank you,
Anita
[Updated on: Thu, 06 September 2012 06:25] Report message to a moderator
|
|
| |
Re: DataException from 3.7 runtime when rpt designs have scripts [message #909334 is a reply to message #909207] |
Fri, 07 September 2012 01:00 |
anita tolety Messages: 9 Registered: September 2012 |
Junior Member |
|
|
Yes, I have removed. I also want to mention here that our application uses spring framework. Is there something which I have missed with respect to spring integration with BIRT run time.
To create EngineConfig and ReportEngine, I am using like this:
engineConfig = new EngineConfig();
//engineConfig.setEngineHome(BIRT_HOME);
engineConfig.setLogConfig(LOGGING_PATH, Level.INFO);
//engineConfig.setPlatformContext(new CustomOSGiPlatformContext());
try {
Platform.startup(engineConfig);
} catch (BirtException e) {
log.fatal("The Omega platform could not be initialized.", e);
System.exit(1);
}
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
reportEngine = factory.createReportEngine(engineConfig);
---------------------------
To create designConfig and Design engine, I am using like this:
DesignConfig designConfig = new DesignConfig();
//designConfig.setProperty(Platform.PROPERTY_BIRT_HOME, BIRT_HOME);
//designConfig.setPlatformContext(new CustomOSGiPlatformContext());
try {
Platform.startup(designConfig);
} catch (BirtException e) {
throw new OmegaException(String.valueOf(OmegaConstants.OMEGA_PLATFORM_STARTRUP_FAILURE));
}
IDesignEngine designEngine = null;
try {
IDesignEngineFactory factory = (IDesignEngineFactory) Platform
.createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY);
if (factory == null || designConfig == null) {
return null;
}
designEngine = factory.createDesignEngine(designConfig);
-----------------------------------
Thank you,
Anita
[Updated on: Fri, 07 September 2012 02:47] Report message to a moderator
|
|
| | | | |
Re: DataException from 3.7 runtime when rpt designs have scripts [message #955143 is a reply to message #909707] |
Tue, 23 October 2012 14:52 |
|
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: Thu Sep 19 07:44:54 GMT 2024
Powered by FUDForum. Page generated in 0.04476 seconds
|