Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » relative address to profiles
relative address to profiles [message #368939] Tue, 07 July 2009 21:35 Go to next message
Mira is currently offline MiraFriend
Messages: 28
Registered: July 2009
Junior Member
Hello,

We would like to use relative address for profiles in reports. Currently
absolute address is used, and this is not working for us when moving
files from development machine to test or production.
Currently, we have number of reports that we would like to move to
production, but in order to do so, sys admin must change location for
each report.

Can someone point me to right direction how to change location of profiles?

Thanks a lot for your help,

Mira
Re: relative address to profiles [message #368940 is a reply to message #368939] Wed, 08 July 2009 00:21 Go to previous messageGo to next message
Linda ChanFriend
Messages: 845
Registered: July 2009
Senior Member
Mira,

I presume you are referring to connection profiles?
You can use a variable to adjust the root path of a connection profile store
file via its Property Binding.
To do this, in BIRT "Edit Data Source" dialog, select the "Property Binding"
node page, and enter a JavaScript expression in the "Connection Profile
Store URL" property.

The JavaScript expression can include a variable to specify the root path.
The variable will then be resolved at runtime according to the configuration
of your deployment environment. Thus no need to change the Property Binding
expression in your report designs when they are deployed in different
environments.

There are multiple alternate variables that can be used to specify the root
path.

1) The JavaScript expression can refer to any BIRT config[] variable. For
example,

config[ "birt.viewer.working.path" ] + "../../data/myProfiles.dat"

2) A JavaScript expression can also refer to BIRT reportContext global
variable.

It can specify a BIRT Viewer's BIRT_RESOURCE_PATH (whose value is defined by
user in web.xml) via the BIRT reportContext variable. For example,

reportContext.getAppContext().get("birt.viewer.resource.path ") +
"../data/myProfiles.dat"

3) Yet another option, the JavaScript expression can also refer to a BIRT
registered resource locator to look up a resource URL. For example,

reportContext.getResource( "myProfiles.dat" )

Hope this helps.
Linda
Re: relative address to profiles [message #368949 is a reply to message #368940] Wed, 08 July 2009 22:48 Go to previous messageGo to next message
Mira is currently offline MiraFriend
Messages: 28
Registered: July 2009
Junior Member
Linda Chan wrote:

> Mira,

> I presume you are referring to connection profiles?
> You can use a variable to adjust the root path of a connection profile store
> file via its Property Binding.
> To do this, in BIRT "Edit Data Source" dialog, select the "Property Binding"
> node page, and enter a JavaScript expression in the "Connection Profile
> Store URL" property.

> The JavaScript expression can include a variable to specify the root path.
> The variable will then be resolved at runtime according to the configuration
> of your deployment environment. Thus no need to change the Property Binding
> expression in your report designs when they are deployed in different
> environments.

> There are multiple alternate variables that can be used to specify the root
> path.

> 1) The JavaScript expression can refer to any BIRT config[] variable. For
> example,

> config[ "birt.viewer.working.path" ] + "../../data/myProfiles.dat"

> 2) A JavaScript expression can also refer to BIRT reportContext global
> variable.

> It can specify a BIRT Viewer's BIRT_RESOURCE_PATH (whose value is defined by
> user in web.xml) via the BIRT reportContext variable. For example,

> reportContext.getAppContext().get("birt.viewer.resource.path ") +
> "../data/myProfiles.dat"

> 3) Yet another option, the JavaScript expression can also refer to a BIRT
> registered resource locator to look up a resource URL. For example,

> reportContext.getResource( "myProfiles.dat" )

> Hope this helps.
> Linda
Thanks a lot for quick reply. That's exactly what I need.

Mira
Re: relative address to profiles [message #736029 is a reply to message #368939] Thu, 13 October 2011 11:57 Go to previous messageGo to next message
Ronak  is currently offline Ronak Friend
Messages: 1
Registered: July 2011
Junior Member
Hi,

I had created the Template using BIRT and Connection Profile (datasoure).
The template works fine for me.

But when I send the report to user he need to change the connection profile path of his location...which is not good.

What I want is that when the template used by user the profile path it should find himself. I thik here we need to use the relative path.

I dnt know how to use this.

can anyone help me in this. My connection profile name is xsProfile and I am using BIRT 3.7

Thanks
Re: relative address to profiles [message #736103 is a reply to message #736029] Thu, 13 October 2011 15:21 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Ronak,

You could always put the connection profile in the resource folder and
in the beforeOpen script of the data source use a script like:

myresourcefolder = reportContext.getDesignHandle().getResourceFolder();
this.setExtensionProperty("OdaConnProfileStorePath",
myresourcefolder+"/myprofile.dat");


Jason

On 10/13/2011 7:57 AM, Ronak wrote:
> Hi,
>
> I had created the Template using BIRT and Connection Profile (datasoure).
> The template works fine for me.
>
> But when I send the report to user he need to change the connection
> profile path of his location...which is not good.
>
> What I want is that when the template used by user the profile path it
> should find himself. I thik here we need to use the relative path.
>
> I dnt know how to use this.
>
> can anyone help me in this. My connection profile name is xsProfile and
> I am using BIRT 3.7
>
> Thanks
Previous Topic:Combining custom emitters and report items
Next Topic:Office 2010 Emitters
Goto Forum:
  


Current Time: Tue Mar 19 03:05:48 GMT 2024

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

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

Back to the top