Parameter Where - report 10g
Hi
I have a variable vsWhere.
vsWhere := 'WHERE TABLE.COLUNM1 = 1 AND TABLE.COLUMN2 = 3'
I have too the parameter :P_WHERE in the report
I tried to past the variable to parameter in report, but is not ok. The report show just the word "WHERE", why?
ex: vsOther_parameter := 'PARAMFORM=NO BLANKPAGES=NO P_WHERE='vsWhere;
forms and reports 10g
att,
Marcos
Ok
vsOther_parametro := 'PARAMFORM=NO BLANKPAGES=NO MAXIMIZE=YES'
vsOther_parametro := vsOther_parametro || ' P_WHERE=WHERE VI_MOVIMENTO_ESTOQUE.TIPO = 1 AND VI_MOVIMENTO_ESTOQUE.STATUS = 2';
P_WHERE is parameter of report.
report_id:=FIND_REPORT_OBJECT('AEF2001');
----- call the procedure
RUN_REPORT_OBJECT_PROC(report_id, vsReport_servname, vsReport_desformat,
CACHE
vsReport_filename,
vsReport_desname,
vsOther_parametro, vsReport_servlet);
----- end call the procedure
--- procedure that call report
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_desname VARCHAR2,
report_otherparam VARCHAR2,
reports_servlet 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
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_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);
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 ||'&userid='||get_application_property(username)||'/'||get_application_property(password)||'@'||get_application_property(connect_string);
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;
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);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(report_message);
--rep_status := report_object_status(report_job_id);
END LOOP;
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,' _blank');
ELSE
null;
END IF;
END;
--- end procedure that call report
--- procedure encode
FUNCTION ENCODE(URL_PARAMS_IN Varchar2)
RETURN VARCHAR2 IS
v_url VARCHAR2(2000) := URL_PARAMS_IN; -- Url string
v_url_temp VARCHAR2(4000) :=''; -- Temp URL string
v_a VARCHAR2(10); -- conversion variable
v_b VARCHAR2(10); -- conversion variable
c CHAR;
i NUMBER(10);
BEGIN
FOR i IN 1..LENGTH(v_url) LOOP
c:= substr(v_url,i,1);
IF c in (';', '/','?',':','@','+','$',',',' ') THEN
v_a := ltrim(to_char(trunc(ascii(substr(v_url,i,1))/16)));
IF v_a = '10' THEN
v_a := 'A';
ELSIF v_a = '11' THEN
v_a := 'B';
ELSIF v_a = '12' THEN
v_a := 'C';
ELSIF v_a = '13' THEN
v_a := 'D';
ELSIF v_a = '14' THEN
v_a := 'E';
ELSIF v_a = '15' THEN
v_a := 'F';
END IF;
v_b := ltrim(to_char(mod(ascii(substr(v_url,i,1)),16)));
IF v_b = '10' THEN
v_b := 'A';
ELSIF v_b = '11' THEN
v_b := 'B';
ELSIF v_b = '12' THEN
v_b := 'C';
ELSIF v_b = '13' THEN
v_b := 'D';
ELSIF v_b = '14' THEN
v_b := 'E';
ELSIF v_b = '15' THEN
v_b := 'F';
END IF;
v_url_temp := v_url_temp||'%'||v_a||v_b;
ELSE
v_url_temp :=v_url_temp||c;
END IF;
END LOOP;
return v_url_temp;
END;
--- end procedure encode
att,
Marcos
Similar Messages
-
Lexical Parameter in report 10g
i want to call a report with few fields on my form. i create 2 user parameter which works fine. now i want to create a lexical parameter so that if null no problem report should appear with 2 user parameters but if has values then report should be called according to those parameter values.
I use this in my form:
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'PBRANCHCODE='||:txtBranchCode||' PPERIOD='||:cmbPeriod||' CLASSCONDITION='||'cla_class_id between 1 and 2'||' paramform=no');
CLASSCONDITION is a lexical parameter which is called in report sql:
and periodic_branch_id = :pBranchCode
and periodic_period_from = :pPeriod
&ClassCondition
it says unable to run report
when i test using paramform=no then it shows in classcondition parameter only and and nothing after space assuming parameter list ended.
Please help me in passing a lexical parameter to report
Thanx in advance.I want to append the where condition of the report. if values inputed from Form in the class ids from and to text boxes appended as a where condition in the report query otherwise excluded
Report Query
select *
from ...
where
and .....
and ....
&ClassCondition
and i want to pass &classcondition parameter the below condition
and class_id between :fromclass and :toclass
Hope you understand. -
How 2 call a report 10g from a parameter form 10G
Hello,
pls. i need steps ,or docs how 2 run a report 10g from a parameter form ;
Is it requireD for the Parameter form to call a report an Application Server no* ???*
i had a previous experience with the code due to run the report as follows:_
DECLARE
PARAM_ID PARAMLIST ;
PARAM_NAME VARCHAR2(30) := 'REPORT_PARAMETER';
ALRT NUMBER;
ERR_TXT VARCHAR2(1000);
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
v_REP_SERVER_NAME VARCHAR2(200);
v_ip VARCHAR2(100);
BEGIN
PARAM_ID := GET_PARAMETER_LIST(PARAM_NAME);
IF NOT ID_NULL(PARAM_ID) THEN
DESTROY_PARAMETER_LIST('REPORT_PARAMETER');
END IF;
v_REP_SERVER_NAME := REP_SERVER_NAME;
BEGIN
SELECT PARAMETER_VALUE
INTO v_ip
FROM GENERAL_FIXED_PARAMETERS
WHERE PARAMETER_ID = 'REPORT_SERVER_IP';
EXCEPTION
WHEN OTHERS THEN
Message ('OTHERS' || SQLCODE || ' And ' || SQLERRM);
Message ('OTHERS' || SQLCODE || ' And ' || SQLERRM);
END;
PARAM_ID := CREATE_PARAMETER_LIST(PARAM_NAME);
ADD_PARAMETER(PARAM_ID,'PARAMFORM',TEXT_PARAMETER,'NO');
ADD_PARAMETER(PARAM_ID,'COPIES',TEXT_PARAMETER,:COPIES);
ADD_PARAMETER(PARAM_ID,'P_DISPLAY',TEXT_PARAMETER,:DESTYPE);
ADD_PARAMETER(PARAM_ID,'DESFORMAT',TEXT_PARAMETER,'pdf');
ADD_PARAMETER(PARAM_ID,'group_id',TEXT_PARAMETER, :group_id);
repid := find_report_object('WH_R01_GRP_ITEM');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,v_rep_server_name);
v_rep := RUN_REPORT_OBJECT(repid,PARAM_ID);
WEB.SHOW_DOCUMENT('http://'||V_IP||'/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?server='||v_REP_SERVER_NAME,'_blank');
-- http://server_name:8889/reports/rwservlet?report=rep_name.rdf¶mform=yes&destype=CACHE&desformat=htmlcss&userid=id/pass@conn
END;notice here the value of V_IP it is retrieved from the following table desc...
The table desc GENERAL_FIXED_PARAMETERS that i select from the values are as follows:_
SQL> DESC GENERAL_FIXED_PARAMETERS;
Name Null? Type
PARAMETER_ID VARCHAR2(200)
PARAMETER_VALUE VARCHAR2(200)
PARAMETER_DESC VARCHAR2(200)
MODULE VARCHAR2(200)it's stored value is as follows:
SQL> select * from GENERAL_FIXED_PARAMETERS;
PARAMETER_ID PARAMETER_VALUE PARAMETER_DESC MODULE
REPORT_SERVER_IP rep_oraas_OracleAs_10gNotice here the value of the PARAMETER_VALUE is a string ; as if it's a generic value to be applied on any REPORT_SERVER_IP this value ...
Where Should i retrieved or Get ???
That was long time i can't remember pls help me 2 run my report what should id
i searched the google but there is a missing link can u help and guide me it's urgent pls.
if needed 2 start oc4j for reports , setting pathes ,fonts, enviroment file etc.
The report object's property in the object navigator is as follow:_
+ Oracle Developer Integration node :
File name : My_Report_name
Execution Mode: Runtime
Communication Mode : Synchronous
Data Source data block :NULL
+ Reports node:
Report Destination Type : FileThanks in advance,
Regards,
Abdetu...Thanks InoL for reply,
REPORT_SERVER_IP is not correcti had doubted but wasn't sure of it...!
My First Question was :
Is it requireD for the Parameter form to call a report an Application Server no ???*the answer i found is Yessss
Regards,
Abdetu... -
How to call a Report 10g from a parameter form..?
Hello,
pls i wanna know the procedure of :
How to call a Report 10g from a parameter form..?
regards,
Abdetu..hopes it work for you.
procedure get_report is
pl_id paramlist;
p_year varchar2(4);
param_name varchar2(10) :'param';
begin
pl_id := get_parameter_list(param_name);
if not id_null(pl_id_)then
destroy_parameter_list(pl_id);
end if;
pl_id := create_parameter_list(param_name);
p_year := year -- assign the value.
add_parameter(pl_id,'p_year',text_parameter,p_year);
execute_report('report_name',pl_id);
end; -
Report 10g: Runtime Parameter Form
Is there any way in Reports 10g to trigger Parameter Validation just after
user enters a Parameter?
I would like to have dynamic LOV in Reports Parameter Form....
So contents of LOV list items in Report Parameter #3 would depend on the user selection from LOV in Report Parameter #1It is not as simple as just adding this parameter to the URL. You have to do some coding too.
The basic problem is that the paramform code contains a HTML FORM without any action. So, you have to create an action yourself.
See Metalink note 139546.1 on how to modify your reports (there should be a white paper on OTN too, but I can't find the link anymore).
Bottom line is: yes, it is much simpler to use Forms as your parameter form. -
Pass the file id or a parameter from a report (10g) to the distribution.xml
Is there any way to pass the file id or a parameter from a report (10g) to the distribution.xml file?
Hi,
Please review article ID 273960.1 on metalink.
The article actually describes an issue one may run into while enabling a reports distribution xml file to accept dynamic values, but you can extract the answer you're looking for by studying the above mentioned note.
Best Regards and Good Luck,
Mircea. -
Problem while passing parameter from report to report.
Hi
I'm using forms and reports 10g, hava a problem while passing the parameter from reports to report.
i'm using srw.set_hyperlink to call report from report.
i have created a key value in the cgicmd.dat file called
faccre802005-2006: report=faccre80 destype=cache desformat=pdf userid=<userid/passwd@cs> server=<servername>
Now in the format trigger i'm using this key value
function BTN_DEBITFormatTrigger return boolean is
temp varchar2(5000);
IP_ADDRESS VARCHAR2(50);
SERVER_NAME VARCHAR2(10);
L_ACCT_CODE VARCHAR2(14);
begin
SELECT MAST_INT_DESC,MAST_USER_PGM_ID INTO IP_ADDRESS,SERVER_NAME FROM MAST_INT_INFO WHERE MAST_INT_ID='VISHWA';
temp := IP_ADDRESS||'?faccre80'||:P_FIN_YEAR||'+server='||server_name;
temp :=temp ||'+'||'P_PREVIOUS_CODE='''||:ACCT_CODE||''''||'+'||'P_COMPANY_CODE='''||:P_COMPANY_CODE||'''';
temp :=temp ||'+'|| 'P_FROM_DATE='''||TO_CHAR(:P_FROM_DATE,'DD-MON-RRRR')||''''||'+'|| 'P_TO_DATE='''||TO_CHAR(:P_TO_DATE,'DD-MON-RRRR')||''''||'+'||'P_TRUST_CODE='''|| :P_TRUST_CODE||'''';
temp :=temp ||'+'|| 'P_UNIT_CODE='''||:P_UNIT_CODE||''''||'+'||' P_FIN_YEAR='''||:P_FIN_YEAR||'''';
temp :=temp ||'+'|| 'P_LEVEL='''||:P_LEVEL||''''||'+'||'P_HEADER='''||replace(:P_HEADER,' ','%20')||''''||'+'||'P_FORMAT='''||:P_FORMAT||'''';
SRW.Set_Hyperlink(temp);
END;
return (TRUE);
end;
Report is coming but not the expected result because parmaeters are not coming from first report to second report.
If i dont use cgicmd file userid and password are displyed in the URL.
Pl tell me how to pass parameter from one report to another.
thanks and regardsHi
I got the solution.
I forgot to add %* at end of the KEY value. -
How to make a parameter base report?
I am making a report on employees and departments but i want to choose employees for some required departments for that i need to use parameter, and i need help that how will i make a parameter in reports builder 10g.
I am able to do it by writing a where clause in query but now i want to do it from user parameters. Seek help here.
MazHere is a list of things to do. Let me know if anything is not clear.
1) In your main query create a lexical parameter at the very end of you where clause ( dont put and &p_where just &p_where)
&p_where
2)Create a user parameter with datatype character and width 200
ex: P_departments
3) Create a field on the Paper Parameter Form
4) Click on that field and go to the List of Values (if you want a lov...) and insert the following
Ex:
select 'All',' All Departments' from dual
union
select to_char(department),to_char(department)||' - '||department_name
from departments
order by 1
5) Go to Report Triggers > After Parameters and insert the following
Ex:
begin
:p_where := null;
if :p_departments not like '%All%' then
:p_where := :p_where ||' and table.department = '||:p_departments;
end if;
return (true);
end;
This will allow you to select a department or leave it at the default of all departments. It will also allow you to remove the hardcoded statement in your where clause such as
where department = 'HR'
Edited by: DOUBLE U on Aug 3, 2011 3:32 PM -
Send direct print to printer from client, Reports 10G, Windows environment,
We are using windows 2003 based server. Oracle Form and Report Services . Database 10g . Reports 10G.
Trying to send direct print to printer from client side using Destination Parameter : Printer.
I am getting output in pdf at client side. but direct print to printer is failed.Make sure that the client printer is also known on the application server, since that is where the print job is generated.
-
How to use lexical parameter in report
i want to use lexical parameter in report and pass parameter from form how it is possible in detail
A.RHi,
typically you fill your lexical paramter in the after-paramform-trigger out of the values of your bind-parameters (giving end users directly control over lexical parameters might not be a good idea). Inside PL/SQL a lexical parameter is referenced like bind parameters with ":". In the query it's referenced via "&" and represents a part of the query.
A simple example.
- p_deptno as bind parameter
- p_where as lexical paramter
- end user choose value for p_deptno (10,20,... or nothing)
- Trigger: if :p_deptno is not null then
:p_where := 'WHERE deptno = :p_deptno'
else
:p_where := null;
end if;
- Query select ... from emp &p_where
Regards
Rainer -
4 PDF reports from Single report in reports 10G
Hi All,
i want to generate 4 PDF report from one oracle report in reports 10G.
from the same query i want to generate 4 PDF with different order and result set based upon the query parameter at a single time.
exp: query fetch Some eng/spanish provider and client data. requirement is i want to spilt into 4 PDF:
Provider wise Eng.
Provider wise spanish.
Client wise english.
Client wise spanish.
Can anybody please help on this?
Regards
AbhishekHi All,
i am generating 4 PDF reports from one Oracle reports in 10 G.
i used RUN_REPORT_OBJECT built in 4 times with some different parameter list at a single time.
some time it generates but some time it generate 2 or 3 out of 4.
Can you anyone help me on this issue.
Regards,
Abhishek
Edited by: user651239 on Sep 22, 2008 10:16 PM -
Pass column-name as a parameter to reports
Hello,
the code below calls a report. But now I want to sort the rows in the report. For example I have a text-item in my form-modul. If I type a column-name and press the button then the rows should be sorted in the report. Is it possible tp pass column-names as parameter to reports?
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
BEGIN
repid := find_report_object('STATIONSTOPOLOGIE');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,RUNTIME);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'html');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_oracle-dev');
-- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no pdeptno='||:dept.deptno);
v_rep := RUN_REPORT_OBJECT(repid);
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('http://oracle-dev:8888/reports/rwservlet/getjobid'||
substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=rep_oracle-dev','_blank');
ELSE
message('Error when running report');
END IF;
END;Hi,
the work has been done in reports. You can use a lexical parameter in reports to add a condition for sorting to the query like:
select .. from .. where ... &p_order.
Then add another parameter to the report (for example p_param). Fill p_param via your interface in forms (SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, ....) with the column name. Then build a report trigger like:
if :p_param is null
then
:p_order:= null;
else
:p_order:= 'order by '||:p_param;
end if;
But have a look, that p_param can only get correct values.
Rainer -
How to debug reports in Reports 10g
Hi,
I'm customizing one R12 seeded report.Seeded report is working fine but when I modify the report by changing the query criterion then it's failing.Is there any debug feature like dbsm_output with sqlerrm in reports 10g .I can use srw.message to put messages inbetween.My report is failing in before report trigger itself.In the before report trigger I'm using lot of bind parameter and dynamic query construct.Is there any way I can get actual query construct from dynamic query the way we get it in back end using dbms_output and also trapping errors like sqlerrm?
Thanks,
Kiranyour report is from EBS Release 12?
then you have this sentece
SRW.USER_EXIT('FND SRWINIT');.
a user exit
you can call from the builder
you need to run with this sentence from ebs environment
comment this sentence
and similar in after report trigger
if you use views of ebs you need to set in before report the environment to ebs
you need to use
mo_global.set_policy_context ('S', p_organization_id);
inv_globals.set_org_id (p_organization_id);
fnd_global.apps_initialize (-1, 50587, 401);
the values of app_initialize depending the product that you use, (INV, AP, PO, etc) -
How to Display PDF File on Oracle Report 10g
Dears,
i have a PDF File on the server,
also i need to display this file into rdf report.(Embed the PDF file into Report)
RegardsDear Inol,
I have the same problem I want to embded a PDF, word Doc OR Image in report 10g.
And I put the read from file property YES and File Format OLE2
and it doesnt work by run_web_report by repport server. while in run report layout it works.
And my report server on the same Pc "The file path on the same server". or you can say that im working on the server where the path of the file exists and it doesnt work also.
So what do you think that i have to do to solve this problem.\
by the way i try to Genarate the report to a file in spacefic path then open it. and it didnt work also.
any help will be apreciated.
thanks in advance.
Ashraf -
Hi Gurus,
I am using an Boilerplate in the Reports 10g. In the Property Inspection I am passing
Source File Format : Image
Source FileName : &P_IMG_LOCATION
Where &P_IMG_LOCATION is the dynamic location which is fetched from the database
For Eg . &P_IMG_LOCATION will be \\oracle\logo.bmp
But It is giving accepting &P_IMG_LOCATION in the Source FileName.
Please tell me how can i pass the location???
Best Regards,Yeah, you can't do that. Instead, in your data model, create a formula column that is populated from &p_img_location. Then, set the "Read from File" property to "Yes" and the "File Format" to "Image". In your layout, create a new field and use the new formula column as the source.
Message was edited by:
Brian Hill
Maybe you are looking for
-
Is Firefox 4.0 compatible with Zorap (video chat)? I have used it perfectly with Firefox 3, but since I d/loaded 4.0 I am unable to use the program. Is there an option that I must adjust? Would appreciatre your help.
-
How we can get an interactive report in alv grid display?
Hi experts Plz tell me how we can get an interactive report in alv grid disply pls send me one sample code to understand this thanks in advance
-
Any help with easy to understand directions would be greatly appreciated. So far I have not been able to understand forum threads. Thank you!
-
I have brought new omini tab. After updating and insert memory card tab was showing non responsive start button ocons. Now after trying many times it is not getting startedany more. This question was solved. View Solution.
-
Long term planning material not displayed in MS04
Hi, May I request your assistance on my issue? When I run the MS04 one of the component material is not displaying. I have change the planning period and run again the MS03 for a specific material which is the finished material. My component is now d