PROCEDURE RUN_REPORT_OBJECT_PROC(
report_id REPORT_OBJECT,
report_server_name VARCHAR2,
report_format VARCHAR2,
report_destype_name NUMBER,
report_file_name VARCHAR2,
report_otherparam VARCHAR2,
reports_servlet VARCHAR2,
reports_action VARCHAR2,
reports_desname_parm VARCHAR2
) IS
report_message VARCHAR2(100) :='';
rep_status VARCHAR2(100) :='';
vjob_id VARCHAR2(4000) :='';
hidden_action VARCHAR2(2000) :='';
v_report_other VARCHAR2(4000) :='';
i number (5);
c char;
c_old char;
c_new char;
BEGIN
-- setting Reports runtime parameters
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME,report_file_name);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,report_server_name);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,report_destype_name);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,report_format);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESNAME,reports_desname_parm);--<<---aqui passo o nome da impressora mas não acontece nada o reports, esta sendo gerado nomalmente, preciso definir uma impressora para que o documento seja impresso sem que o usuário tenha que fazer isto
quando relatorio tipo A então impressora x
quando relatorio tipo B então impressora Y
-- creating string for pfaction parameter
hidden_action := hidden_action ||'&report='||GET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME);
hidden_action := hidden_action ||'&destype='||GET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE);
hidden_action := hidden_action ||'&desformat='||GET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT);
hidden_action := hidden_action ||'&desname='||GET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESNAME);
hidden_action := hidden_action ||'&userid=' ||GET_APPLICATION_PROPERTY(username)||'/'||
GET_APPLICATION_PROPERTY(password)||'@'||GET_APPLICATION_PROPERTY(connect_string);
-- report other parameters are passed as key value pairs "key1=value1 key2=value2 ..."
-- the following loop replaces the delimiting blank with an '&' used on the Web. This
-- replacement does only work for values that don't include blanks themselves. If this is a
-- requirement, you need to customize this code accrodingly
-- c_old is initialized with a dummy value
c_old :='@';
FOR i IN 1..LENGTH(report_otherparam) LOOP
c_new:= substr(report_otherparam,i,1);
IF (c_new =' ') THEN
c:='&';
ELSE
c:= c_new;
END IF;
-- eliminate multiple blanks
IF (c_old =' ' and c_new = ' ') THEN
null;
ELSE
v_report_other := v_report_other||c;
END IF;
-- save current value as old value
c_old := c_new;
END LOOP;
hidden_action := hidden_action ||'&'||v_report_other;
hidden_action := reports_servlet||'?_hidden_server='||report_server_name||encode(hidden_action);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,'pfaction='||hidden_action||' '||report_otherparam);
report_message := run_report_object(report_id);
rep_status := report_object_status(report_message);
IF rep_status='FINISHED' THEN
vjob_id :=substr(report_message,length(report_server_name)+2,length(report_message));
WEB.SHOW_DOCUMENT(reports_servlet||'/getjobid'||vjob_id||'?server='||report_server_name||reports_action,' _blank');
ELSE
--handle_errors;
null;
END IF;
END;
problemas para definir impressora
-
- Rank: Estagiário Júnior
- Mensagens: 1
- Registrado em: Sex, 18 Ago 2006 11:54 am
- Localização: SP
estou usando a procedure RUN_REPORT_OBJECT_PROC, para passar os parametros para um relatorio na plataforma 10g, o problema é que não consigo definir uma impressora para que o o relatório seja enviado diretamente, será que alguém poderia me ajudar.
-
- Informação
-
Quem está online
Usuários navegando neste fórum: Nenhum usuário registrado e 19 visitantes