Print all records retrieved by the query find form [message #608221] |
Mon, 17 February 2014 12:39 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/0e34224d536ce6589f54f6b98a3d492f?s=64&d=mm&r=g) |
megha2525
Messages: 62 Registered: June 2012 Location: columbus
|
Member |
|
|
Hi All,
I am working on a query find form which has a start date , end date which are mandatory columns and find button on the control block. In addition to this there are Process ID , Process Name and Dept No items on the same control block which are optional columns. User need not enter the optional columns.
Based on the start date and end date , when the user clicks the Find button - all records are retrieved.
But the client requirement is that there must be a Print button which would enable the user to print all the records that are retrieved.
How can I copy them to an excel file or a PDF file ?
Please let me know.
Thanks
Megha
-------------------------------
Update : After further research I found that I could use the Reports option available to the Object Navigator. See the attached screenshot. So, I checked Base report on block and the Master Data block as the block name.
Also, changed the follwing on the property palette for that report
execution mode: Runtime
Report Destination type : screen
Communication mode: Synchronous
Data Source Data block : Name of the Master Data block
At this point , I am not sure how can I invoke this report when the form retrieves records.
Please let me know.
Thanks
Megha
-
Attachment: reprots.JPG
(Size: 22.90KB, Downloaded 914 times)
[Updated on: Mon, 17 February 2014 14:07] Report message to a moderator
|
|
|
|
|
Re: Print all records retrieved by the query find form [message #608239 is a reply to message #608229] |
Tue, 18 February 2014 01:09 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Last query looks like this:select ename, job, sal from emp where deptno = 10 and sal > 2000
You have to extract the WHERE part, so: find where the "WHERE" is (with INSTR function), and then extract it out of the "last query" with the SUBSTR function:
SQL> WITH test
2 AS (SELECT 'select ename, job, sal from emp where deptno = 10 and sal > 2000'
3 last_query
4 FROM DUAL)
5 SELECT INSTR (last_query, 'where') l_where,
6 SUBSTR (last_query, INSTR (last_query, 'where')) l_lex
7 FROM test;
L_WHERE L_LEX
---------- --------------------------------
33 where deptno = 10 and sal > 2000
SQL>
L_LEX is what you pass to the report and use as a lexical variable in report's query:
select ename, job, sal
from emp
&l_lex
|
|
|
Re: Print all records retrieved by the query find form [message #608315 is a reply to message #608239] |
Tue, 18 February 2014 10:07 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/0e34224d536ce6589f54f6b98a3d492f?s=64&d=mm&r=g) |
megha2525
Messages: 62 Registered: June 2012 Location: columbus
|
Member |
|
|
Thank you little foot.
I tried to fnd_request.submit_request ('FND', -- application
'COCN_PGM_SHORT_NAME',-- program short name
'', -- description
'', -- start time
FALSE, -- sub request
'Argument1', -- argument1
'Argument2', -- argument2
'N', -- argument3
NULL, -- argument4
NULL, -- argument5
'Argument6', -- argument6
CHR (0) -- represents end of arguments
);
The program short name is for the report process.
I guess this is the other way which did not work.
----------------------------------------------------------------------------------
But the one that you suggested, I want to get this right.
First I defined a report under the reports section in the object navigator of the forms builder tool.
Next, I try to get the last query that was executed on the form.
Next, how do I pass the lexical parameter to the report?
Do I use something like
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
BEGIN repid := FIND_REPORT_OBJECT('REPORT195');
v_rep := RUN_REPORT_OBJECT(repid);
END;
I am getting an error when I write the above code on a block level trigger. REPORT_OBJECT is not recognised.
All I am trying to do is get the records retrieved by the screen.
Under File -> Export , export is greyed out. How can I enable it ?
Thanks
Megha
[Updated on: Tue, 18 February 2014 10:09] Report message to a moderator
|
|
|
|
|
|
|
|