Вы находитесь на странице: 1из 5

Calling Oracle Reports from Oracle 10g Forms

Introduction Oracle Reports can add some great reporting functionality to your 10g Forms applications making data available in a wide variety of output formats such as X ! and "#F$ In this document I will e%plain how to configure 10g Oracle Reports on your "C& how to call Oracle Reports from 10g Forms applications& and application server deployment considerations$ 'his information should advance your usage of Oracle Reports and speed adaptation in your applications$ Configuring the OC() Runtime *nvironment for Oracle Reports +ssuming that Oracle Reports 10g is installed on your "C& the following steps will ensure that you are able to successfully use Oracle Reports in your OC() runtime environment$ #efining the Report ,erver 'he first step is to define a report server$ 'his server will run in your OC() runtime environment handling all Oracle Report e%ecution re-uests$ .ou will not be able to run reports in a 10g application unless you have defined and started a Report server$ 'o define a report server do the following/ 1$ ,tart your OC() runtime environment 0$ Open a Command window 1,tart enu& Run option& type in C #2 3$ 'ype this command and press enter/ rwserver server4rep5fsprod a$ It is important to name the Reports server rep5fsprod$ 'his is the name of the Report server on all of the +pplication servermachines and will greatly simply your deployment if you keep the names synchroni6ed$ Congratulations you 7ust defined a report server8 .ou should now see a dialog bo% indicating the Report ,erver is initiali6ing$ Configuring the Report ,erver 'he second step is to configure the Report ,erver created in step 1$ ,pecifically you need to specify the ,ource #irectory of the report files as a search path for the Report ,erver to use when individual report re-uests are made$ 9ere is what you need to do/ 1$ Open :indows *%plorer and navigate to c/;\reports\conf

2. Open rep_fsprod.conf using a text editor. 3. Using the Find or Search tool (depending on the editor used), look for source ir a. !ou do not need to do a case sensiti"e search. #. $his "aria#le is t%picall% located near the top of the file. &n 'ine, it is the ()th line of the file. ). *dit the source ir "aria#le to include the path of each director% +here %ou +ish the ,eport ser"er to search for reports. -elo+ is an exa'ple +ith t+o director% paths specified. One is re.uired, #ut %ou can ha"e as 'an% as %ou need. (propert% na'e/0source ir0 "alue/0c1\en"\aap\reports2c1\en"\eu_asc\reports2)

3. Sa"e and close the file. 4odif%ing the 5pplication .en" file $he third and final step is 'odif%ing each application .en" file including a "aria#le specif%ing the reports path. 6ere is +hat %ou need to do1 (. Open 7indo+s *xplorer and na"igate to c1\\for's89\ser"er 2. Open one of the application.en" files that %ou ha"e created using a text editor. 3. 5dd the ,*:O,$S_:5$6 "aria#le, setting its; "alue to the location of that applications report director% as sho+n in the exa'ple #elo+1 ,*:O,$S_:5$6/c1\en"\aap\reports ). Sa"e and close the file. 3. ,epeat for each re'aining application.en" file. <alling ,eports fro' (9g For's =o+ that the O<)> en"iron'ent is configured, +e no+ can focus on progra''ing a solution to call Oracle ,eports fro' Oracle For's. &;ll +alk %ou through the process using a reporting solutionthat & ha"e used in 3 applications deplo%ed at the Forest Ser"ice. &n the applications & ha"e de"eloped, end users t%picall% call reports #% selecting a report fro' a drop list. 5 report specific for' is displa% +hich allo+s report para'eters to #e specified. 7hen the end user has entered the desired para'eter "alues a #utton is pressed initiating the report. $he 76*=?-U$$O=?:,*SS* trigger calls a progra' unit to gather the report para'eters and #uild the string that is e"entuall% executed #% the 7*-.S6O7_ O<U4*=$ co''and #elo+1

*<@5,* "_host "archar2((99)2 "_port "archar2((9)2 "_para'eter_string "archar2()999)2 "_userna'e "archar2(39)2 "_pass+ord "archar2(39)2 "_data#ase "archar2(39)2 -*A&= ?? Aet the full do'ain na'e of the ser"er fro' the for's+e#.cfg tool_en".get"ar(;S*,B*,_U,@;,"_host)2

