Home » Developer & Programmer » Forms » Problem when closing the report in Oracle (10g Oracle Developer Suite, Windows XP)
Problem when closing the report in Oracle [message #360696] Sat, 22 November 2008 11:08 Go to next message
fran_azofeifa
Messages: 5
Registered: November 2008
Location: Costa Rica
Junior Member

Hello.

First of all, sorry if I make some mistakes in my English but I am just learning it. I will try to be as clear as possible.

Recently I implemented reports to be called from Oracle Forms. My code is similar to this:

declare
report_id Report_Object;
ReportServerJob VARCHAR2(100);
v_rep VARCHAR2(100);
rep_status VARCHAR2(100);
pl_id ParamList;
hidden_action VARCHAR2(200);
v_formato varchar2(4);
vnOpcion number;
BEGIN
pl_id:=get_parameter_list('Lista');
if not id_null(pl_id) then
destroy_parameter_list(pl_id);
end if;
pl_id := Create_Parameter_List('Lista');
hidden_action := get_application_property(username)||'/'||get_application_property(password)||'@'||get_application_property(connect_string);
Add_Parameter(pl_id,'ORACLE_SHUTDOWN',text_parameter,'yes');
Add_Parameter(pl_id, 'pvpaycode', TEXT_PARAMETER, :BLK_DATOSCONSULTAS.TXT_PAGADOR);
Add_Parameter(pl_id, 'pvcompanyid', TEXT_PARAMETER, :GLOBAL.gvCodigoEmpresa);
Add_Parameter(pl_id, 'pdstartdate', TEXT_PARAMETER,to_char(:BLK_DATOSCONSULTAS.TXT_INITIALDATE,'dd/mm/yyyy'));
Add_Parameter(pl_id, 'pdenddate', TEXT_PARAMETER,to_char(:BLK_DATOSCONSULTAS.TXT_FINALDATE,'dd/mm/yyyy'));
Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
Add_Parameter(pl_id, 'userid', TEXT_PARAMETER, hidden_action);

report_id:= find_report_object('repdocumentosdescontadosxcte');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME,:GLOBAL.gvReportPath || 'myreport.rdf');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,'rwbuilder');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_EXECUTION_MODE, RUNTIME);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE, ASYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,:BLK_BASE.RDG_FORMATO);

v_rep:=run_report_object(report_id,pl_id);
rep_status := report_object_status(v_rep);

WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
rep_status := report_object_status(v_rep);
END LOOP;
if rep_status = 'FINISHED' then
WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1),'_blank');
Else
message('error executing query');
end if;
destroy_parameter_list(pl_id);
END;

This code works fine. The problem I have is that when I close the report (clicking the 'cross' of the browser, in order to close it), it seems that Oracle Forms frezzes; it lasts some seconds to recover and then, all returns ok. So, I would like to know, if that could happend because there is a special link to Reports from Forms, that may cause this.

Any comments would be appreciatted...

