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

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

1811


what are the oracle forms services components include?

752


Is it possible to have multiple layouts in a report?

801


What are the Features of Forms 6i over 4.5? What are the Features of Forms 10g? What are the Features of Reports 6i? What are the Features of Reports 10g ?

4311


did u received a single file or multiple files

1785


how report can be generated if we have the database designed in oracle 10g?

1656


Explain master-detail relationship with some examples.

757


Explain how can you use the same lov for 2 columns?

869


what is tripstop report?

1539


What is an implicit anchor and how is it a different form explicit anchor in a report builder?

878


In what situation u create the BPA.

1964


Explain the various types of oracle report?

807


What do you understand by oracle forms?

797


from where do u receive the information to develop report

1729


what is the difference between call_form, new_form and open_form?

949