Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Connection profile store location
Connection profile store location [message #554420] Mon, 23 August 2010 05:15 Go to next message
Kavitha is currently offline KavithaFriend
Messages: 10
Registered: August 2010
Junior Member
Dear friends,

I am designing reports on Windows and for development purpose we are just using
Run --> View Report ->In WebWiewer/PDF for testing.For each report we are creating data source with db connection.When we changed db for production.Now I have to change in all my reports to modify the connection information in them.
So hard coding connection info in rptdesign file seems to be bad idea and I want to change this by the way.So I created Connection profile XML and using this file in data source Connection Profile.

In my rptdesign file, XML source shows
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc.dbprofile " name="SampleDS" id="2178">
<list-property name="privateDriverProperties">
<ex-property>
<name> org.eclipse.datatools.connectivity.oda.profile.db.provider.i d </name>
<value>org.eclipse.datatools.enablement.oracle.connectionProfile </value>
</ex-property>
</list-property>
<property name="OdaConnProfileName">New Oracle(0)</property>
<property name="OdaConnProfileStorePath">D:\workspace\reports\WebContent\Oracle_Profile </property>
</oda-data-source>
</data-sources>

how to change OdaConnProfileStorePath to relative path?

While googling i got something like The Javascript expression can refer to a BIRT config[] variable. For
example,
config[ "birt.viewer.working.path" ] + "../../data/myData.csv" .When i gave this script in data source --> property binding --> connection profile store url.I got some error like ,

+ Error evaluating Javascript expression. Script engine error: birt.viewer.resource.path not found
Script source: <inline>, line: 0, text:
config[ "birt.viewer.resource.path" ] + "/Oracle_Profile"

Please Provide me steps what should I do to be able to use this file by my reports? Please Help me i am in crucial stage.

Thanks,
Kavitha

[Updated on: Mon, 23 August 2010 05:17]

Report message to a moderator

Re: Connection profile store location [message #554594 is a reply to message #554420] Mon, 23 August 2010 16:06 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can set the location also in the beforeOpen script of the dataset like:
this.setExtensionProperty("OdaConnProfileStorePath",
"c:/work/styles/mysqlclassic.txt");

To make it relative use a combination of these scripts:

var rp =
reportContext.getHttpServletRequest().getSession().getServle tContext().getRealPath( "/MyConnectionProfiles");
if( rp != null ){
this.setExtensionProperty("OdaConnProfileStorePath",rp);
}

You can get an init parameter like:
var mrp =
reportContext.getHttpServletRequest().getSession().getServle tContext().getInitParameter( "BIRT_RESOURCE_PATH");


Jason

On 8/23/2010 1:15 AM, Kavitha wrote:
> Dear friends,
>
> I am designing reports on Windows and for development purpose we are
> just using
> Run --> View Report ->In WebWiewer/PDF for testing.For each report we
> are creating data source with db connection.When we changed db for
> production.Now I have to change in all my reports to modify the
> connection information in them.
> So hard coding connection info in rptdesign file seems to be bad idea
> and I want to change this by the way.So I created Connection profile XML
> and using this file in data source Connection Profile.
>
> In my rptdesign file, XML source shows
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc.dbprofile "
> name="SiteMonVisitsDS" id="2178">
> <list-property name="privateDriverProperties">
> <ex-property>
> <name> org.eclipse.datatools.connectivity.oda.profile.db.provider.i d
> </name>
> <value>org.eclipse.datatools.enablement.oracle.connectionProfile </value>
> </ex-property>
> </list-property>
> <property name="OdaConnProfileName">New Oracle(0)</property>
> <property
> name="OdaConnProfileStorePath">D:\workspace\reports\WebContent\Oracle_Profile
> </property>
> </oda-data-source>
> </data-sources>
>
> how to change OdaConnProfileStorePath to relative path?
>
> While googling i got something like The Javascript expression can refer
> to a BIRT config[] variable. For
> example,
> config[ "birt.viewer.working.path" ] + "../../data/myData.csv" .When i
> gave this script in data source --> property binding --> connection
> profile store url.I got some error like ,
>
> + Error evaluating Javascript expression. Script engine error:
> birt.viewer.resource.path not found
> Script source: <inline>, line: 0, text:
> config[ "birt.viewer.resource.path" ] + "/Oracle_Profile"
>
> Please Provide me steps what should I do to be able to use this file by
> my reports? Please Help me i am in crucial stage.
>
> Thanks,
> Kavitha
Re: Connection profile store location [message #554674 is a reply to message #554420] Tue, 24 August 2010 04:01 Go to previous messageGo to next message
Kavitha is currently offline KavithaFriend
Messages: 10
Registered: August 2010
Junior Member
Hi Jason,

Thanks for the reply.

I have given like this,

var rp =
reportContext.getHttpServletRequest().getSession().getServle tContext().getRealPath( "/Oracle_Profile");
if( rp != null ){
this.setExtensionProperty("OdaConnProfileStorePath",rp);
}

in connection Profile Store URL of data source.On ping i got below exception.What could be the problem?

Oracle_Profile is there in my workspace.


org.eclipse.datatools.connectivity.oda.OdaException: Unable to find the connection profile referenced by the data source connection properties.
at org.eclipse.birt.report.data.oda.jdbc.dbprofile.impl.Connect ion.open(Connection.java:97)
at org.eclipse.birt.report.data.oda.jdbc.dbprofile.impl.Connect ion.open(Connection.java:57)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaCo nnection.open(OdaConnection.java:238)
at org.eclipse.datatools.connectivity.oda.profile.OdaConnection Wrapper.open(OdaConnectionWrapper.java:209)
at org.eclipse.datatools.connectivity.oda.profile.OdaConnection Wrapper. <init>(OdaConnectionWrapper.java:59)
at org.eclipse.datatools.connectivity.oda.profile.OdaConnection Factory.createConnection(OdaConnectionFactory.java:26)
at org.eclipse.datatools.connectivity.internal.ConnectionFactor yProvider.createConnection(ConnectionFactoryProvider.java:83 )
at org.eclipse.datatools.connectivity.internal.ConnectionProfil e.createConnection(ConnectionProfile.java:355)
at org.eclipse.datatools.connectivity.ui.PingJob.createTestConn ection(PingJob.java:76)
at org.eclipse.datatools.connectivity.oda.design.internal.ui.Da taSourceEditorPageCore$1.run(DataSourceEditorPageCore.java:6 08)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.datatools.connectivity.ui.wizards.ProfileDetails PropertyPage.testConnection(ProfileDetailsPropertyPage.java: 98)
at org.eclipse.datatools.connectivity.ui.wizards.ProfileDetails PropertyPage$1.widgetSelected(ProfileDetailsPropertyPage.jav a:80)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.birt.report.designer.ui.dialogs.BaseDialog.open( BaseDialog.java:110)
at org.eclipse.birt.report.designer.data.ui.actions.EditDataSou rceAction.doAction(EditDataSourceAction.java:68)
at org.eclipse.birt.report.designer.internal.ui.views.actions.A bstractElementAction.run(AbstractElementAction.java:70)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

Thank you,
Kavitha
Re: Connection profile store location [message #554675 is a reply to message #554674] Tue, 24 August 2010 04:11 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Kavita,

Can you add this to your script:
> var rp = reportContext.getHttpServletRequest().getSession().getServle
> tContext().getRealPath( "/Oracle_Profile");
> if( rp != null ){
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/events.txt", true ) );
out.println( "rp = " + rp);
out.close();

> this.setExtensionProperty("OdaConnProfileStorePath",rp);
> }

And see if rp actually got set?

Jason

On 8/24/2010 12:01 AM, Kavitha wrote:
> Hi Jason,
>
> Thanks for the reply.
>
> I have given like this,
>
> var rp = reportContext.getHttpServletRequest().getSession().getServle
> tContext().getRealPath( "/Oracle_Profile");
> if( rp != null ){
> this.setExtensionProperty("OdaConnProfileStorePath",rp);
> }
> in connection Profile Store URL of data source.On ping i got below
> exception.What could be the problem?
>
> Oracle_Profile is there in my workspace.
>
>
> org.eclipse.datatools.connectivity.oda.OdaException: Unable to find the
> connection profile referenced by the data source connection properties.
> at org.eclipse.birt.report.data.oda.jdbc.dbprofile.impl.Connect
> ion.open(Connection.java:97)
> at org.eclipse.birt.report.data.oda.jdbc.dbprofile.impl.Connect
> ion.open(Connection.java:57)
> at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaCo
> nnection.open(OdaConnection.java:238)
> at org.eclipse.datatools.connectivity.oda.profile.OdaConnection
> Wrapper.open(OdaConnectionWrapper.java:209)
> at org.eclipse.datatools.connectivity.oda.profile.OdaConnection Wrapper.
> <init>(OdaConnectionWrapper.java:59)
> at org.eclipse.datatools.connectivity.oda.profile.OdaConnection
> Factory.createConnection(OdaConnectionFactory.java:26)
> at org.eclipse.datatools.connectivity.internal.ConnectionFactor
> yProvider.createConnection(ConnectionFactoryProvider.java:83 )
> at org.eclipse.datatools.connectivity.internal.ConnectionProfil
> e.createConnection(ConnectionProfile.java:355)
> at org.eclipse.datatools.connectivity.ui.PingJob.createTestConn
> ection(PingJob.java:76)
> at org.eclipse.datatools.connectivity.oda.design.internal.ui.Da
> taSourceEditorPageCore$1.run(DataSourceEditorPageCore.java:6 08)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at org.eclipse.datatools.connectivity.ui.wizards.ProfileDetails
> PropertyPage.testConnection(ProfileDetailsPropertyPage.java: 98)
> at org.eclipse.datatools.connectivity.ui.wizards.ProfileDetails
> PropertyPage$1.widgetSelected(ProfileDetailsPropertyPage.jav a:80)
> at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe
> ner.java:228)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
> at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
> at org.eclipse.jface.window.Window.open(Window.java:801)
> at org.eclipse.birt.report.designer.ui.dialogs.BaseDialog.open(
> BaseDialog.java:110)
> at org.eclipse.birt.report.designer.data.ui.actions.EditDataSou
> rceAction.doAction(EditDataSourceAction.java:68)
> at org.eclipse.birt.report.designer.internal.ui.views.actions.A
> bstractElementAction.run(AbstractElementAction.java:70)
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
> at org.eclipse.jface.action.ActionContributionItem.handleWidget
> Selection(ActionContributionItem.java:584)
> at org.eclipse.jface.action.ActionContributionItem.access$2(Act
> ionContributionItem.java:501)
> at org.eclipse.jface.action.ActionContributionItem$5.handleEven
> t(ActionContributionItem.java:411)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault
> (Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work
> bench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at org.eclipse.ui.internal.ide.application.IDEApplication.start
> (IDEApplication.java:113)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips
> eAppHandle.java:194)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher
> .runApplication(EclipseAppLauncher.java:110)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher
> .start(EclipseAppLauncher.java:79)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:368)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>
> Thank you,
> Kavitha
Re: Connection profile store location [message #554679 is a reply to message #554420] Tue, 24 August 2010 05:29 Go to previous messageGo to next message
Kavitha is currently offline KavithaFriend
Messages: 10
Registered: August 2010
Junior Member
still the same error. when i saw in Preview nothing is getting printing in console and i am getting same exception.

[Updated on: Tue, 24 August 2010 05:34]

Report message to a moderator

Re: Connection profile store location [message #554839 is a reply to message #554679] Tue, 24 August 2010 14:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

What does the txt document have in it? Did it write the file out?

Jason

On 8/24/2010 1:29 AM, Kavitha wrote:
> still the same error.
Re: Connection profile store location [message #554978 is a reply to message #554839] Wed, 25 August 2010 03:57 Go to previous messageGo to next message
Kavitha is currently offline KavithaFriend
Messages: 10
Registered: August 2010
Junior Member
Its not displaying anything
Re: Connection profile store location [message #555152 is a reply to message #554978] Wed, 25 August 2010 15:50 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I assume this means rp is null.

Can you try this:

Can you try this script:

importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/events.txt", true ) );
rp =
reportContext.getHttpServletRequest().getSession().getServle tContext().getRealPath( "/Oracle_Profile");
if( rp != null ){
out.println( "rp = " + rp);
this.setExtensionProperty("OdaConnProfileStorePath",rp);
}else{
out.println(" rp is null " );
}
myresourcefolder = reportContext.getDesignHandle().getResourceFolder()
out.println("resource folder is set to "+myresourcefolder);
out.close();

This will check to see if we have the resource folder an we can use it
instead of the path you provided above. Also notice that I removed the
var keyword off the variable rp. This will make it global.

Jason

On 8/24/2010 11:57 PM, Kavitha wrote:
> Its not displaying anything
Re: Connection profile store location [message #555243 is a reply to message #555152] Thu, 26 August 2010 04:39 Go to previous messageGo to next message
Kavitha is currently offline KavithaFriend
Messages: 10
Registered: August 2010
Junior Member
On DataSource Test Connection i got below exception,


org.eclipse.datatools.connectivity.oda.OdaException: Unable to find the connection profile referenced by the data source connection properties.
at org.eclipse.birt.report.data.oda.jdbc.dbprofile.impl.Connect ion.open(Connection.java:97)
at org.eclipse.birt.report.data.oda.jdbc.dbprofile.impl.Connect ion.open(Connection.java:57)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaCo nnection.open(OdaConnection.java:238)
at org.eclipse.datatools.connectivity.oda.profile.OdaConnection Wrapper.open(OdaConnectionWrapper.java:209)
at org.eclipse.datatools.connectivity.oda.profile.OdaConnection Wrapper. <init>(OdaConnectionWrapper.java:59)
at org.eclipse.datatools.connectivity.oda.profile.OdaConnection Factory.createConnection(OdaConnectionFactory.java:26)
at org.eclipse.datatools.connectivity.internal.ConnectionFactor yProvider.createConnection(ConnectionFactoryProvider.java:83 )
at org.eclipse.datatools.connectivity.internal.ConnectionProfil e.createConnection(ConnectionProfile.java:355)
at org.eclipse.datatools.connectivity.ui.PingJob.createTestConn ection(PingJob.java:76)
at org.eclipse.datatools.connectivity.oda.design.internal.ui.Da taSourceEditorPageCore$1.run(DataSourceEditorPageCore.java:6 08)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.datatools.connectivity.ui.wizards.ProfileDetails PropertyPage.testConnection(ProfileDetailsPropertyPage.java: 98)
at org.eclipse.datatools.connectivity.ui.wizards.ProfileDetails PropertyPage$1.widgetSelected(ProfileDetailsPropertyPage.jav a:80)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.birt.report.designer.ui.dialogs.BaseDialog.open( BaseDialog.java:110)
at org.eclipse.birt.report.designer.data.ui.actions.EditDataSou rceAction.doAction(EditDataSourceAction.java:68)
at org.eclipse.birt.report.designer.internal.ui.views.actions.A bstractElementAction.run(AbstractElementAction.java:70)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)



Please can you send me a sample report
Re: Connection profile store location [message #555457 is a reply to message #555243] Thu, 26 August 2010 16:26 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Attached is my example. I use mysql and tomcat.


The resource folder is set in the web.xml like:

<!-- Resource location directory. Defaults to ${birt home} -->
<context-param>
<param-name>BIRT_RESOURCE_PATH</param-name>
<param-value>myresources</param-value>
</context-param>

Jason


<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.21"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.5.2.v20100208 Build &lt;2.5.2.v20100210-0630></property>
<property name="units">in</property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<property name="imageDPI">96</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc.dbprofile "
name="mysqlclassic" id="125">
<method name="beforeOpen"><![CDATA[if(
!reportContext.getHttpServletRequest().getAttribute("attributeBean ").isDesigner()
){
//this.setExtensionProperty("OdaConnProfileStorePath",
"c:/work/styles/mysqlclassic.txt");

importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/test9/conevents.txt", true ) );
//rp =
reportContext.getHttpServletRequest().getSession().getServle tContext().getRealPath( "/Oracle_Profile");
//if( rp != null ){
//out.println( "rp = " + rp);
//this.setExtensionProperty("OdaConnProfileStorePath",rp);
//}else{
//out.println(" rp is null " );
//}
myresourcefolder = reportContext.getDesignHandle().getResourceFolder()
out.println("resource folder is set to "+myresourcefolder);
out.close();
this.setExtensionProperty("OdaConnProfileStorePath",
myresourcefolder+"/mysqlclassic.txt");



}

]]></method>
<list-property name="privateDriverProperties">
<ex-property>

<name> org.eclipse.datatools.connectivity.oda.profile.db.provider.i d </name>

<value>org.eclipse.datatools.enablement.mysql.connectionProfile </value>
</ex-property>
</list-property>
<property name="OdaConnProfileName">mysqlclassic</property>
<property
name="OdaConnProfileStorePath">c:\work\styles\mysqlclassic.txt </property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.dbprofile.sqbDataSet "
name="Data Set" id="126">
<list-property name="columnHints">
<structure>
<property name="columnName">orderNumber</property>
<text-property
name="displayName">orderNumber</text-property>
</structure>
<structure>
<property name="columnName">productCode</property>
<text-property
name="displayName">productCode</text-property>
</structure>
<structure>
<property name="columnName">quantityOrdered</property>
<text-property
name="displayName">quantityOrdered</text-property>
</structure>
<structure>
<property name="columnName">priceEach</property>
<text-property
name="displayName">priceEach</text-property>
</structure>
<structure>
<property name="columnName">orderLineNumber</property>
<text-property
name="displayName">orderLineNumber</text-property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">orderNumber</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">productCode</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">quantityOrdered</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">priceEach</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">orderLineNumber</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">mysqlclassic</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">orderNumber</property>
<property name="nativeName">orderNumber</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">productCode</property>
<property name="nativeName">productCode</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">quantityOrdered</property>
<property name="nativeName">quantityOrdered</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">priceEach</property>
<property name="nativeName">priceEach</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">orderLineNumber</property>
<property name="nativeName">orderLineNumber</property>
<property name="dataType">integer</property>
<property name="nativeDataType">5</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[SELECT *
FROM `mydb`.`orderdetails`
]]></xml-property>
<structure name="designerState">
<property name="version">1.0</property>
<property name="stateContentAsString">&lt;?xml
version="1.0" encoding="UTF-8"?>&#13;
&lt;SQLQueryBuilder editorInputType="SQLBuilderStorageEditorInput"
name="Data Set" version="1.0">&#13;
&lt;SQLStatement>SELECT *&amp;#x0A; FROM
`mydb`.`orderdetails`&amp;#x0A;&lt;/SQLStatement>&#13;
&lt;connInfo>MySQL_5.1.0:mysqlclassic:mydb:root&lt;/connInfo >&#13;
&lt;omitSchemaInfo>false:true:&lt;/omitSchemaInfo>&#13;
&lt;editorInputUsageOptions>useWindowState=true&lt;/editorInputUsageOptions >&#13;
&lt;windowState height="478" version="1.0" width="687">&#13;
&lt;control height="145" isHideable="true" isVisible="true"
name="SQLSourceViewer" width="660"/>&#13;
&lt;control height="150" isHideable="true" isVisible="true"
name="DesignViewer" width="673"/>&#13;
&lt;control height="145" isHideable="true" isVisible="true"
name="GraphControl" width="665"/>&#13;
&lt;control height="149" isHideable="true" isVisible="false"
name="OutlineViewer" width="198"/>&#13;
&lt;/windowState>&#13;
&lt;/SQLQueryBuilder></property>
</structure>
<xml-property name="designerValues"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
<model:DesignValues
xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
<Version>1.0</Version>
<design:ResultSets derivedMetaData="true">
<design:resultSetDefinitions>
<design:resultSetColumns>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>orderNumber</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>11</design:precision>
<design:scale>0</design:scale>
<design:nullability>NotNullable</design:nullability>
<design:uiHints>
<design:displayName>orderNumber</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>orderNumber</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>productCode</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>NotNullable</design:nullability>
<design:uiHints>
<design:displayName>productCode</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>productCode</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>quantityOrdered</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>11</design:precision>
<design:scale>0</design:scale>
<design:nullability>NotNullable</design:nullability>
<design:uiHints>
<design:displayName>quantityOrdered</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>quantityOrdered</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>priceEach</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>8</design:nativeDataTypeCode>
<design:precision>22</design:precision>
<design:scale>31</design:scale>
<design:nullability>NotNullable</design:nullability>
<design:uiHints>
<design:displayName>priceEach</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>priceEach</design:label>
<design:formattingHints>
<design:displaySize>22</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>orderLineNumber</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>5</design:nativeDataTypeCode>
<design:precision>6</design:precision>
<design:scale>0</design:scale>
<design:nullability>NotNullable</design:nullability>
<design:uiHints>
<design:displayName>orderLineNumber</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>orderLineNumber</design:label>
<design:formattingHints>
<design:displaySize>6</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
</design:resultSetColumns>
<design:criteria>
<design:rowOrdering/>
</design:criteria>
</design:resultSetDefinitions>
</design:ResultSets>
</model:DesignValues>]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="report" id="4">
<property name="fontFamily">sans-serif</property>
<property name="fontSize">10pt</property>
</style>
<style name="crosstab-cell" id="5">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="crosstab" id="6">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table id="127">
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">orderNumber</property>
<text-property
name="displayName">orderNumber</text-property>
<expression name="expression"
type="javascript">dataSetRow["orderNumber"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">productCode</property>
<text-property
name="displayName">productCode</text-property>
<expression name="expression"
type="javascript">dataSetRow["productCode"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">quantityOrdered</property>
<text-property
name="displayName">quantityOrdered</text-property>
<expression name="expression"
type="javascript">dataSetRow["quantityOrdered"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">priceEach</property>
<text-property
name="displayName">priceEach</text-property>
<expression name="expression"
type="javascript">dataSetRow["priceEach"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property name="name">orderLineNumber</property>
<text-property
name="displayName">orderLineNumber</text-property>
<expression name="expression"
type="javascript">dataSetRow["orderLineNumber"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="156"/>
<column id="157"/>
<column id="158"/>
<column id="159"/>
<column id="160"/>
<header>
<row id="128">
<cell id="129">
<label id="130">
<text-property
name="text">orderNumber</text-property>
</label>
</cell>
<cell id="131">
<label id="132">
<text-property
name="text">productCode</text-property>
</label>
</cell>
<cell id="133">
<label id="134">
<text-property
name="text">quantityOrdered</text-property>
</label>
</cell>
<cell id="135">
<label id="136">
<text-property
name="text">priceEach</text-property>
</label>
</cell>
<cell id="137">
<label id="138">
<text-property
name="text">orderLineNumber</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="139">
<cell id="140">
<data id="141">
<property
name="resultSetColumn">orderNumber</property>
</data>
</cell>
<cell id="142">
<data id="143">
<property
name="resultSetColumn">productCode</property>
</data>
</cell>
<cell id="144">
<data id="145">
<property
name="resultSetColumn">quantityOrdered</property>
</data>
</cell>
<cell id="146">
<data id="147">
<property
name="resultSetColumn">priceEach</property>
</data>
</cell>
<cell id="148">
<data id="149">
<property
name="resultSetColumn">orderLineNumber</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="150">
<cell id="151"/>
<cell id="152"/>
<cell id="153"/>
<cell id="154"/>
<cell id="155"/>
</row>
</footer>
</table>
</body>
</report>


On 8/26/2010 12:40 AM, Kavitha wrote:
> On DataSource Test Connection i got below exception,
>
>
> org.eclipse.datatools.connectivity.oda.OdaException: Unable to find the
> connection profile referenced by the data source connection properties.
> at org.eclipse.birt.report.data.oda.jdbc.dbprofile.impl.Connect
> ion.open(Connection.java:97)
> at org.eclipse.birt.report.data.oda.jdbc.dbprofile.impl.Connect
> ion.open(Connection.java:57)
> at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaCo
> nnection.open(OdaConnection.java:238)
> at org.eclipse.datatools.connectivity.oda.profile.OdaConnection
> Wrapper.open(OdaConnectionWrapper.java:209)
> at org.eclipse.datatools.connectivity.oda.profile.OdaConnection Wrapper.
> <init>(OdaConnectionWrapper.java:59)
> at org.eclipse.datatools.connectivity.oda.profile.OdaConnection
> Factory.createConnection(OdaConnectionFactory.java:26)
> at org.eclipse.datatools.connectivity.internal.ConnectionFactor
> yProvider.createConnection(ConnectionFactoryProvider.java:83 )
> at org.eclipse.datatools.connectivity.internal.ConnectionProfil
> e.createConnection(ConnectionProfile.java:355)
> at org.eclipse.datatools.connectivity.ui.PingJob.createTestConn
> ection(PingJob.java:76)
> at org.eclipse.datatools.connectivity.oda.design.internal.ui.Da
> taSourceEditorPageCore$1.run(DataSourceEditorPageCore.java:6 08)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at org.eclipse.datatools.connectivity.ui.wizards.ProfileDetails
> PropertyPage.testConnection(ProfileDetailsPropertyPage.java: 98)
> at org.eclipse.datatools.connectivity.ui.wizards.ProfileDetails
> PropertyPage$1.widgetSelected(ProfileDetailsPropertyPage.jav a:80)
> at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe
> ner.java:228)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
> at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
> at org.eclipse.jface.window.Window.open(Window.java:801)
> at org.eclipse.birt.report.designer.ui.dialogs.BaseDialog.open(
> BaseDialog.java:110)
> at org.eclipse.birt.report.designer.data.ui.actions.EditDataSou
> rceAction.doAction(EditDataSourceAction.java:68)
> at org.eclipse.birt.report.designer.internal.ui.views.actions.A
> bstractElementAction.run(AbstractElementAction.java:70)
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
> at org.eclipse.jface.action.ActionContributionItem.handleWidget
> Selection(ActionContributionItem.java:584)
> at org.eclipse.jface.action.ActionContributionItem.access$2(Act
> ionContributionItem.java:501)
> at org.eclipse.jface.action.ActionContributionItem$5.handleEven
> t(ActionContributionItem.java:411)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault
> (Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work
> bench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at org.eclipse.ui.internal.ide.application.IDEApplication.start
> (IDEApplication.java:113)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips
> eAppHandle.java:194)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher
> .runApplication(EclipseAppLauncher.java:110)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher
> .start(EclipseAppLauncher.java:79)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:368)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>
>
>
> Please can you send me a sample report
Re: Connection profile store location [message #555911 is a reply to message #554420] Mon, 30 August 2010 08:22 Go to previous messageGo to next message
Kavitha is currently offline KavithaFriend
Messages: 10
Registered: August 2010
Junior Member
Can i create dynamic data source and set Property from the property file to resolve my problem? Sad
Re: Connection profile store location [message #556069 is a reply to message #555911] Mon, 30 August 2010 17:24 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Kavitha,

If you use the standard JDBC connection you can change any of the
properties at runtime using script or property binding. I am not
certain why the profile store method is not working for you. Did you
take a look at my example?

Jason



On 8/30/2010 4:22 AM, Kavitha wrote:
> Can i create dynamic data source and set Property from the property file
> to resolve my problem? :(
Re: Connection profile store location [message #556962 is a reply to message #554420] Fri, 03 September 2010 11:29 Go to previous messageGo to next message
Kavitha is currently offline KavithaFriend
Messages: 10
Registered: August 2010
Junior Member
Hi,
I don't know why its not working for me or i am doing some thing wrong.
Come to dynamic data source creation,

I have created a JDBC data source & given default development db and in the report beforeFactory i given like,

importPackage(Packages.java.util.Properties);
importPackage(Packages.java.io);
ds = reportContext.getDesignHandle().getDesign().findDataSource("Data Source");
property = new Properties();
property.load(new FileInputStream(reportContext.getDesignHandle().getResourceF older()+ "/Oracle_Profile"));
ds.setProperty( "odaDriverClass",property.getValue("odaDriverClass"));
ds.setProperty( "odaURL", property.getValue("odaURL"));
ds.setProperty( "odaUser", property.getValue("odaUser"));
ds.setProperty( "odaPassword", property.getValue("odaPassword"));
reportContext.getDesignHandle().getDesign().add(ds);

In while running report at run time i am reading from property file which has different db property.I am getting exceptions like below,

org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "importPackage(Packages.java.util.Properties); importPackage(Packages.java.io); ds = reportContext.getDesignHandle().getDesign().findDataSource("Data Source"); property = new Properties(); property.load(new FileInputStream(reportContext.getDesignHandle().getResourceF older()+ "/Oracle_Profile")); ds.setProperty( "odaDriverClass",property.getValue("odaDriverClass")); ds.setProperty( "odaURL", property.getValue("odaURL")); ds.setProperty( "odaUser", property.getValue("odaUser")); ds.setProperty( "odaPassword", property.getValue("odaPassword")); ": Function importPackage must be called with a package; had "[JavaClass java.util.Properties]" instead. (/report/method[@name="beforeFactory"]#1)

what could be the problem??????

Thank you,
Kavitha
Re: Connection profile store location [message #557015 is a reply to message #556962] Fri, 03 September 2010 15:25 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

This line:
importPackage(Packages.java.util.Properties);
should be
importPackage(Packages.java.util);

Jason

On 9/3/2010 7:29 AM, Kavitha wrote:
> Hi,
> I don't know why its not working for me or i am doing some thing wrong.
> Come to dynamic data source creation,
>
> I have created a JDBC data source & given default development db and in
> the report beforeFactory i given like,
>
> importPackage(Packages.java.util.Properties);
> importPackage(Packages.java.io);
> ds = reportContext.getDesignHandle().getDesign().findDataSource("Data
> Source");
> property = new Properties();
> property.load(new
> FileInputStream(reportContext.getDesignHandle().getResourceF older()+
> "/Oracle_Profile"));
> ds.setProperty( "odaDriverClass",property.getValue("odaDriverClass"));
> ds.setProperty( "odaURL", property.getValue("odaURL"));
> ds.setProperty( "odaUser", property.getValue("odaUser"));
> ds.setProperty( "odaPassword", property.getValue("odaPassword"));
> reportContext.getDesignHandle().getDesign().add(ds);
>
> In while running report at run time i am reading from property file
> which has different db property.I am getting exceptions like below,
>
> org.eclipse.birt.report.engine.api.EngineException: There are errors
> evaluating script "importPackage(Packages.java.util.Properties);
> importPackage(Packages.java.io); ds =
> reportContext.getDesignHandle().getDesign().findDataSource("Data
> Source"); property = new Properties(); property.load(new
> FileInputStream(reportContext.getDesignHandle().getResourceF older()+
> "/Oracle_Profile")); ds.setProperty(
> "odaDriverClass",property.getValue("odaDriverClass")); ds.setProperty(
> "odaURL", property.getValue("odaURL")); ds.setProperty( "odaUser",
> property.getValue("odaUser")); ds.setProperty( "odaPassword",
> property.getValue("odaPassword")); ": Function importPackage must be
> called with a package; had "[JavaClass java.util.Properties]" instead.
> (/report/method[@name="beforeFactory"]#1)
>
> what could be the problem??????
>
> Thank you,
> Kavitha
>
Re: Connection profile store location [message #557201 is a reply to message #554420] Mon, 06 September 2010 04:55 Go to previous messageGo to next message
Kavitha is currently offline KavithaFriend
Messages: 10
Registered: August 2010
Junior Member
Hi Jason,

I am getting some exception like below,

org.eclipse.birt.report.engine.api.EngineException: An exception occurred during processing. Please see the following message for details: Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc. org.eclipse.birt.report.data.oda.jdbc.JDBCException: Missing properties in Connection.open(Properties).

What could be the problem?
I created data source and i am using dev mode connections. before factory method of design i am reading connections from property file for production mode connections.

i have added one table and while executing i am getting above exception.

I am having few doubts about connection profile property binding please can you clear it.
1.While creating connection profile data source by default we need to give connection file name with out giving default connection file data source will not get created. how can i change it to accept dynamic file name.

[Updated on: Mon, 06 September 2010 10:46]

Report message to a moderator

Re: Connection profile store location [message #557460 is a reply to message #557201] Tue, 07 September 2010 13:54 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I did not see where you set the
OdaConnProfileStorePath property in your script.

Jason

On 9/6/2010 12:56 AM, Kavitha wrote:
> Hi Jason,
>
> I am getting some exception like below,
>
> org.eclipse.birt.report.engine.api.EngineException: An exception
> occurred during processing. Please see the following message for
> details: Cannot open the connection for the driver:
> org.eclipse.birt.report.data.oda.jdbc.
> org.eclipse.birt.report.data.oda.jdbc.JDBCException: Missing properties
> in Connection.open(Properties).
>
> What could be the problem?
> I created data source and i am using dev mode connections. before
> factory method of design i am reading connections from property file for
> production mode connections.
>
> i have added one table and while executing i am getting above exception.
Previous Topic:attach sources to BIRT jars
Next Topic:birt runtime 2.6 dependencies
Goto Forum:
  


Current Time: Fri Apr 19 21:55:26 GMT 2024

Powered by FUDForum. Page generated in 0.04614 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top