Home » Developer & Programmer » Reports & Discoverer » report output (Reports 6i)
report output [message #547922] Mon, 19 March 2012 00:28 Go to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

i need to open the report directly into .pdf (adobe) format is there any option to do that.
Re: report output [message #547949 is a reply to message #547922] Mon, 19 March 2012 03:14 Go to previous messageGo to next message
Littlefoot
Messages: 21561
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Could you describe what you are doing and how? Most of my reports are viewed as a PDF, so I'm kind of puzzled by the question.
Re: report output [message #547976 is a reply to message #547949] Mon, 19 March 2012 06:34 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

The thing is i am calling the report from form using when button pressed with following parameters but i want the pdf to open directly asking for saving.
DECLARE
	PARAM_ID1  ParamList;

BEGIN
	  PARAM_id1 := Get_Parameter_List('tmpdata');
	  
	  IF NOT Id_Null(PARAM_id1) THEN Destroy_Parameter_List(PARAM_ID1);
	  END IF; 
	  
	  pARAM_id1 := Create_Parameter_List('tmpdata');
	  
 
  

IF :M_DEST_TYPE IN ('P') THEN
      STD_ADD_PARA_PKG.STD_ADD_PARAMETER(PARAM_ID1,'DESTYPE',TEXT_PARAMETER,'PREVIEW'); 
      RUN_PRODUCT(REPORTS,'shippr',SYNCHRONOUS,RUNTIME,FILESYSTEM,PARAM_ID1,NULL);
ELSIF :M_DEST_TYPE IN ('P','V','W','E','M','H','F','X') THEN 
	
	     ADD_PARAMETER(PARAM_ID1,'P_WO_NO',TEXT_PARAMETER,:M_WO_NO);
  ADD_PARAMETER(PARAM_ID1,'T_WO_NO',TEXT_PARAMETER,:T_WO_NO);
  ADD_PARAMETER(PARAM_ID1,'P_STRUCT_NO',TEXT_PARAMETER,:M_STRUCT_NO);
  ADD_PARAMETER(PARAM_ID1,'T_STRUCT_NO',TEXT_PARAMETER,:T_STRUCT_NO);
  ADD_PARAMETER(PARAM_ID1,'P_FM_DT',TEXT_PARAMETER,:P_FM_DT);
  ADD_PARAMETER(PARAM_ID1,'P_TO_DT',TEXT_PARAMETER,:P_TO_DT);
   ADD_PARAMETER(PARAM_ID1,'IDT',TEXT_PARAMETER,:IDT);
   	--EXCEL
   	  STD_ADD_PARA_PKG.STD_ADD_PARAMETER(PARAM_ID1,'DESTYPE',TEXT_PARAMETER,'FILE'); 
      STD_ADD_PARA_PKG.STD_ADD_PARAMETER(PARAM_ID1,'DESFORMAT',TEXT_PARAMETER,'PDF');
      STD_ADD_PARA_PKG.STD_ADD_PARAMETER(PARAM_ID1,'M_DEST_TYPE',TEXT_PARAMETER,'F');
      RUN_PRODUCT(REPORTS,'OR7017_AICH',SYNCHRONOUS,RUNTIME,FILESYSTEM,PARAM_ID1,NULL);
END IF;      
END ;







CM: fixed code tags

[Updated on: Mon, 19 March 2012 06:37] by Moderator

Report message to a moderator

Re: report output [message #547996 is a reply to message #547976] Mon, 19 March 2012 07:56 Go to previous messageGo to next message
Littlefoot
Messages: 21561
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try with WEB.SHOW_DOCUMENT instead of RUN_PRODUCT.
Re: report output [message #548005 is a reply to message #547996] Mon, 19 March 2012 08:29 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

kindly give me some sample or if you can change in my code.
Re: report output [message #548023 is a reply to message #548005] Mon, 19 March 2012 12:09 Go to previous messageGo to next message
Littlefoot
Messages: 21561
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Plenty of them on OraFAQ, much more elsewhere (hint: Google).
Re: report output [message #553726 is a reply to message #548023] Tue, 08 May 2012 03:22 Go to previous message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

hi littlefoot, i am able to save the file in a seperate place when i set the file path in desformat but i want the .pdf file to open directly like preview.

 :REP_DFLT.M_DEST_TYPE = 'F' THEN   
	       :REP_DFLT.M_DEST_NAME :=    'C:\TEMP\OPT007.PDF';


I did this using following program but i want the pdf to open as preview, give me samples of web_show as i am unable to find any relevant example.

ROCEDURE O_RUN_REPORT( LANG_CODE   IN VARCHAR2,
			USER_ID     IN VARCHAR2,
		 	MODULE_NAME IN VARCHAR2,
			BITM_REP_ID IN VARCHAR2,
			CHAR_REP_ID IN VARCHAR2,
			REP_MODE    IN VARCHAR2,
			DEST_TYPE   IN VARCHAR2 ) IS

  PARAM_ID	PARAMLIST;
/*
  RG_PARAM	RECORDGROUP;
  GC_FROM_VAL     GROUPCOLUMN;
  GC_TO_VAL	GROUPCOLUMN;
  RG_PARAM_VAL	NUMBER;
  DFLT_LANG	VARCHAR2(3) := 'ENG';
*/
  M_COMP_CODE	VARCHAR2(12); 

  M_RIGHT_LANG	VARCHAR2(80) ;
  M_LEFT_LANG	VARCHAR2(80) ;
  M_CURR_NLS_LANG	VARCHAR2(80) ;


CURSOR C3 IS 
          SELECT DECODE(LANG_CODE,'ENG',COMP_NAME,COMP_BL_NAME) COMP_NAME FROM FM_COMPANY
	  WHERE COMP_CODE = M_COMP_CODE;	
		
C3_REC   C3%ROWTYPE;

BEGIN

   SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'BUSY');

-- CREATE PARAMETER LIST

   PARAM_ID := GET_PARAMETER_LIST('PL_PARAM'); 
   IF NOT ID_NULL(PARAM_ID) THEN 
      DESTROY_PARAMETER_LIST(PARAM_ID);
   END IF; 
   PARAM_ID := CREATE_PARAMETER_LIST('PL_PARAM'); 
   IF ID_NULL(PARAM_ID) THEN 
      MESSAGE('ERROR CREATING PARAMETER LIST PL_PARAM'); 
      SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
      RAISE FORM_TRIGGER_FAILURE; 
   END IF; 

/*
-- REPORT PARAMETERS

   RG_PARAM := FIND_GROUP('RG_PARAM');

   RG_PARAM_VAL := POPULATE_GROUP(RG_PARAM);

   GC_FROM_VAL := FIND_COLUMN('RG_PARAM.GC_FROM_VAL');
   GC_TO_VAL   := FIND_COLUMN('RG_PARAM.GC_TO_VAL');

-- TO SET THE VALUES OF THE PARAMETER IN THE RECORD GROUP;
   L_SET_USER_PARAMETERS(RG_PARAM,GC_FROM_VAL,GC_TO_VAL);
*/
	
   M_COMP_CODE := NAME_IN('GLOBAL.M_COMP_CODE');
      
   OPEN C3;
   FETCH C3 INTO C3_REC;
   CLOSE C3;	

-- ADD REPORT PARAMETERS
   
-- TITLES

   ADD_PARAMETER(PARAM_ID,'M_COMP_CODE',  TEXT_PARAMETER,M_COMP_CODE);    
   ADD_PARAMETER(PARAM_ID,'P_USER_NAME',  TEXT_PARAMETER,USER_ID);    
   ADD_PARAMETER(PARAM_ID,'P_REP_NAME', TEXT_PARAMETER,BITM_REP_ID);   


-- USER PARAMETERS
--   ADD_PARAMETER(PARAM_ID,'USER_PARAM', DATA_PARAMETER,'RG_PARAM'); 

-- SET SYSTEM PARAMETERS

   ADD_PARAMETER(PARAM_ID,'PARAMFORM',TEXT_PARAMETER,'NO'); 
   ADD_PARAMETER(PARAM_ID,'P_DT_FMT_MASK',TEXT_PARAMETER,NAME_IN('CTRL.M_DT_FMT_MASK')); 
   ADD_PARAMETER(PARAM_ID,'P_LANG_CODE',TEXT_PARAMETER,LANG_CODE); 
   ADD_PARAMETER(PARAM_ID,'COPIES',TEXT_PARAMETER,NAME_IN('REP_DFLT.M_NO_OF_COPIES')); 

   IF DEST_TYPE = 'V' THEN
      ADD_PARAMETER(PARAM_ID,'DESTYPE',TEXT_PARAMETER,'PREVIEW'); 
   ELSIF DEST_TYPE = 'P' THEN
      ADD_PARAMETER(PARAM_ID,'DESTYPE',TEXT_PARAMETER,'PRINTER'); 
      ADD_PARAMETER(PARAM_ID,'DESNAME',TEXT_PARAMETER,NAME_IN('REP_DFLT.M_DESNAME')); 
   ELSIF DEST_TYPE = 'W' THEN
      ADD_PARAMETER(PARAM_ID,'DESTYPE',TEXT_PARAMETER,'FILE'); 
      ADD_PARAMETER(PARAM_ID,'DESFORMAT',TEXT_PARAMETER,'RTF');
      ADD_PARAMETER(PARAM_ID,'DESNAME',TEXT_PARAMETER,NAME_IN('REP_DFLT.M_DEST_NAME')); 
   ELSIF DEST_TYPE = 'E' THEN
   	

   	  ADD_PARAMETER(PARAM_ID,'DESTYPE',TEXT_PARAMETER,'FILE'); 
      ADD_PARAMETER(PARAM_ID,'DESFORMAT',TEXT_PARAMETER,'XML');
      ADD_PARAMETER(PARAM_ID,'DESNAME',TEXT_PARAMETER,SUBSTR(NAME_IN('REP_DFLT.M_DEST_NAME'),1,INSTR(NAME_IN('REP_DFLT.M_DEST_NAME'),'.')-1)||'.XML'); 
   ELSIF DEST_TYPE = 'M' THEN
   	  -- Mail
      ADD_PARAMETER(PARAM_ID,'DESTYPE',TEXT_PARAMETER,'MAIL');
      ADD_PARAMETER(PARAM_ID,'DESNAME',TEXT_PARAMETER, NAME_IN('REP_DFLT.M_DEST_NAME'));
      ADD_PARAMETER(PARAM_ID,'DESFORMAT',TEXT_PARAMETER,'HTML');
   ELSIF DEST_TYPE = 'H' THEN
   	  -- HTML
      ADD_PARAMETER(PARAM_ID,'DESTYPE',TEXT_PARAMETER,'FILE'); 
      ADD_PARAMETER(PARAM_ID,'DESFORMAT',TEXT_PARAMETER,'HTML');
      ADD_PARAMETER(PARAM_ID,'DESNAME',TEXT_PARAMETER,NAME_IN('REP_DFLT.M_DEST_NAME')); 
   ELSIF DEST_TYPE = 'F' THEN
   	  -- PDF
   	  DISP_ALERT('F');
      ADD_PARAMETER(PARAM_ID,'DESTYPE',TEXT_PARAMETER,'file'); 
      ADD_PARAMETER(PARAM_ID,'DESFORMAT',TEXT_PARAMETER,'PDF');
      ADD_PARAMETER(PARAM_ID,'DESNAME',TEXT_PARAMETER,'C:\TEMP\OPT007.PDF');--  NAME_IN('REP_DFLT.M_DEST_NAME')); 
      
   ELSIF DEST_TYPE = 'X' THEN
   	  -- XML
      ADD_PARAMETER(PARAM_ID,'DESTYPE',TEXT_PARAMETER,'FILE'); 
      ADD_PARAMETER(PARAM_ID,'DESFORMAT',TEXT_PARAMETER,'XML');
      ADD_PARAMETER(PARAM_ID,'DESNAME',TEXT_PARAMETER,NAME_IN('REP_DFLT.M_DEST_NAME')); 
   END IF;

-- USER PARAMETERS DEPENDING ON THE REPORT

   L_SET_REPORT_PARAMETER(PARAM_ID);

   SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');

-- RUN REPORT

   M_LEFT_LANG		:= 'AMERICAN_AMERICA' ;
   M_RIGHT_LANG		:= 'ARABIC_SAUDI ARABIA' ;

   O_SET_REPORT_NLS(M_CURR_NLS_LANG,M_LEFT_LANG,M_RIGHT_LANG) ;

   IF REP_MODE = 'B' THEN
      ADD_PARAMETER(PARAM_ID,'MODE',TEXT_PARAMETER,'BITMAP'); 	      
      RUN_PRODUCT(REPORTS,BITM_REP_ID,SYNCHRONOUS,RUNTIME,
		FILESYSTEM,PARAM_ID,NULL);
   END IF; 

   M_LEFT_LANG		:= 'AMERICAN_AMERICA' ;
   M_RIGHT_LANG		:= 'ARABIC_SAUDI ARABIA' ;

   O_RESET_REPORT_NLS(M_CURR_NLS_LANG) ;

   DESTROY_PARAMETER_LIST(PARAM_ID) ;
   CLEAR_MESSAGE;
   IF DEST_TYPE = 'E' THEN
   	 CREATE_EXCEL_REPORT(NAME_IN('REP_DFLT.M_DEST_NAME'),SUBSTR(NAME_IN('REP_DFLT.M_DEST_NAME'),1,INSTR(NAME_IN('REP_DFLT.M_DEST_NAME'),'.')-1)||'.XML');
   END IF;	
  
END;


[/CODE]
Previous Topic: Need output in pdf
Next Topic: Same Code, Different Results, Reason?
Goto Forum:
  


Current Time: Fri May 29 09:50:27 CDT 2020