HOW TO CALL A DYNAMIC REPORT FROM FORMS [message #77851] |
Tue, 04 December 2001 02:17 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
UMA MAHESWARA RAO
Messages: 9 Registered: December 2001
|
Junior Member |
|
|
HELLO,
I HAVE TO GENERATE A REPORT FROM A TEMPORARY FORM FIELDS.
I WILL ELOBORATE IT -
I HAVE A FORM IN WHICH THE USER WILL BE ENTERING SOME
INFORMATION.BASING ON THIS INFO WHEN A BUTTON IS PRESSED,A REPORT SHOULD BE RUN WITH THE INFO WHICH HAS BEEN FED,THERE CAN BE EMPTY FIELDS ALSO.
THANKS IN ADVANCE.
UMA
----------------------------------------------------------------------
|
|
|
Re: HOW TO CALL A DYNAMIC REPORT FROM FORMS [message #77854 is a reply to message #77851] |
Tue, 04 December 2001 06:42 ![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) |
Shilpa
Messages: 59 Registered: November 2001
|
Member |
|
|
Try creating a parameter list and pass that list when you call the report.
For example the following code will pass empno and deptno variables to myreport whose values come from the fields in the control block :
DECLARE
pl_id ParamList;
BEGIN
pl_id := Get_Parameter_List('list');
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List(pl_id);
END IF;
pl_id := CREATE_PARAMETER_LIST('LIST');
Add_Parameter(pl_id, 'empno',TEXT_PARAMETER,:control.empno);
Add_Parameter(pl_id, 'deptno',TEXT_PARAMETER,:control.deptno);
Run_Product(REPORTS, 'myreport', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
END;
----------------------------------------------------------------------
|
|
|
Re: HOW TO CALL A DYNAMIC REPORT FROM FORMS [message #77861 is a reply to message #77854] |
Tue, 04 December 2001 20:11 ![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) |
UMA MAHESWARA RAO
Messages: 9 Registered: December 2001
|
Junior Member |
|
|
HELLO SHILPA,
THANK YOU FOR YOUR REPLY.
I CREATED A CONTROL FORM WITH 2 FIELDS NAMELY,
EMPNO AND DEPTNO IN FORMS.THE THIRD FIELD IS A BUTTON IN WHICH I WROTE THE CODE WHICH HAS BEEN
SENT BY YOU.I EXECUTED IT AND ENTERED VALUES 7788
AND 20 IN THE FIELDS AND CLICKED THE PUSH BUTTON.
MEANWHILE A REPORT HAS BEEN CREATED WITH
SELECT EMPNO,DEPT.DEPTNO,ENAME FROM DEPT,EMP
WHERE EMP.DEPTNO=DEPT.DEPTNO
AND NAMED IT MYREPORT.
I AM GETTING THE SAME OUTPUT OF THE ABOVE REPORT
EVEN IF I CHANGE THE DATA IN THE FORM.
KINDLY TELL ME THE PROCESS AT THE REPORT SIDE
THANK YOU
UMA
----------------------------------------------------------------------
|
|
|
Re: HOW TO CALL A DYNAMIC REPORT FROM FORMS [message #77871 is a reply to message #77854] |
Wed, 05 December 2001 23:26 ![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) |
Darryl Gray
Messages: 1 Registered: December 2001
|
Junior Member |
|
|
hi,
You need to define your parameters in the report:
- go to Data Model
-- go to user parameters
-- create 2 new parameters
i.e. P_EMPNO, P_DEPTNO
-- set their properties i.e. number, char etc
- in your QUERY
Change sql to:
SELECT EMPNO,DEPT.DEPTNO,ENAME
FROM DEPT,EMP
WHERE EmP.EMPNO = P_EMPNO
AND DEPT.DEPTNO = P_DEPTNO
AND EMP.DEPTNO = DEPT.DEPTNO
that you get you going!
----------------------------------------------------------------------
|
|
|
Re: HOW TO CALL A DYNAMIC REPORT FROM FORMS [message #77873 is a reply to message #77854] |
Thu, 06 December 2001 05:47 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Shilpa
Messages: 59 Registered: November 2001
|
Member |
|
|
At the report level:
You have to create 2 user parameters named as
empno and deptno and change the data type accordingly.
The select statement in the report should be like the following
SELECT EMPNO,DEPT.DEPTNO,ENAME FROM DEPT,EMP
WHERE EMP.DEPTNO=DEPT.DEPTNO
AND EMP.EMPNO = :empno
AND DEPT.DEPTNO = :deptno;
Hope this helps!!!
----------------------------------------------------------------------
|
|
|