Skip to main content



      Home
Home » Archived » BIRT » Custom Driver: Access to Report Parameters
Custom Driver: Access to Report Parameters [message #258040] Fri, 12 October 2007 05:46 Go to next message
Eclipse UserFriend
Hi everybody,

I developed a custom driver. Now I need access to the Values of any
ReportParameters. Is there a way to do this from within the wizard pages
of a dataset?

I can't seem to find any way to access these Parameters.

Thanks for your suggestions

Franzi
Re: Custom Driver: Access to Report Parameters [message #258238 is a reply to message #258040] Fri, 12 October 2007 20:00 Go to previous messageGo to next message
Eclipse UserFriend
Franzi,

By "values of any report parameters", I presume you meant their default
values, since a data set wizard page has access to design definition only,
not their runtime values.
In your extended DataSetWizardPage, you can call the inherited method
getInitializationDesign( ) to get the DataSetDesign object updated by the
BIRT host that reflects the current state of a data set definition, as
edited within the BIRT designer. So if your data set parameter has been
linked to a report parameter, its default value will be reflected as the
default value of the data set parameter definition.
See the org.eclipse.datatools.connectivity.oda.design API doc or its
model/DesignXML.xsd in the source for more info on how to access a data set
parameter definition within a DataSetDesign object.

Linda


"franzi" <franzi.haeger@gmail.com> wrote in message
news:1a350e6f350c5f31dcdd2907ca7cace3$1@www.eclipse.org...
> Hi everybody,
>
> I developed a custom driver. Now I need access to the Values of any
> ReportParameters. Is there a way to do this from within the wizard pages
> of a dataset?
>
> I can't seem to find any way to access these Parameters.
> Thanks for your suggestions
>
> Franzi
>
Re: Custom Driver: Access to Report Parameters [message #258293 is a reply to message #258238] Mon, 15 October 2007 06:55 Go to previous messageGo to next message
Eclipse UserFriend
Hi Linda,

thanks for the reply. Yes I meant the default Values of the Parameters,
but I did not want to access them via the DataSetParameters. Actually I
need the default values of all ReportParameters in my Plugin. Is there a
way to get these? Or do I have to use DataSetParameters?

And is there a way to acces the actual ReportParameter Values from within
my runtime Plugin?

I do have a Problem with the DataSetParameters too. Whenever I actually
use one in a DataSet my ResultSet seems to only have one unnamed Column. I
can't figure this Problem out either.

Thanks Franzi
Re: Custom Driver: Access to Report Parameters [message #258385 is a reply to message #258293] Mon, 15 October 2007 12:13 Go to previous messageGo to next message
Eclipse UserFriend
Franzi,

I have an example of an ODA that uses DataSetParameters from both runtime
and designtime plug-ins. I have placed it up on my Subversion server. You
can get read-access to the code at the following SVN repository:

http://longlake.minnovent.com/repos/birt_example.

The projects that you will need are:
http://longlake.minnovent.com/repos/birt_example/gdata_1_14/
http://longlake.minnovent.com/repos/birt_example/google_desi gner/
http://longlake.minnovent.com/repos/birt_example/google_runt ime/

Scott Rosenbaum



> Actually I need the default values of all ReportParameters in my
> Plugin. Is there a way to get these? Or do I have to use
> DataSetParameters?
>
Re: Custom Driver: Access to Report Parameters [message #258432 is a reply to message #258293] Mon, 15 October 2007 20:19 Go to previous messageGo to next message
Eclipse UserFriend
Franzi,

>> I need the default values of all ReportParameters in my Plugin. Is there
>> a way to get these? Or do I have to use DataSetParameters?

From the ODA framework architecture perspective, since a custom driver or
its UI is supposed to be consumable by any ODA consumer application, they
should only be exposed to info related to its own data source and data set.
So in this case, only those parameters associated with its data set, and not
with a component that are specific to one ODA consumer application, such as
a BIRT report parameter.
Therefore, only when a BIRT report parameter is linked to a data set
parameter, its related info can then be visible to a custom ODA
driver/designer thru its data set parameters.

>> is there a way to acces the actual ReportParameter Values from within my
>> runtime Plugin?
The ODA runtime interfaces supports pass-through of a consumer application
specific context object, using the setAppContext method in oda IDriver,
IConnection and IQuery. The content of an appContext object can be set with
the BIRT engine API. See link for related spec:
http://wiki.eclipse.org/BPS35

>> Whenever I actually use one in a DataSet my ResultSet seems to only have
>> one unnamed Column
It sounds like there may be a runtime exception when trying to access your
driver's result set metadata. The best way is to use the debugger, and step
thru your implementation around IResultSet.getMetaData.

Linda

"franzi" <franzi.haeger@gmail.com> wrote in message
news:509a9c10b2037449b6680086379ffc4f$1@www.eclipse.org...
> Hi Linda,
>
> thanks for the reply. Yes I meant the default Values of the Parameters,
> but I did not want to access them via the DataSetParameters. Actually I
> need the default values of all ReportParameters in my Plugin. Is there a
> way to get these? Or do I have to use DataSetParameters?
> And is there a way to acces the actual ReportParameter Values from within
> my runtime Plugin?
> I do have a Problem with the DataSetParameters too. Whenever I actually
> use one in a DataSet my ResultSet seems to only have one unnamed Column. I
> can't figure this Problem out either.
>
> Thanks Franzi
>
Re: Custom Driver: Access to Report Parameters [message #258435 is a reply to message #258432] Tue, 16 October 2007 04:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

thanks again for your answers they are really helpful.

Linda Chan wrote:


>>> I need the default values of all ReportParameters in my Plugin. Is there
>>> a way to get these? Or do I have to use DataSetParameters?

> From the ODA framework architecture perspective, since a custom driver or
> its UI is supposed to be consumable by any ODA consumer application, they
> should only be exposed to info related to its own data source and data set.
> So in this case, only those parameters associated with its data set, and not
> with a component that are specific to one ODA consumer application, such as
> a BIRT report parameter.
> Therefore, only when a BIRT report parameter is linked to a data set
> parameter, its related info can then be visible to a custom ODA
> driver/designer thru its data set parameters.

I wasn't really aware of this concept until now. Thanks.

>>> is there a way to acces the actual ReportParameter Values from within my
>>> runtime Plugin?
> The ODA runtime interfaces supports pass-through of a consumer application
> specific context object, using the setAppContext method in oda IDriver,
> IConnection and IQuery. The content of an appContext object can be set with
> the BIRT engine API. See link for related spec:
> http://wiki.eclipse.org/BPS35

This is the way I'm working when I create the reports from within my
Application. I'm passing the values of the Parameters via the
setAppContext method. The Problem is that I want to have the same behavior
and reports when they are created from within the ReportDesigner. But I
can't seem to find a way to do this.

>>> Whenever I actually use one in a DataSet my ResultSet seems to only have
>>> one unnamed Column
> It sounds like there may be a runtime exception when trying to access your
> driver's result set metadata. The best way is to use the debugger, and step
> thru your implementation around IResultSet.getMetaData.

I tried to debug this behavior but could not find the Problem. My Metadata
and ResultSet are filled and read correctly. They have all the columns and
entries I expected from the query but somewehre between the reading of
these and the presentation in the preview or the columns (I couldn't yet
figure out where exactly) it seems to mix up somehow ending up with just
one unnamed_1 column that shows the entries of the first column of the
result set.

Thanks a lot and greetings from Berlin

Franzi
> Linda

> "franzi" <franzi.haeger@gmail.com> wrote in message
> news:509a9c10b2037449b6680086379ffc4f$1@www.eclipse.org...
>> Hi Linda,
>>
>> thanks for the reply. Yes I meant the default Values of the Parameters,
>> but I did not want to access them via the DataSetParameters. Actually I
>> need the default values of all ReportParameters in my Plugin. Is there a
>> way to get these? Or do I have to use DataSetParameters?
>> And is there a way to acces the actual ReportParameter Values from within
>> my runtime Plugin?
>> I do have a Problem with the DataSetParameters too. Whenever I actually
>> use one in a DataSet my ResultSet seems to only have one unnamed Column. I
>> can't figure this Problem out either.
>>
>> Thanks Franzi
>>
Re: Custom Driver: Access to Report Parameters [message #258436 is a reply to message #258385] Tue, 16 October 2007 04:57 Go to previous messageGo to next message
Eclipse UserFriend
Scott Rosenbaum wrote:

> Franzi,

> I have an example of an ODA that uses DataSetParameters from both runtime
> and designtime plug-ins. I have placed it up on my Subversion server. You
> can get read-access to the code at the following SVN repository:

> http://longlake.minnovent.com/repos/birt_example.

> The projects that you will need are:
> http://longlake.minnovent.com/repos/birt_example/gdata_1_14/
> http://longlake.minnovent.com/repos/birt_example/google_desi gner/
> http://longlake.minnovent.com/repos/birt_example/google_runt ime/

> Scott Rosenbaum

Thanks a lot Scott I will have a look at this in the next few days.

Greetings form Berlin

Franzi
Re: Custom Driver: Access to Report Parameters [message #258537 is a reply to message #258435] Tue, 16 October 2007 19:42 Go to previous messageGo to next message
Eclipse UserFriend
Franzi,

> The Problem is that I want to have the same behavior and reports when they
> are created from within the ReportDesigner. But I can't seem to find a way
> to do this.

Running/generating a report output within the report designer uses the BIRT
runtime engine. So the setAppContext() interfaces do get used. Perhaps you
are referring to designing a report, and while editing your data set in your
custom ODA designer pages? If so, the use of setAppContext would not apply.
And for the reasons described earlier, it is a better design to associate a
BIRT report parameter to your data set parameter. This way, their default
values are available at design-time; and runtime values are available via
the oda IQuery's setter methods at runtime.

>>somewehre between the reading of
> these and the presentation in the preview or the columns (I couldn't yet
> figure out where exactly) it seems to mix up somehow ending up with just
> one unnamed_1 column that shows the entries of the first column of the
> result set.

Are your ODA UI plugin implementation based on the code generated by the ODA
project wizard? If so, try to step through the code in your
CustomDataSetWizardPage. In particular, this method:
updateDesign( DataSetDesign dataSetDesign, IConnection conn, String
queryText )

The generated code has some assumptions on what your ODA runtime driver
would return. Perhaps some runtime exceptions occur here if those
assumptions are not met.

Linda
Re: Custom Driver: Access to Report Parameters [message #258596 is a reply to message #258537] Wed, 17 October 2007 08:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi Linda,

Linda Chan wrote:

> Franzi,

>> The Problem is that I want to have the same behavior and reports when they
>> are created from within the ReportDesigner. But I can't seem to find a way
>> to do this.

> Running/generating a report output within the report designer uses the BIRT
> runtime engine. So the setAppContext() interfaces do get used.
But how can I call the setAppContextMethods() from within the
ReportDesigner? I'm kind of confused here. How can I set the AppContext
when I create a Report by pushing the create Button in my ReportDesigner?
I thought that everything that would be called is part of my Plugins.
Using the DataSet Parameters would be nicer but there is still the other
Problem:

>>>somewehre between the reading of
>> these and the presentation in the preview or the columns (I couldn't yet
>> figure out where exactly) it seems to mix up somehow ending up with just
>> one unnamed_1 column that shows the entries of the first column of the
>> result set.

> Are your ODA UI plugin implementation based on the code generated by the ODA
> project wizard? If so, try to step through the code in your
> CustomDataSetWizardPage. In particular, this method:
> updateDesign( DataSetDesign dataSetDesign, IConnection conn, String
> queryText )

> The generated code has some assumptions on what your ODA runtime driver
> would return. Perhaps some runtime exceptions occur here if those
> assumptions are not met.

Yes they are generated by the project wizard. What makes me wonder is that
everything is fine until I use DataSet-Parameters. A Query without
parameters shows the right results. Using a parameter instantly ets the
result have only one column_1. This happens even if the parameter does'nt
actually affect the query (Queries are in xml, this way a parameter will
not be interpreted if it is wirtten in between tags.

Stepping through didn't show any exception until now. But I still hope to
find something somewhere.

Thanks Franzi
Re: Custom Driver: Access to Report Parameters [message #258889 is a reply to message #258596] Fri, 19 October 2007 14:47 Go to previous message
Eclipse UserFriend
Franzi,

>> How can I set the AppContext
> when I create a Report by pushing the create Button in my ReportDesigner?

I'm not sure what you meant by the "create button". Do you mean the Preview
tab?
To set the appcontext before previewing, here is a wiki link:
http://wiki.eclipse.org/Adding_an_Object_to_the_Application_ Context_for_the_Viewer_%28BIRT%29

Linda
Previous Topic:"Allow Multiple Values" Parameter and disable filter
Next Topic:Report API help
Goto Forum:
  


Current Time: Sun Jul 27 07:05:38 EDT 2025

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

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

Back to the top