Re: Reports 6i - query returns no data

From: <pehaw_at_my-deja.com>
Date: Mon, 15 Jan 2001 10:11:18 GMT
Message-ID: <93uic4$2l3$1_at_nnrp1.deja.com>


[Quoted] OK thanks for your help -

I Don't really want to do option 1 or 2. I have lots of reports to convert and this may result in a lot of duplicated code.

I have tried option 3 and this works great. Is there a way of detecting the REP-1825 message from Reports stating that BEFORE_REPORT trigger returned false? (similar to ON-ERROR/ON-MESSAGE in forms).

In article <FQp86.5236$J%.529374_at_news.flash.net>,   "Eric Givler" <egivler_at_flash.net> wrote:
> two suggestions come to mind:
> 1) accept the parameters and in a before-report trigger, pass the
 parms to a
> stored procedure that builds a ref cursor the same as the report.
 Open the
> cursor and fetch 1 row. If you fetch a row, great, return (true).
 If not,
> return (false) and the report will stop. Prior to returning false,
 use the
> srw.message to display an error dialog "report returned no data" or
> something similar.
>
> 2) do the same thing in a driving form and display the error prior to
> starting the report, and ask the user to change the parameters.
>
> 3) Create a report level "counter" that summarizes on the entire
 report.
> Make it use Count as it's function and count the primary key column
 (or any
> column for that matter). Put a before report trigger that references
 this
> counter, ie.
>
> if :my_report_counter = 0 then
> srw.message('no rows found');
> return (false);
> else
> return (true);
> end if;
>
> -- it will take a little longer to run with this as the entire
 report
> has to be generated because you've based a counter on it and are
 using it in
> the before-report - ie. it has to count all the rows, but returning
 true if
> you found rows is good because now the report will display ok. The
 false
> causes it to stop. You'll get the error about the before report
 trigger
> returning false, but the message will be displayed and you exit back
 to the
> form.
>
> Let me know if any of this made sense or was helpful.
> That will be 25 cents please... ;)
>
> <pehaw_at_my-deja.com> wrote in message
 news:93s19o$5ts$1_at_nnrp1.deja.com...
> > Hello,
> >
> > I'm converting lots of Microsoft Access 2.0
> > reports to Oracle Reports 6i on NT.
> >
> > I have a very simple request - how do i detect
> > when a query in Reports selects no rows? I am
> > passing parameters to Reports 6i from Forms 6i
> > and, obviously, this may or may not result in
> > data being selected by the queries in Reports.
> >
> > If no rows are returned, I need to do action X,
> > if rows are returned then display the Report as
> > normal.
> >
> > Thanks for any help
>
>

Sent via Deja.com
http://www.deja.com/ Received on Mon Jan 15 2001 - 11:11:18 CET

Original text of this message