Home » Developer & Programmer » Forms » Calling reports from forms
Calling reports from forms [message #84067] Sat, 24 January 2004 01:53 Go to next message
veena
Messages: 11
Registered: October 2000
Junior Member
hi,,,

i have a problem in calling reports from forms in ORacle9i.i tried using run_product but it says that the 9i verison doesnt support this.

now i have tried calling the reports using the Run_report_object but i get errors "YOu have not speicifed a name for the report"...

and the other error i get is "report not found invalid Id"..

i have included the report in object navigator of the form.

Is there any steps to be done while installation to enable reports,,or is it tht my code is wrong,,pls do help!
Re: Calling reports from forms [message #84090 is a reply to message #84067] Tue, 27 January 2004 20:34 Go to previous messageGo to next message
SHANKAR.K.
Messages: 7
Registered: April 2003
Junior Member
try this out veena,

please specify the path and check it, or check if the path is set in the registry.

bye
shankar

DECLARE
tmp_repid REPORT_OBJECT; -- This is to store the report object id.
tmp_rep_status VARCHAR2(30);
tmp_repname VARCHAR2(30) := 'abc'; ----- name of the RDF ( this should not be 'rep')
tmp_handle VARCHAR2(100); -- This will be used as a return handle when the object id is fetched.
tmp_plid ParamList;
BEGIN
tmp_plid := Get_Parameter_List('RepData');
IF NOT ID_NULL(tmp_plid) THEN
DESTROY_PARAMETER_LIST( tmp_plid );
END IF;
tmp_plid := CREATE_PARAMETER_LIST ('RepData');
tmp_repid := FIND_REPORT_OBJECT(tmp_repname);

-- Setting other runtime parameters.

SET_REPORT_OBJECT_PROPERTY(tmp_repid, REPORT_FILENAME , tmp_repname||'.rdf');
SET_REPORT_OBJECT_PROPERTY(tmp_repid, REPORT_DESTYPE , FILE);
SET_REPORT_OBJECT_PROPERTY(tmp_repid, REPORT_DESNAME , tmp_filename);
SET_REPORT_OBJECT_PROPERTY(tmp_repid, REPORT_DESFORMAT, 'pdf');

---- add the parameters here that you are passing to the report
Add_Parameter(tmp_plid,'P_ALL_PARAMS',TEXT_PARAMETER, 'abc' );

tmp_handle := RUN_REPORT_OBJECT(tmp_repid, tmp_plid);

-- The following loop ensures that the file is not opened, before it is completely created.

LOOP
tmp_rep_status := REPORT_OBJECT_STATUS(tmp_handle);
EXIT WHEN tmp_rep_status IN ('FINISHED', 'TERMINATED_WITH_ERROR');
END LOOP;

IF tmp_rep_status = 'TERMINATED_WITH_ERROR' THEN
message('Unable to Print Report.');
END IF;
END;
Re: Calling reports from forms [message #84098 is a reply to message #84090] Wed, 28 January 2004 18:56 Go to previous messageGo to next message
veena
Messages: 11
Registered: October 2000
Junior Member
hi shankar...
Well thanks a lot for the code u sent
i havent tried it out yet becoz now what is happenin is that i am not gettin any error at all.
I am yet to try out the code u sent me and will do that today but before that i need a few more clarification
1) what are the paths to be set in the registery
i mean there are sooooo many environment variables in the hkey_local_system /software/oracle ..and i dont know what i shud be lookin for
i know i might sound like a baby but the fact is i am totally lost.
right now i havent changed any env variables or setting
all i have done is written a code in the push button of the form
declare
v report_object;
r varchar2(100);
begin
v:=find_report_object("reg");
r:=run_report_object(v);
end;

Reg is the name of the report nodee thhat is inculded in the object navigator of the forms.
and in the property palette of this node i have set all the properties like executin mode,and filename etc......(all the ones that u have set using the set_report_object_property, i have done it in the property palette).
2)u said that the filename shud be rdf and not rep.
the autofile that is got when we generate the report is the rep file,,do i make the RDF by going to the Convert option given in the Reports builder and make it a rdf?? well thats how i have done it now,,i converted the rep file into an rdf file and that is the filename that i have specified in the Filename attribute of the Reportnode Reg in the forms,,(hope i am not confusing u)..
okie,,,so now i am going to try ur code,,but in the mean time pls let me know abt setting the path in the registery(in detail and step by step pls..coz i am not a person who can grasp things fast) and also let me know if there is something wrong that i have done till now
now i am not witnessing any errors,,but when i click the button , nothing happens,,,
after 20seconds the screen with the button(the form) disappears but then nothing else happens,,,,

Once again thanks a lot for ur response but i still need a help!
thanks once again shankar

Veena.
Re: Calling reports from forms [message #84103 is a reply to message #84098] Thu, 29 January 2004 15:41 Go to previous message
SHANKAR.K.
Messages: 7
Registered: April 2003
Junior Member
Regarding the 2 point
when you create a report using a report builder it is automatically saved as "RDF", and when you compile it,
the runtime file becomes "REP", here what i mean to say is that you can create the report and compile it
and keep the RDF in the same directory
and this should work for you
I dont know exactly how you converted the REP to RDF, Report builder does not support that. I think that you are confused with that extensions "RDF" - Report Definition File ( Source ) "REP" - Report Executable file, so we are not going to use REP we are going to use only RDF

please give me some time to list all the registry
changes

any problems mail me mail4shankar@rediffmail.com, or chat shakrekh@yahoo.com

have a nice time..

cheers
shankar
Previous Topic: dynamicly created graphics/charts in Forms
Next Topic: problem with LOVs
Goto Forum:
  


Current Time: Tue Apr 23 14:30:21 CDT 2024