Francisco Azofeifa.
Re: Problem when closing the report in Oracle [message #360779 is a reply to message #360696] Mon, 24 November 2008 00:42 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I strongly recommend removing all code that points to 'run_report_object'. Just use the 'web.show_document' command.

David
Re: Problem when closing the report in Oracle [message #360933 is a reply to message #360779] Mon, 24 November 2008 07:04 Go to previous messageGo to next message
fran_azofeifa
Messages: 5
Registered: November 2008
Location: Costa Rica
Junior Member
Hello, David. Thank you for your answer.

If I delete the 'run_report_object', I would need to show the parameters at the URL and that is what we do not want to.

I am going to investigate at Internet if I could hide the parameters in another way, but if you have another idea, it would be very appreciatted.

Thank you!
Re: Problem when closing the report in Oracle [message #360978 is a reply to message #360779] Mon, 24 November 2008 09:08 Go to previous messageGo to next message
fran_azofeifa
Messages: 5
Registered: November 2008
Location: Costa Rica
Junior Member
Sr David.

I found you suggested to eliminate "run_report_object" line from codes, in older forum posts.

Also, I found you suggested to check some other entries, so, I am going to check them and if there is something I do not understand, I will contact you.

By the moment, and in order not to generate some questions you have already answered to other people, do not answer until I will contact you again...;

Thank you!.
Re: Problem when closing the report in Oracle [message #361075 is a reply to message #360978] Tue, 25 November 2008 00:23 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Follow the links in http://www.orafaq.com/forum/m/259965/67467/?srch=hide+parameters#msg_259965

David
Re: Problem when closing the report in Oracle [message #361252 is a reply to message #360696] Tue, 25 November 2008 09:40 Go to previous messageGo to next message
fran_azofeifa
Messages: 5
Registered: November 2008
Location: Costa Rica
Junior Member
O.K. So, here I am going again...jejeje.

I reviewed the links you have suggestted to me but I think that maybe, that kind of solution does not apply for me. I will write why.

I am not sure that using hide_OBR_PARAMS would be a good solution in my case, because this command offers an almost impossible chance to the user to modify that parameter at the registry. You would think: "but, an ordinary user, would never be able to modify that information"; I know, that perhaps, using that comand and setting it to false, would solve the problem about hiding the parameters, but I do not want to play any chance. The information that appears at the URL, definitly can not be displayed. I am not talking simply about hidding user and password; I need to hide other parameters. I found also, that if I write into a .dat file at the configuration (I forgot the name of the file), the user and password, the problem about hidding parameters would be solved too. But, that's not a good solution for me neither.

So, about my original question: yesterday I noticed something. If I have opened another web page, and I run Oracle Forms and run the report from it, I can close the report without any problems. But, if I close all the opened browsers, and I run Oracle Forms to call the report, and then I close the browser that is when the delay appears. Also, I am using Firefox.

"Last new:". Today, I have configurated Firefox that when an URL is going to be opened, to do it in a new window. And the problem seems to be solved.

I have another question. You have suggested at other pages not to use 'run_report_object', although it is a valid Oracle command, and at other forums or posts, people recommends to use it. But I have not found any reason about why not. Personally, I think it is great command, because it let us (the developers) to work with parameters, using 'Create_Parameter_list' line, ataching the parameters to the report using 'Add_Parameter' and to avoid that those parameters appear at the URL without modifying the registry or to write some parameters information in a .dat file.

But, of course, I can not ignore at all your suggestion, and in fact, I am very pleasured you have take a few minutes to read my posts and to answered them. I am very interested why do you suggest not to use that command; if it is for a personal experience, or performance or anything else. I do not have any technical reason that I could find at Internet about some disadvantages about using it.

So, when you have a chance, tell me. I would like to know what kind of experience have you had with 'run_report_object'.

Regards,
Francisco Azofeifa.
Re: Problem when closing the report in Oracle [message #361338 is a reply to message #361252] Wed, 26 November 2008 00:26 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I will answer your second question immediately and get back with more information on the URL in a minute. The reason I like 'web.show_document' versus 'run_report_object' is that the first one will start the report_server automatically and the second one does not. Most of the problems people have with their reports (and you can see it by reviewing the various threads in this forum) is that the report server has not been started and the user doesn't know that it isn't running.

Also, look at your code. For my preference you have a single command. For 'run_report_object' you have to run it and then loop until you get an answer. Have you considered the load that this loop places on the Application server?

In most organisations for which I have worked they use neither method. The report request is written to a database and a separate process queries this table and runs the report. This is because most of the reports were batch reports and it permits a system with many users to better manage their reprot generation load. It also gives history of who ran which report with which parameters. This is often required by the audit team. It also means that you can TELL a aprticular applicatio nserver to run your reports. As the ASs are currently structured every Forms AS is a Reports AS. This means that load balancing can become difficult depending on how much 'work' is done by the Forms and Reports. They are all treated equally but, in reality, may not be equal. Using a table also permits the rerunning of a failed report by a 'recovery' process.

David
Re: Problem when closing the report in Oracle [message #361350 is a reply to message #361252] Wed, 26 November 2008 01:05 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
The link http://www.orafaq.com/forum/m/120688/67467/?srch=hide+report+url#msg_120688 says "Having said that, you can hide the db username and password by using the "cgicmd" key feature. Basically, you can place the DB username/password (& other parameters like destype, desformat) into a cgicmd.dat file on the server and only provide the cmdkey in the url. The reports server will map the cgicmd key to the parameters on the server side, hence avoiding passing the password in the url. The cgicmd.dat file is in $OH/reports/conf directory"

Repeat, the poster says that the 'cgicmd' key is "on the server side".

Look at http://www.orafaq.com/forum/m/315328/67467/?srch=hide+url#msg_315328

Have a look at the documentation referred to in http://www.orafaq.com/forum/m/282053/67467/?srch=hide+url#msg_282053

I will look for more links tomorrow.

David
Re: Problem when closing the report in Oracle [message #361534 is a reply to message #360696] Wed, 26 November 2008 16:43 Go to previous messageGo to next message
fran_azofeifa
Messages: 5
Registered: November 2008
Location: Costa Rica
Junior Member
Hello.

Well. In order to finish this thread, and to begin another one with a topic I will comment you at the end at this message (you seem to be the owner, because your posts are in almost all the questions), I can conclude the following:

1. I am going to try to implement web.showdocument line instead of all that code I wrote to. You convinced me that it is better solution than using mine's, since I had not analyzed the part of the loop, and the overhead in processing. You have good reasons to recommend that code.

2. When I implement that code on my program, I am going to post that solution to this forum, in order to post another resource for people who may have similar questions.

As you may have noticed, I am a newbie with Oracle. What I did, was to find a solution to run reports in Oracle, I found that code, I depured it and I implemented it. I did not analyzed performance topics.

You definetly gave me an important lesson, as a programmer, and is to try to analize the program's behavior.

So, that is what I am going to do. I am going to try to implement it, in order to get a better perfomance. If I have some new questions about that implementation, I will post them here, in this thread.

And, If you agree, or if there is not a thread about that, I would like to create a new one to discuss how could I implement the code you told me when you wrote that some companies prefer not to implement "web.showdocument" and "run_report_object". So, my main question in that case is: Is there another way to implement reports, without using 'run_report_object', and 'web.showdocument'?. Because what I am interested in, is not to implement the fastest way, or the easiest one. I would like to implement the best solution. So, if using a table, or using another command, is the best way, I am going to learn, and implement it, although I very new with Oracle.

The way that I would do it is to make a proposition of the solution, of course, with investment and searching or googling, and then, to write the solution here, and if you want to participate, and to help me, I would appreciate very much.

I like that you ask people to search, to investigate. "Follow the links...". That way or replying, I like it.

By the moment, I won't create that thread, until get your opinion.

Thank you...
Francisco Azofeifa.
Re: Problem when closing the report in Oracle [message #361560 is a reply to message #361534] Thu, 27 November 2008 00:20 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
The post I am looking for describes how to hide the 'address' bar on the browser. I think the post also describes how to hide all the menu bars and make it impossible for the user to do anything except use the Adobe print and save and close the window.

Concerning the idea of 'implement the best solution'. It is truly subjective as to what is 'best'. For me, if I am building a prototype then the faster way to write the code is 'best'. If the organisation has a 'standard method', then that approach is 'best'. If the report runs in a 'short time', then the method is 'good enough'

David
Previous Topic: How to Disable or Hide List Item (Poplist)
Next Topic: Tracking cursor position in text items
Goto Forum:
  


Current Time: Sat Dec 03 12:09:56 CST 2016

Total time taken to generate the page: 0.24379 seconds