Home » Developer & Programmer » Reports & Discoverer » desformat and destype
desformat and destype [message #236157] Wed, 09 May 2007 03:45 Go to next message
ritikaindu
Messages: 30
Registered: March 2007
Location: asas
Member

i am having a report saved as .jsp.
i want to display the report in pdf format.
can i specify just desformat in my URL to get the desired output or i'll have to make some other changes in config file?
Because i have to make a flexible reporting using forms
where i want the user to select the output format and when he clicks on RUN REPORT button in forms ,the corressponding report in the selected format gets displayed.
NOTE:other parameters are also to be passed using the same form.

Ritika
Re: desformat and destype [message #238252 is a reply to message #236157] Thu, 17 May 2007 03:46 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Dear,
By Following your NOTE: I guess you must have one Parameter form from which you are sending the Specific Formats to the URL.If So you can Write a IF....THEN Block with diffrent Formats like

If Button1
then :desformat:='PDF';
elsif Button2
then :desformat:='RTF';
.
.
.
.
Yes You can Change the Format by Changing the Extension in URL but Some Data Sometime not gets properly in this technique Specially when you Transform the things from PDF.Let me know....
Re: desformat and destype [message #238506 is a reply to message #238252] Fri, 18 May 2007 06:41 Go to previous messageGo to next message
ritikaindu
Messages: 30
Registered: March 2007
Location: asas
Member

Hi Javed

But i am not passing any system parameters(only user parameters).I have tried with them but report output is in JSP only.For getting the output in pdf i have to generate report in 'pdf' and then in my url i give the reportname with extension'.pdf'.
The If..then block is possible only if i already have the required extension's generated reports.

If this is possible please tell the steps or am i missing something in my configuration.

Thanks
Ritika
Re: desformat and destype [message #239046 is a reply to message #238506] Mon, 21 May 2007 06:01 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Dear Ritika,
It would not be a Problem to Open or Run your Report if its Saved in a JSP Format.I cant Understand why you are Saving your Report in JSP...Make it RDF and Run the Report .Also let me know what Version of Report you are using if you are Running the Report in Previwer then you Can Generate it Directly from RBUILDER and If you are Running it from Server then you must have to Set the DESFORMAT in URL.Please refer the Attached Document And let me know.Also send me the Parameter Form Report Calling Button Code.


Javed Khan
Re: desformat and destype [message #239048 is a reply to message #236157] Mon, 21 May 2007 06:08 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Also Congratulation on your 1000 Views to your Question.
Re: desformat and destype [message #239716 is a reply to message #239048] Wed, 23 May 2007 03:22 Go to previous messageGo to next message
ritikaindu
Messages: 30
Registered: March 2007
Location: asas
Member

well thanks Javed.
The version of Forms and Reports is 10g.
i read the attached document and tried the code but i am getting
many errors.I am working through the code.But when i run the web report i get an error(frm-41211) and also it opens up the reports (getting started page) and then nothing .
But first of all if i want to deploy my report on web directly(without being called from forms).Here my rdf report is not getting run.It returns an error instead-HTTP 404 not found.The same jsp report is running accurately.Also the report format is not visible as pdf.(i had specified both destype=cache and desformat=pdf in the URL).

Thanks
Ritika

[Updated on: Wed, 23 May 2007 03:56]

Report message to a moderator

Re: desformat and destype [message #239734 is a reply to message #239716] Wed, 23 May 2007 03:54 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

The code to make a report run on the web.

PROCEDURE RUN_REPORT IS

-- Some variable you use to populate a report table named REPORT, 
-- or call some procedure to generate data for a report

v_report_uui    REPORT.report_uui%TYPE;

-- Parameter List used in call to Oracle Report "rpt_name"

p_rpt_param_list  paramlist;

  report_id       REPORT_OBJECT;
  ReportServerJob VARCHAR2(100);
  v_jobID         VARCHAR2(100);
  rep_status      VARCHAR2(20);
  reportserver    VARCHAR2(30);
  v_url           VARCHAR2(200);
  v_url2          VARCHAR2(200);

-- However you keep track of reports; this is just one way

  usr_sessionid   NUMBER;
 
  report_not_generated EXCEPTION;

BEGIN

--Get the user session ID

  SELECT USERENV('sessionid') into usr_sessionid FROM DUAL;

-- Execute database stored package.procedure "some_package.some_procedure"
-- that populates a REPORT table

some_package.some_procedure 
  (
   to_char(:block.some_item),      -- IN
   v_report_uui                    -- OUT
   );

-- Destroy the parameter list if it already exists

IF NOT Id_Null(p_rpt_param_list) then
      Destroy_Parameter_List(p_rpt_param_list);
END IF;

-- Create a Parameter List

p_rpt_param_list := Create_Parameter_List ('tmp');

-- Generate report - on the Web
-- You can add an ELSE clause to this to re-use your 6i code

IF (get_application_property(user_interface)='WEB') THEN

-- You need to provide the name of the report server
-- The "rpt_name" is a report object you create in the Form Builder Object
-- Navigator

   reportserver := :parameter.reportserver;
   report_id := find_report_object('rpt_name');

-- These five calls to the built-in cover what 10g requires

   SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_COMM_MODE, SYNCHRONOUS);
   SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_EXECUTION_MODE, BATCH);
   SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_DESTYPE, FILE);
   SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_DESFORMAT, 'pdf');
   SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_SERVER, reportserver);

-- Here is where you can add your own parameters to the report

   Add_Parameter(p_rpt_param_list,'paramform',TEXT_PARAMETER,'no');
   
   Add_Parameter(p_rpt_param_list,'p_report_uui',TEXT_PARAMETER, to_char(v_report_uui));

   Add_Parameter(p_rpt_param_list,'PRINTJOB',TEXT_PARAMETER,'NO');

-- A common error message has to do with not being able to find the report object.
-- No report object means no report_id, and you'll get lots of errors.

   ReportServerJob := run_report_object(report_id, p_rpt_param_list);
   v_jobID := substr(ReportServerJob,length(reportserver)+2,length(ReportServerJob));

   IF ReportServerJob is NOT NULL THEN
       rep_status := report_object_status(ReportServerJob);

       WHILE rep_status in ('RUNNING', 'OPENING_REPORT','ENQUEUED') LOOP
         rep_status := report_object_status(ReportServerJob);
       END LOOP;
       IF rep_status != 'FINISHED' THEN
          raise report_not_generated;
       END IF;

 -- The JavaScript command/string can be used to show a basic browser window

   v_url := '/reports/rwservlet/getjobid'||v_jobID||'?server='||reportserver;

-- The following is one long string, carriage returns used for formatting

v_url2 := 'javascript:window.open("'||v_url ||'", "", "fullscreen=no, 
titlebar=no, location=no, toolbar=no, menubar=no, status=no, resizable=yes");

-- "self.close" shown below is continued from the line above, carriage return 
-- here for formatting, but it is really one long string

       self.close()';

-- This is the built-in that calls a new browser window

       Web.Show_Document(v_url2,'_blank');
   ELSE
       raise report_not_generated;
   END IF;


END IF;

-- Destroy the parameter list. Report has been generated - it's no longer needed

Destroy_Parameter_List(p_rpt_param_list);

EXCEPTION
  WHEN report_not_generated THEN

-- "am" is a shortcut to call an alert message. If you are raising a lot of alert messages in 
-- your forms, add a procedure in Program Units. It takes the string you pass in and will
-- save you lots of time by not having to keep writing set_alert_property(...).

       am('There was an error in running the report.'||chr(10)||
          'Contact the Application Server administrator for assistance.');

  WHEN OTHERS THEN
    user_show_error;

END;

Re: desformat and destype [message #239743 is a reply to message #239734] Wed, 23 May 2007 04:13 Go to previous messageGo to next message
ritikaindu
Messages: 30
Registered: March 2007
Location: asas
Member

but when i set the desformat and destype directly in URL its not getting set.What is the problem here?

And the code you have send will work from forms only..that i am working with now.I will let you know if it works for me.
Also is it necessary to specify the servername.If yes,where can i find my report server name.

Ritika

[Updated on: Wed, 23 May 2007 04:14]

Report message to a moderator

Re: desformat and destype [message #239791 is a reply to message #239743] Wed, 23 May 2007 05:39 Go to previous messageGo to next message
ritikaindu
Messages: 30
Registered: March 2007
Location: asas
Member

i tried with the code.
but first error given when i compile the code.it does not recognise PARAMLIST datatype.Please tell me what i am missing .i am not getting any solutions with these codes.
Re: desformat and destype [message #240046 is a reply to message #239734] Thu, 24 May 2007 00:38 Go to previous messageGo to next message
ritikaindu
Messages: 30
Registered: March 2007
Location: asas
Member

Hi Javed

I have been able to solve my problem.Actually i had not set the reports_path environment variable for my current reports.Now everything has started working.

Thanks a lot for your help.

Ritika
Re: desformat and destype [message #242763 is a reply to message #240046] Tue, 05 June 2007 00:58 Go to previous message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Pleasure is All Mine.
Previous Topic: Oracle Reports Services
Next Topic: Problem in Report Printing
Goto Forum:
  


Current Time: Sat Nov 30 01:02:50 CST 2024