?? Aet the userna'eCpass+ord and data#ase fro' the .en" file tool_en".get"ar(;5::@&<5$&O=_US*,=54*;,"_userna'e)2 tool_en".get"ar(;5::@&<5$&O=_:5SS7O, ;,"_pass+ord)2 tool_en".get"ar(;5::@&<5$&O=_ 5$5-5S*;,"_data#ase)2 ?? &f it is localhost then +e are running on +indo+s and need to use the +indo+s port, other+ise +e ?? are on 5&D and need to use the 5&D port &F "_host / ;localhost; $6*= "_port 1/ ;EEE8;2 *@S* "_port 1/ ;FFFE;2 *= &F2 ?? =o+ #uild the para'eter string for running the report "_para'eter_string 1/ ;ser"er/rep_fsprod;2 "_para'eter_string 1/ "_para'eter_stringGG;Hreport/55:_$O$5@_<O=$,5<$_B5@U*_,:$.rdf;2 "_para'eter_string 1/ "_para'eter_stringGG;Huserid/;GG"_userna'eGG;C;GG "_pass+ordGG;I;GG"_data#ase2 "_para'eter_string 1/ "_para'eter_stringGG;Hexecution_'ode/#atch;2 "_para'eter_string 1/ "_para'eter_stringGG;Hco''_'ode/s%nchronous;2 "_para'eter_string 1/ "_para'eter_stringGG;Hdest%pe/cache;2 "_para'eter_string 1/ "_para'eter_stringGG;Hdesfor'at/pdf;2 "_para'eter_string 1/ "_para'eter_stringGG;Hp_region/;GG1rpt_par's.region2 "_para'eter_string 1/ "_para'eter_stringGG;Hp_pro"ince/;GG1rpt_par's.pro"ince2 "_para'eter_string 1/ "_para'eter_stringGG;Hp_forest/;GG1rpt_par's.forest2 "_para'eter_string 1/ "_para'eter_stringGG;Hp_district/;GG1rpt_par's.district2 "_para'eter_string 1/ "_para'eter_stringGG;Hp_fiscal_%ear/;GG1rpt_par's.fiscal_%ear2

?? =o+ run the report +e#.sho+_docu'ent(;http1CC;GG"_hostGG;1;GG"_portGG;CreportsCr+ser"letJ;GG "_para'eter_string,;_#lank;)2 *= 2 $here are a couple of i'portant ite's to note +hen re"ie+ing this progra' unit1 (. &'portant data ele'ents are not hard codedK &nstead, the% are stored in the application.en" file and referenced at runti'e using tool_en".get_"ar. $he userna'e, pass+ord, data#ase and ser"er are all referenced this +a%.

2. $he progra' unit supports execution on 7indo+s ('% de"elop'ent platfor') and 5&D (the deplo%'ent platfor') +ithout re.uiring an% code 'odifications. a. -% referencing the S*,B*,_U,@ en"iron'ent "aria#le in the application.en" file, & a' a#le to specif% the ser"er and port d%na'icall%. 3. 7hen #uilding the string of para'eters to #e passed %ou need to1 a. &nclude the report na'e as a para'eter #. :repend an ;H; to second para'eter and an% additional para'eters there after. c. *xcept for the report na'e, #e sure that all additional para'eters specified 'atch a para'eter na'e (s%ste' or user) in the ,eport definition. ). 4andator% para'eters for each report include1 a. Ser"er, report, userid, execution_'ode, co''_'ode, dest%pe and desfor'at. i. ,eport is the onl% para'eter that +ill change. $he others (likel%) +ill re'ain constant for all reports in %our application. 7hen the 7*-.S6O7_ O<U4*=$ co''and is issued fro' the For', a ne+ #ro+ser +indo+ is opened and the re.uest is executed #% the ,eport Ser"er.

5pplication Ser"er eplo%'ent 7hen %ou ha"e co'pleted de"elop'ent in O<)> and are read% to deplo% to the 5pplication Ser"er there is a short list of acti"ities that need to #e co'pleted to insure success. First, it is i'portant to note that the Oracle reports in %our application need to #e deplo%ed in the Creports su#director% such as CfsappsCfsprodClei'arsCreports. -e sure to ha"e %our application.en" file 'odified accordingl% #% ha"ing the ,*:O,$S_:5$6 "aria#le specif% the proper location. $he second and 'ost i'portant ite' to note is that the rep_fsprod.conf file +ill not #e 'odified to include each applications Creports director%. &nstead the reports in each applications Creports director% are linked to CfsappsCfsprodCfs_reports #% an e -5 using a standard utilit% that has #een distri#uted on each application ser"er. *ach ti'e the script is run on a particular Creports director%, s%'#olic links are created for each report. &f %ou add a ne+ report, %ou need to ha"e the links created for %our application #efore it +ill #e a"aila#le. $he third and final thing to note is that ,eport efinitions do not need to #e co'piled +hen %ou deplo% to the application ser"er. Si'pl% 'o"e the .rdf file to %ou application Creports director%, ha"e the links recreated and %ou are good to go. <onclusion !ou no+ ha"e the infor'ation %ou need to include Oracle ,eports in %our (9g For's applications. &t is a fairl% painless process to co'plete if %our application calls for this

functionalit%. & hope that %ou found the contents of this paper useful and +ish %ou good luck.

Вам также может понравиться