Forms + Reports problems...

From: Donald Raymond Lloyd II <don_at_copland.udel.edu>
Date: 1997/10/09
[Quoted] [Quoted] Message-ID: <61k2b5$r3i$1_at_copland.udel.edu>#1/1


[Quoted] I've got a forms 4.5 application that I'm using to print or preview a reports [Quoted] 2.5 document. My first problem with reports is that I want the user to be [Quoted] able to click a button and print or preview a report without having to go [Quoted] through the paramater entry screen. This works when I'm sending the file [Quoted] directly to the printer in batch mode, but for previews, the screen comes [Quoted] up even though I pass a parameter setting PRINTJOB to 'NO'. Sometimes when the form comes up, it appears _behind_ the form that called it; then [Quoted] the user never sees it and clicks the button a few more times wondering [Quoted] why it's not working...

The second problem occurs when passing parameters to a report. In my application I have a main data entry/edit form and a 'Filter' form that's [Quoted] used to essentially build the 'where' and 'from' clauses for a query that's used to populate the main form. There's also a report form that gets called & is passed the 'where' and 'from' values. From the report form, the user selects a field to order by from a list box and enters a description of the report to be printed in its header.

The report is passed four user-defined parameters, all strings: FROMCLAUSE, [Quoted] WHERECLAUSE, ORDERBY, and COMMENT. The query that the report is based on [Quoted] looks like this:

	select  DECODE(ACTIVE, 'Y', 'YES', 'N', 'NO') Status

, ARCHIVE_DATE
, decode( BOND_WAIVER, 'Y', 'B', null) BOND_WAIVER
, decode( INV_WAIVER, 'Y', 'I', null) INV_WAIVER
, decode( SURETY_WAIVER, 'Y', 'S', null) SURETY_WAIVER
, decode( ACCT_WAIVER, 'Y', 'A', null) ACCT_WAIVER
, CREATION_DATE
, rtrim(ltrim( CREATOR_LNAME || ' ' || CREATOR_FI || ' ' ||
CREATOR_MI)) Creator
, hc.description HowCreated
, LAST_ACT_DATE
, ORIG_PRINC
, tr.TRUST_ID
, TRUST_NUMBER
,cv.amount currentvalue from TRUSTS tr, how_created hc, currentvalues cv where t.trust_id in (select distinct t.trust_id from &fromclause where &whereclause) and tr.how_created = hc.hc_id (+) and tr.trust_id = cv.trust_id (+) order by &orderby;

FROMCLAUSE and WHERECLAUSE default to 'trusts t' and 't.trust_id is not null' [Quoted] in the case where no specific filter criteria has been specified. If the [Quoted] report is run with the defaults, it happily churns out several hundred pages [Quoted] of data. However, as soon as I specify a filter, thus changing WHERECLAUSE [Quoted] and sometimes FROMCLAUSE, then try to look at a report, Reports Server starts up but nothing prints, the parameters screen doesn't pop up, and nothing shows up in the reports server log. Trying to print in batch mode [Quoted] also seems to do nothing.

I've used the debugger to check the values of the parameters just before run_product is called - they're valid. I've verified that the sizes of the paramters are declared the same on both sides. The query that's built [Quoted] is a valid one; I know this because (a) a similar query has been built to [Quoted] successfully populate the main form, (b) if I paste the above query into SQLPlus, substituting the paramters appropriately, and run the query, it returns the expected values, and (c) if I run the report manually from the designer and paste the appropriate values into the paramter entry screen, the report runs without a hitch. It's only when called from Forms [Quoted] [Quoted] that the problem occurs...

Any ideas?

-- 
Don Lloyd    don_at_udel.edu 
Visit Six In A Mustang  http://www.geocities.com/MotorCity/Downs/8895
Received on Thu Oct 09 1997 - 00:00:00 CEST

Original text of this message