How to call a report from Forms?

Answer Posted / muzammil sabir

The report can be run from the forms in simple steps... i will show you how to run report from forms by passing a parameter to the report :
1.Create a report with the desired fields which you want to show..now go to the reports and create a user parameter named p_serial_no.
2. Then create a print button on your form and then write this code in the WHEN-BUTTON-TRIGGER of the button. I have added comments to explain the code
/*
** Declare a variable of type ParamList to store
** the Parameter list ID
*/
DECLARE
temp_id paramlist;
BEGIN
commit;
/*
** Create a Parameter list named "V_A"
*/
temp_id := CREATE_PARAMETER_LIST('V_A');
/*
** Add two Parameters to the list to pass values for each
** user-defined Parameters defined in the target form; for each
** Parameter, specify its key, type (text or data), and value
*/
ADD_PARAMETER(temp_id,'p_serial_no',text_parameter,to_number(:e_fee.fee_id,'999999999999'));
/*
** Pass a Parameter into PARAMFORM so that a parameter dialog
will not appear
** for the parameters being passing in.
*/
ADD_PARAMETER(temp_id,'paramform',text_parameter,'NO');
add_parameter(temp_id,'MAXIMIZE',TEXT_PARAMETER,'YES');
add_parameter(temp_id,'DESNAME',TEXT_PARAMETER,'PRINTER');
/*
** Run the report synchronously, passing the parameter list
*/
run_product(reports,'F:\Education\feevchr2.rdf',synchronous,runtime,filesystem,temp_id);
destroy_parameter_list(temp_id);
end;
2.A..... Replace the name of the primary key field which you have in your form or any other field in the above code where :e_fee.fee_id is written
2.B..... replace the path of the report file which you created earlier in the above code where 'F:\Education\feevchr2.rdf' is written.

................That's it when you will click the print button on form, it will invoke the report which you have created and it will be according to the field of wich you have passed the parameter..................................

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the different levels at which oracle form services interact.

605


Is it possible to have multiple layouts in a report?

574


Can you convert a bit-mapped report to ASCII (character-mode) Report ? How ?

1861


List out the oracle forms configuration files?

564


What is a matrix report and how many minimum groups are required to prepare the same?

551






all steps of bitmap report?

1908


if some data is not transfered where it will get stored

1460


what exactly u write in when_new_form_instance

2900


what are the new features introduced in oracle form services in 11g release 2?

582


If the valueset if of type –TABLE then how many tables can we attach in the valueset ?

1822


what are bind variables?

591


What is the difference between flex mode and confined mode?

528


i am writing a query select EmpNo from Emp how can i call in after parameter form

1597


Explain the various types of oracle report?

546


why the Ctl file u put only in bin folder why not in other folder

1598