Skip to main content



      Home
Home » Archived » BIRT » How to advise db result=0 rows to Task object?
How to advise db result=0 rows to Task object? [message #199134] Sat, 04 November 2006 01:16 Go to next message
Eclipse UserFriend
Originally posted by: kamaljeet.sandhu.gmail.com

Hi all,

I need to communicate report has 0 rows as result of db query ( so the
blank report is not emailed in my case) to the task object .

basically the row count of the result needs to be advised back to the
report invoking appln.

Cannot seem to modify params or even object put into appContext from the
script - so can be read after task is run.

Any preferred way.

Pls advise as it is something obvious I am missing.

Thanks
Re: How to advise db result=0 rows to Task object? [message #199542 is a reply to message #199134] Mon, 06 November 2006 20:52 Go to previous messageGo to next message
Eclipse UserFriend
One way to do this is to modify the application context in script and then
after the report is executed get the appcontext and look for your value.

--beforeFactory
rwc =0;

--afterFactory

appcon = reportContext.getAppContext();

appcon.put("TESTCOUNT", rwc );


--Table row onCreate
rwc+=1;

----java--
task.run();

HashMap hm = (HashMap)task.getAppContext();

hm.get("TESTCOUNT");



May be a similar way but this works in 2.1.1


Jason

"Sandhu" <kamaljeet.sandhu@gmail.com> wrote in message
news:eihb8i$qhu$1@utils.eclipse.org...
> Hi all,
>
> I need to communicate report has 0 rows as result of db query ( so the
> blank report is not emailed in my case) to the task object .
>
> basically the row count of the result needs to be advised back to the
> report invoking appln.
>
> Cannot seem to modify params or even object put into appContext from the
> script - so can be read after task is run.
>
> Any preferred way.
>
> Pls advise as it is something obvious I am missing.
>
> Thanks
Re: How to advise db result=0 rows to Task object? [message #199606 is a reply to message #199542] Tue, 07 November 2006 06:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kamaljeet.sandhu.gmail.com

Hi Jason,

Tks for reply and this is what i'e been trying but in 2.0.0

In the dataSource(open) script was able to access
TestCount directly from appContext -
count=TestCount;

So I tried the same in DataSource(fetch)-
TestCount= rowCount;

but this did not change the TestCount in appContext
after running. :(

I think reportContext not avaible in 2.0.0 ?

Can you advise if this works ( or any other )in 2.0.0 ..
as I really would like to avoid an upgrade if possible .

Best Regards,
Sandhu




Jason Weathersby wrote:
> One way to do this is to modify the application context in script and then
> after the report is executed get the appcontext and look for your value.
>
> --beforeFactory
> rwc =0;
>
> --afterFactory
>
> appcon = reportContext.getAppContext();
>
> appcon.put("TESTCOUNT", rwc );
>
>
> --Table row onCreate
> rwc+=1;
>
> ----java--
> task.run();
>
> HashMap hm = (HashMap)task.getAppContext();
>
> hm.get("TESTCOUNT");
>
>
>
> May be a similar way but this works in 2.1.1
>
>
> Jason
>
> "Sandhu" <kamaljeet.sandhu@gmail.com> wrote in message
> news:eihb8i$qhu$1@utils.eclipse.org...
>
>>Hi all,
>>
>>I need to communicate report has 0 rows as result of db query ( so the
>>blank report is not emailed in my case) to the task object .
>>
>>basically the row count of the result needs to be advised back to the
>>report invoking appln.
>>
>>Cannot seem to modify params or even object put into appContext from the
>>script - so can be read after task is run.
>>
>>Any preferred way.
>>
>>Pls advise as it is something obvious I am missing.
>>
>>Thanks
>
>
>
Re: How to advise db result=0 rows to Task object? [message #199607 is a reply to message #199606] Tue, 07 November 2006 06:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kamaljeet.sandhu.gmail.com

Sorry DataSet(fetch) not DataSource(fetch).


Sandhu wrote:
> Hi Jason,
>
> Tks for reply and this is what i'e been trying but in 2.0.0
>
> In the dataSource(open) script was able to access
> TestCount directly from appContext -
> count=TestCount;
>
> So I tried the same in DataSource(fetch)-
> TestCount= rowCount;
>
> but this did not change the TestCount in appContext
> after running. :(
>
> I think reportContext not avaible in 2.0.0 ?
>
> Can you advise if this works ( or any other )in 2.0.0 ..
> as I really would like to avoid an upgrade if possible .
>
> Best Regards,
> Sandhu
>
>
>
>
> Jason Weathersby wrote:
>
>> One way to do this is to modify the application context in script and
>> then after the report is executed get the appcontext and look for your
>> value.
>>
>> --beforeFactory
>> rwc =0;
>>
>> --afterFactory
>>
>> appcon = reportContext.getAppContext();
>>
>> appcon.put("TESTCOUNT", rwc );
>>
>>
>> --Table row onCreate
>> rwc+=1;
>>
>> ----java--
>> task.run();
>>
>> HashMap hm = (HashMap)task.getAppContext();
>>
>> hm.get("TESTCOUNT");
>>
>>
>>
>> May be a similar way but this works in 2.1.1
>>
>>
>> Jason
>>
>> "Sandhu" <kamaljeet.sandhu@gmail.com> wrote in message
>> news:eihb8i$qhu$1@utils.eclipse.org...
>>
>>> Hi all,
>>>
>>> I need to communicate report has 0 rows as result of db query ( so
>>> the blank report is not emailed in my case) to the task object .
>>>
>>> basically the row count of the result needs to be advised back to the
>>> report invoking appln.
>>>
>>> Cannot seem to modify params or even object put into appContext from
>>> the script - so can be read after task is run.
>>>
>>> Any preferred way.
>>>
>>> Pls advise as it is something obvious I am missing.
>>>
>>> Thanks
>>
>>
>>
>>
Re: How to advise db result=0 rows to Task object? [message #199611 is a reply to message #199606] Tue, 07 November 2006 11:19 Go to previous messageGo to next message
Eclipse UserFriend
reportContext is available in 2.0.0.
The example code I posted should work in 2.0.0.
Try building the same example. Notice I incremented the count on the table
where the row was created.
I did this because this is the actual output. A data set can be called
multiple times and filtered out, so I put it on the
output. If you have issues with the source I posted send me your report and
I can look at it.

Jason

"Sandhu" <kamaljeet.sandhu@gmail.com> wrote in message
news:eipqer$bqj$1@utils.eclipse.org...
> Hi Jason,
>
> Tks for reply and this is what i'e been trying but in 2.0.0
>
> In the dataSource(open) script was able to access
> TestCount directly from appContext -
> count=TestCount;
>
> So I tried the same in DataSource(fetch)-
> TestCount= rowCount;
>
> but this did not change the TestCount in appContext
> after running. :(
>
> I think reportContext not avaible in 2.0.0 ?
>
> Can you advise if this works ( or any other )in 2.0.0 ..
> as I really would like to avoid an upgrade if possible .
>
> Best Regards,
> Sandhu
>
>
>
>
> Jason Weathersby wrote:
>> One way to do this is to modify the application context in script and
>> then after the report is executed get the appcontext and look for your
>> value.
>>
>> --beforeFactory
>> rwc =0;
>>
>> --afterFactory
>>
>> appcon = reportContext.getAppContext();
>>
>> appcon.put("TESTCOUNT", rwc );
>>
>>
>> --Table row onCreate
>> rwc+=1;
>>
>> ----java--
>> task.run();
>>
>> HashMap hm = (HashMap)task.getAppContext();
>>
>> hm.get("TESTCOUNT");
>>
>>
>>
>> May be a similar way but this works in 2.1.1
>>
>>
>> Jason
>>
>> "Sandhu" <kamaljeet.sandhu@gmail.com> wrote in message
>> news:eihb8i$qhu$1@utils.eclipse.org...
>>
>>>Hi all,
>>>
>>>I need to communicate report has 0 rows as result of db query ( so the
>>>blank report is not emailed in my case) to the task object .
>>>
>>>basically the row count of the result needs to be advised back to the
>>>report invoking appln.
>>>
>>>Cannot seem to modify params or even object put into appContext from the
>>>script - so can be read after task is run.
>>>
>>>Any preferred way.
>>>
>>>Pls advise as it is something obvious I am missing.
>>>
>>>Thanks
>>
>>
Re: How to advise db result=0 rows to Task object? [message #199944 is a reply to message #199611] Thu, 09 November 2006 05:06 Go to previous message
Eclipse UserFriend
Originally posted by: kamaljeet.sandhu.gmail.com

Thanks a ton Jason....it just Works.


Jason Weathersby wrote:
> reportContext is available in 2.0.0.
> The example code I posted should work in 2.0.0.
> Try building the same example. Notice I incremented the count on the table
> where the row was created.
> I did this because this is the actual output. A data set can be called
> multiple times and filtered out, so I put it on the
> output. If you have issues with the source I posted send me your report and
> I can look at it.
>
> Jason
>
> "Sandhu" <kamaljeet.sandhu@gmail.com> wrote in message
> news:eipqer$bqj$1@utils.eclipse.org...
>
>>Hi Jason,
>>
>>Tks for reply and this is what i'e been trying but in 2.0.0
>>
>>In the dataSource(open) script was able to access
>>TestCount directly from appContext -
>>count=TestCount;
>>
>>So I tried the same in DataSource(fetch)-
>>TestCount= rowCount;
>>
>>but this did not change the TestCount in appContext
>>after running. :(
>>
>>I think reportContext not avaible in 2.0.0 ?
>>
>>Can you advise if this works ( or any other )in 2.0.0 ..
>>as I really would like to avoid an upgrade if possible .
>>
>>Best Regards,
>>Sandhu
>>
>>
>>
>>
>>Jason Weathersby wrote:
>>
>>>One way to do this is to modify the application context in script and
>>>then after the report is executed get the appcontext and look for your
>>>value.
>>>
>>>--beforeFactory
>>>rwc =0;
>>>
>>>--afterFactory
>>>
>>>appcon = reportContext.getAppContext();
>>>
>>>appcon.put("TESTCOUNT", rwc );
>>>
>>>
>>>--Table row onCreate
>>>rwc+=1;
>>>
>>>----java--
>>>task.run();
>>>
>>>HashMap hm = (HashMap)task.getAppContext();
>>>
>>>hm.get("TESTCOUNT");
>>>
>>>
>>>
>>>May be a similar way but this works in 2.1.1
>>>
>>>
>>>Jason
>>>
>>>"Sandhu" <kamaljeet.sandhu@gmail.com> wrote in message
>>>news:eihb8i$qhu$1@utils.eclipse.org...
>>>
>>>
>>>>Hi all,
>>>>
>>>>I need to communicate report has 0 rows as result of db query ( so the
>>>>blank report is not emailed in my case) to the task object .
>>>>
>>>>basically the row count of the result needs to be advised back to the
>>>>report invoking appln.
>>>>
>>>>Cannot seem to modify params or even object put into appContext from the
>>>>script - so can be read after task is run.
>>>>
>>>>Any preferred way.
>>>>
>>>>Pls advise as it is something obvious I am missing.
>>>>
>>>>Thanks
>>>
>>>
>
Previous Topic:Urgent problem with BIRD'S background image - please HELP
Next Topic:How to add properties and structure to a DataSet object ??
Goto Forum:
  


Current Time: Wed Jun 04 21:52:07 EDT 2025

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

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

Back to the top