First, install a Report Server. How? Run CMD, go to (for example) c:\ora10g\bin and run
>
rwserver –install fik_repserv
where "fik_repserv" represents the report server name. As a result of this command are two messages - "do you want to install report server as a NT service" (answer YES) and "go to control panel - services and start the service". So, go to the Services, find the one named "'Oracleora10gReports[fik_repserv]" and start it.
Now, in Forms Builder, in Object Navigator, create a Report (you'll find it after all those Data Blocks, LOV's, blabla).
Name - enter the name you want ... not necessarily the name of the report. For example, "fik_report".
Filename - path to your report (for example, c:\rep\fikrep.rdf)
Execution mode - batch
Communication mode - synchronous
Report destination type - file
Report destination name - c:\rep\fikrep.pdf
Report destination format - pdf
Report server - fik_repserv
If you run the report using the button, its WHEN-BUTTON-PRESSED trigger should look like this:
Code:
declare
repid report_object;
v_rep varchar2(100);
rep_status varchar2(20);
begin
repid := find_report_object('fik_report');
v_rep := run_Report_object(repid);
-- the code below is optional.
rep_status := report_object_status (v_rep);
if rep_status = 'FINISHED' then
copy_report_object_output(v_rep, 'c:/rep/fik_rep_output.pdf');
host('c:/rep/fik_rep_output.pdf', no_screen);
else
message('There was an error during report execution');
end if;
end;
Optional code helps you to show the result of the report on the screen. If you omit it, you'll have your .pdf file in designed folder set in the report Property Palette.
HOST command allows you to use "no_screen" or "no_prompt" parameters. None of them satisfies me ... DOS window stays on the screen and bothers me (and will bother my users, I guess). I'll have to figure out how to deal with it.
Moreover, HOST command (as you can see) doesn't include any .EXE file (such as Internet Explorer or Acrobat Reader). You CAN include them but don't have to; however, you have to have the software that can open a .pdf file.
Of course, you can use your imagination and try another destination formats, destination types etc. in all possible combinations. I'd really like to hear which one gives the best results.
I hope this helps ...