Lexical parameters

I have a item table containing all the item no's of varchar datatype as the master key.
In reports I have item no as a parameter which on selection displays all the details abt the item.
In the LOV I have also included 'ALL' which on selection displays all the details of all the item no's.
I have written the following After Parameter Form Trigger
function AfterPForm return boolean is
begin
     IF :PF_1 = 'ALL' THEN
     :PF_1 := NULL;
ELSE
     :PF_1 := 'AND S.ITEM =' ||:PF_1;
END IF;
return (TRUE);
end;
Here PF_1 is the parameter which returns item no.
The above displayed code is working fine when 'ALL' is selected but when ypu select individual product no's (e.g. P001) it displays the following error.
Rep-1401:'afterpform':Fatal PLSQL error ocurred.
ORA-06502:PLSQL:numeric or value error.
Please anyone can tell me how to rectify the error.

Also you can check the type of :PF_1, you can also try this:
PF_1 := 'AND S.ITEM like' ||:PF_1;
So,you code remains as follow,
begin
IF :PF_1 = 'ALL' THEN
:PF_1 := NULL; --or you can put :PF_1:='AND 1=1'
ELSE
:PF_1 := 'AND S.ITEM like ' ||:PF_1;
END IF;
return (TRUE);
end;
If you're working with reports 6i,you can also try this:
PF_1 := 'AND S.ITEM =='||''''||:PF_1||'''';
I found some trouble that were solve adding ""
aguero

Similar Messages

  • Help desiging a 10g Oracle Report with Matrix and Lexical Parameters - Long

    Hello all:
    I apologize in advance for this long post.... I'm using Oracle Reports 10g (9.0.4.0.33). First -- the question:
    I need to create a Matrix where the rows come from one database table
    (TABLE1) and the columns and cell contents come from a linked query (pulled from TABLE2) that is generated with lexical parameters based on the current TABLE1 row. The lexical parameters contain a WHERE clause for the TABLE2 query. Basically, I have a linked query between TABLE1 and TABLE2. I need to generate a Matrix around it.
    Does anyone know if this is even possible?
    Here's the background on the application, if that is helpful...
    I have an application where I maintain database tables containing names/addresses along with information pertaining to them. As part of the processing, I need to produce reports that contain statistics based on values in the table. For example, each row has a field RTYPE that identifies the Record Type (1-Suppress, 2-Buyer, 3-Inquirer). Each row also has a last purchase date field. The statistics produced for this field would look like this:
              2001     2002     2003     11/03     12/03 01/04     02/04 03/04     04/04     05/04 ...
    Buyer      100 150 250 30 25 15 8 9 22 83
    Inquirer     1000 800 493 ...
    Suppress ... ...
    Totals ... ...
    Each cell contains the count of the number of records that have the corresponding RTYPE and Last Purchase date. The dates across the top are determined by the most recent purchase date in the file. We count the last 12 months, month by month, and then anything older than that is grouped by
    year of purchase. So, the column headings are variable.
    The SQL query for this example looks like this:
    SELECT CASE WHEN rtype = '2' THEN 'Buyers'
    WHEN rtype = '3' THEN 'Inquirers'
    WHEN rtype = '1' THEN 'Suppress'
    END HLDESC,
    CASE WHEN MONTHS_BETWEEN(trunc(:MAXHLDATE,'MONTH'),
    TRUNC(T.HOTLINE,'MONTH')) < 12
    THEN TO_CHAR(T.HOTLINE,'YYYYMM')
    ELSE TO_CHAR(T.HOTLINE,'YYYY') || '00'
    END YYMM_8,
    CASE WHEN MONTHS_BETWEEN(trunc(:MAXHLDATE,'MONTH'),
    TRUNC(T.HOTLINE,'MONTH')) < 12
    THEN TO_CHAR(T.HOTLINE,'MM/YY')
    ELSE TO_CHAR(T.HOTLINE, 'YYYY')
    END FmtDate_8,
    COUNT(*) HLCOUNT
    FROM &TABLENAME T
    GROUP BY CASE WHEN rtype = '2' THEN 'Buyers'
    WHEN rtype = '3' THEN 'Inquirers'
    WHEN rtype = '1' THEN 'Suppress'
    END,
    CASE WHEN MONTHS_BETWEEN(trunc(:MAXHLDATE,'MONTH'),
    TRUNC(T.HOTLINE,'MONTH')) < 12
    THEN TO_CHAR(T.HOTLINE,'YYYYMM')
    ELSE TO_CHAR(T.HOTLINE,'YYYY') || '00'
    END,
    CASE WHEN MONTHS_BETWEEN(trunc(:MAXHLDATE,'MONTH'),
    TRUNC(T.HOTLINE,'MONTH')) < 12
    THEN TO_CHAR(T.HOTLINE,'MM/YY')
    ELSE TO_CHAR(T.HOTLINE, 'YYYY')
    END
    ORDER BY CASE WHEN MONTHS_BETWEEN(trunc(:MAXHLDATE,'MONTH'),
    TRUNC(T.HOTLINE,'MONTH')) < 12
    THEN TO_CHAR(T.HOTLINE,'YYYYMM')
    ELSE TO_CHAR(T.HOTLINE,'YYYY') || '00'
    END
    There might be a better way to write this, but that isn't the issue at the moment.
    I have many different tables, each with different fields. I need to produce counts on each of those fields. Some of those fields have a limited number of values where I need to count the occurrences and attach a description (like the RTYPE counts above). Others, like Last Purchase Amount, require counts within ranges (between 0 and 9.99, 10 and 19.99, etc.). Still others are "multiple choice"-style fields (such as products purchased), where we have multiple single-char flags that are not null when the corresponding products are purchased. In this case, we need to produce statistics that look like this:
              2001     2002     2003     11/03     12/03 01/04     02/04 03/04     04/04     05/04 ...
    Product 1 .........
    Product 2 .........
    The worst of the bunch is a field where I need to count the occurrence of each value within it (hundreds of values) without entering descriptions, so I don't know how many rows will appear ahead of time. This is used for "source codes" that identify where the name/address came from. They look similar to the RTYPE above, but the leftmost column contains each value from the field rather than a description. There are so many possible values and they change so often that it isn't feasible to enter a description for each one.
    Right now, I manually create an Oracle Report for each table when I design/load it. This is becoming difficult to manage, since I have over 150 of them now. Each of these reports can have any number of matrices to display (the largest right now has about 25).
    The new table structure to generate these reports consists of two tables: A COUNTHDR table and a COUNTROW table. The COUNTHDR table represents a single Matrix within the report. It contains info such as a heading for the Matrix and whether column totals should be calculated or not. The COUNTROW table contains a description for each row and an SQL Fragment that contains an appropriate WHERE clause to match the description. In the event of a "source code" style count, COUNTHDR has the name of the field to count. COUNTROWs won't exist, so I'll be handling those counts differently. But, ignoring that issue for now, the report structure looks like this:
    + Q1 +
    |
    + COUNTHDR +
    |
    + COUNTROW +
    | linked query
    + Q2 +
    |
    + COUNTDTL +
    Q2 is the query with lexical parameters for the table and "where clause" that identifies the actual statistic I need counted. I need fields from COUNTROW and COUNTDTL to form a Matrix.
    Can this be done? How?
    Of course, if anyone out there has a better idea on how to achieve my goal of not writing a report per table, please let me know!! :-)
    TIA
    Eric Raskin
    PS. This structure does not exactly duplicate my original query, since multiple Matrix rows are created by the single SQL query given in the example. Instead, I'll end up executing an SQL query for each row, which is less than desirable. The design will need some tweaking...
    PPS. I have tried handling this problem by pre-counting the target table and storing the results in a COUNTCOL table, containing the details of the matrix. This actually does work, but the performance is terrible. I have one "source code"-style count that generated over 20,000 detail cells, including all the "0" cells needed to fill out the matrix. If you don't generate the "0" cells, you get holes in the matrix presentation and/or error messages (which I can explain if you wish). I never did get Oracle Reports to print this one -- I gave up after an hour of runtime on a P4 3GHz machine connected via Gigabit Ethernet to the server. Hence the attempt to push the SQL Queries back into the Oracle Report itself.
    Eric H. Raskin Voice: 914-765-0500
    Professional Advertising Systems Inc. Fax: 914-765-0503
    200 Business Park Dr Suite 107 [email protected]
    Armonk, NY 10504

    Hi there
    here's example of my code
    Html header of the page :
    <script language="JavaScript" type="text/javascript">
    function callMyPopup (formItem1,formItem2) {
    var formVal1 = document.getElementById(formItem1).value;
    var formVal2 = document.getElementById(formItem2).value;
    var url;
    url = 'f?p=&APP_ID.:8:&APP_SESSION.::::P8_PROJECT,P8_PDRL_NO:' + formVal1 + ',' + formVal2;
    w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600");
    if (w.opener == null)
    w.opener = self;
    w.focus();
    </script>
    troubleshooting
    1.Test each parameter separate first - each work ?
    2.Use code above, rerig it, create multiple parameter
    3.try again...
    hope this helps...
    check your orginial source (page where items are) - what data

  • Not all lexical parameters are being bound

    Reports SQL parser is binding to only 2 of 4 variables. SQL TRACE option confirms this:
    AND CABCHCK_CORT_CODE = :P_COURT_CODE
    AND CABCHCK_LOCN_CODE = :P_COURT_LOCATION_CODE
    AND CABCHCK.CABCHCK_DATE >= TO_DATE(:P_DATE_FROM)
    AND CABCHCK.CABCHCK_DATE <= TO_DATE(:P_DATE_TO)
    Bind Variable Value
    P_COURT_CODE 23
    P_COURT_LOCATION_CODE TC
    Note that :P_DATE_FROM and :P_DATE_TO are not shown in the trace as a 'Bind Variable'. The error message when running the report is:
    ORA-01008: not all variables bound
    This is a report which has previously worked and where the SQL code and the lexical parameters have not changed (but the layout changed slightly). Could this be yet another corrupted .rdf file? If so, how is this circumvented?
    Regards,
    Steve

    The issue has been found and solved.
    The SQL code is loaded into a lexiconal variable and run from the query. For example,
    :P_WHERE_COURT = 'and cabchck_cort_code = :p_court_code';
    This was in the BEFORE_REPORT trigger. It worked.
    However, the third and forth lines (with the TO_DATE function call) were not working. In the SQL statement, the functions referenced the :P_DATE fields but they weren't bound.
    The date statements were loaded in the same BEFORE_REPORT trigger as the court and location lines. By moving all of the code into the AFTER_PARAMETER trigger, the errors went away and the SQL processed normally.
    Why would this move from BEFORE_REPORT to AFTER_PARAMETER have done this?

  • How to use lexical parameters with Sql Server Stored Procedure?

    Hi,
    I'm developing a BI Publisher report on a sql server database. I need to execute a stored procedure to dynamically build the query by replacing the lexical parameters with the values of varaibles of the stored procedure. With Oracle stored procedures, I have used data template and had reference the varaiable in SP by prefixing it with '&'.
    It doesn't work if I try to do the same thing with SQL server. Is there anyone who has come across the similar situation? Please let me know if anyone has got any ideas...
    Thanks in Advance
    Rag

    TopLink currently doesn't support multiple ResultSets. Multiple ResultSets support is considered for a future release.

  • Problem in executing report using rwrun.sh with runtime/lexical parameters

    hi..
    My problem is as follows..
    I'm using SuSE8.0, with Oracle DS installed..
    I made a rep file to execute a report from command line using rwrun.sh.
    For the first time I got problems with single quotes and later I solved it by using \ as escape sequence and I can generate the report.
    I have 2 lexical parameters.
    1) atable --> for table names
    2) whereford --> for WHERE condition
    When I make the following command I execute it successfully and get the report .
    /opt/oracle/OraHome1/bin/rwrun.sh /opt/jakarta/webapps/ROOT/std-reports/DiagnoseProtokolle.rep userid=test/test@approxim batch=yes desname=/opt/jakarta/webapps/ROOT/kovi_361_Report.PDF destype=file desformat=PDF atable=\',SD_DIAGNOSESYSTEME\' whereford=\'\ \(\(\ SD_DIAGNOSESYSTEME.bezeichnung\ =\'AIRBAG\'\ \)\)\ AND\ \(\(\ SD_DIAGNOSESYSTEME.bezeichnung\ =\'ABS\'\ \)\)\ AND\' tracefile=/opt/jakarta/webapps/ROOT/trace/trace.log tracemode=TRACE_REPLACE
    ** In one line..
    If I don't use \ for escaping braces it doesn't work and also for spaces and single quotes.
    I use braces as I get sometimes mixed conditions..
    But when I make a condition like for eg: emp.emp_id = dept.emp_emp_id it is not executing..
    i mean primary key is referd to foreign key of another table.
    so in the same way the error prone command looks like this
    /opt/oracle/OraHome1/bin/rwrun.sh /opt/jakarta/webapps/ROOT/std-reports/DiagnoseProtokolle.rep userid=test/test@approxim batch=yes desname=/opt/jakarta/webapps/ROOT/kovi_361_Report.PDF destype=file desformat=PDF atable=\',MESSWERTE,SD_DIAGNOSESYSTEME\' whereford=\'\ \(\(\ MESSWERTE.mess_id\ =\ SD_DIAGNOSESYSTEME.mess_mess_id\ AND\ SD_DIAGNOSESYSTEME.bezeichnung\ =\'AIRBAG\'\ \)\)\ AND\ \(\(\ SD_DIAGNOSESYSTEME.bezeichnung\ =\'ABS\'\ \)\)\ AND\' tracefile=/opt/jakarta/webapps/ROOT/trace/trace.log tracemode=TRACE_REPLACE
    when I had a look at the trace.log file I see that particular condition is transformed in to
    MESSWERTE.mess_id = 'SD_DIAGNOSESYSTEME.mess_mess_id'
    but this is completely awkward.
    Then I made a batch file and tested it on windows and i put the whole condition in double quotes and it worked always fine..
    It seems the problem is with the shell ..or ??
    In my rwrun.sh th elast line looks like this..
    $ORACLE_HOME/bin/rwrun $*
    I also tried to chaneg this to
    $ORACLE_HOME/bin/rwrun "$@" and also $ORACLE_HOME/bin/rwrun "$*"
    but no progress..
    If some one could help me it would be gratefull for me..
    Thanx in advance..
    regards
    Kovi

    Here's the relevant portion from the Bash manual:
    Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, `, and \. The characters $ and ` retain their special meaning within double quotes. The backslash retains its special meaning only when followed by one of the following characters: $, `, ", \, or <newline>. A double quote may be quoted within double quotes by preceding it with a backslash.
    So basically stop escaping the single-quotes with a backslash, and instead enclose the entire argument value in double-quotes. Add the single-quotes only if you want them literally, don't escape the parentheses, etc. Let's know if it works for you.
    -Manish

  • Usage of Lexical Parameters in PL/SQL code

    Hello Everyone,
    I am trying to use a query in the pl/sql code which has 9 parameters ( Earlier this query was used in a Report i.e. report6i , so we used the lexical parameter to handle the parameters). But according to our new requirement i have to use this query with the same set of parameters in a PL/SQL code.
    To be more specific of the 9 input parameters to the report one of the parameter is order_date_from and order_date_to. the possibilities are like
    order_date_from = null and order_date_to = null
    order_date_from = not null (some value) and order_date_to = null
    order_date_from = null and order_date_to = not null (some value)
    order_date_from = not null (some value) and order_date_to =not null (some value)
    these above four possibilities are for one lexical parameter (say) like this i have six more combinations.
    Since PL/SQL doesnt support any lexical parameters do i have any other way to handle this situation ?? Any help is greatly appreciated.
    Thanks
    Tarun

    If your columns are named order_date_from and order_date_to and your corresponding parameters are named p_order_date_from and p_order_date_to then you can go with the following approach.
    WHERE order_date_from = NVL(p_order_date_from, order_date_from)
       AND order_date_to = NVL(p_order_date_to, order_date_to)Message was edited by:
    scott.swank

  • Using Lexical Parameters in OBIEE 11g Publisher

    Hello All,
    I want to know if there is a provision to use lexical parameters to be used in 11g Publisher. I know we could do this in 10g Publisher with the use of data template and database package. This is a very useful functionality to dynamically deduce the SELECT and WHERE clauses based on the input parameters.
    For what I have explored, this functionality seems to be missing in 11g.
    Can anybody throw some light on this please?

    Does anyone know about this please?

  • Maximum size - Lexical Parameters - Report 2.5

    Hi
    We are using Oracle Reports 2.5 .
    Want to know what is the maximus size we can have for a lexical parameter .
    Is it 2000 chars ?
    We have 3 lexical parameters in our where clause of the query .
    What is the maximum Length of the 3 lexical parameters (combined) we can have ?
    Thanks

    Post Author: Aravind
    CA Forum: Older Products
    Hi Kai,Thanks for the reply.I can see that the maximum cache size has been set to 10000KB.Does this govern the number of records that is returned by a report?The idle jobs get closed in 20 minutes. Could you please provide me a pointer of where do we set up this parameter of limitting the number of records that a report returns? Thanks again,Aravind.   

  • Question about lexical parameters

    They are passing me parameters field with the data such as test,test,test for a field. I am supposed to pick that up and create a lexical parameter.
    How do I read that parameter to create the following.
    and fieldname not in ('test','test','test')
    I want to append this to my sql for instance.
    select * from testTable where userid := :P_USERID
    &P_SQL

    Assume they send you the field list in a parameter called paramlist and they seperate the fields by @ then
    You need the following
         :P_SQL := 'AND fieldname not IN ('''||REPLACE(:paramlist,'@',''',''')||''')';     
    You can use other charachters than @

  • How to include lexical parameters in IN string in SQL QUERY BUILDER ?

    Hi,
    I have to write an SQL Query in SQL QUERY BUILDER in Reports 6i to retrieve all details pertaining to donor codes i insert randomnly at runtime.
    The Statement is like this
    SELECT TITLE_TAB.TITLE_CODE,DONOR_TAB.DONOR_CODE, DONOR_TAB.FIRST_NAME,DONOR_TAB.MIDDLE_NAME,DONOR_TAB.LAST_NAME,CITY_MASTER_TAB.CITY_CODE FROM DONOR_TAB,CITY_MASTER_TAB,TITLE_TAB
    WHERE DONOR_CODE IN (1,2,6,70,....)
    I cannot use lexical parameter '&' in SQL QUERY BUILDER as i have to use bind variable donor_code.
    How do i do it?

    How do i do that? Can you give me an example of how i can go about with it?

  • Run Report Object and Lexical Parameters

    Hi all,
    I am trying to pass a value for a lexical parameter in a report. The report query is as follows:
    SELECT EMP.EMPNO, EMP.ENAME,
    EMP.JOB, EMP.MGR, EMP.HIREDATE, EMP.SAL, EMP.COMM, EMP.DEPTNO
    FROM EMP
    &Where_St
    The Where_St is a lexical parameter which will hold the Where Statement the end user need it to be executed.
    I build a form on the EMP table in order to let the user get benefit from the Enter Query/Execute Query functionality in forms. Like this, he/she can query the data he likes with the condtions he wish to have.
    I created a button to call the report I did before from the form
    The Button has the following code in the trigger
    WHEN-BUTTON-PRESSED
    declare
    rep_id report_object;
    rep_status varchar2(30);
    Where_Pos number(3);
    Where_Statement varchar2(200);
    begin
    Where_Pos := InStr(:System.Last_Query, 'WHERE');
    if Where_Pos > 0 then
    Where_Statement := SubStr(:System.Last_Query,
    Where_Pos);
    end if;
    rep_id := Find_Report_Object('emp_rep');
    Set_Report_Object_Property(rep_id, REPORT_EXECUTION_MODE, RUNTIME);
    Set_Report_Object_Property(rep_id, REPORT_COMM_MODE, ASYNCHRONOUS);
    Set_Report_Object_Property(rep_id, REPORT_DESTYPE, PREVIEW);
    Set_Report_Object_Property(rep_id, REPORT_OTHER, 'MAXIMIZE=YES Where_St=' &#0124; &#0124; Where_Statement);
    rep_status := Run_Report_Object(rep_id);
    end;
    Whenever I run the report it did not show up at all. I doubt the value I am passing, so I deleted the line that pass the value for the Lexical parameter to the report. The report worked just fine.
    Moreover, I passed this value using Run_Product to the reports and the report is working fine with the forms. But I would like to use Run_Report_Object to pass this value to the reports.
    Any ideas??
    Thanks

    PROCEDURE PROC_test IS
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(100);
    v_server_length NUMBER;
    REP_SERV VARCHAR2(100);
    paramlist_id ParamList;
    paramlist_name VARCHAR2(10):='tmplist';
    Begin
    repid := find_report_object('HIST_DISPENSE');
    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_ORACLEWEB');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no R_ST_DT='||:BLK_A_NUM_GT7_NO_HIS_DISP.FROM_DATE 'paramform=no R_END_DT='||:BLK_A_NUM_GT7_NO_HIS_DISP.TODATE);
    v_rep := RUN_REPORT_OBJECT(repid,paramlist_id);
    message('vrep is '||v_rep);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    message('status is'||rep_status);
    v_server_length := LENGTH(GET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER));
    message('server length is '||v_server_length );
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    message('REP STATUS IS'||rep_status);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('http://10.20.56.20:7778/reports/rwservlet/getjobid'||
    substr(v_rep,v_server_length + 2)||'?'||'server=REP_ORACLEWEB','_blank');
    ELSE
    message('Error when running report');
    message('SQLERRM ' ||SQLERRM);
    END IF;
    end;
    Hi
    I'm having problem passing two paramters, Pl helpme by correcting the syntax.
    Thx

  • IN Clause with Ampersand(Lexical Parameters) not working plz help

    hi
    I m writing the following query but it is not working. plz help how can i apply ampersend(lexical parameter) with IN clause.
    select * from emp where to_number(empno) IN (&p_1);
    thnx

    Hi,
    Try to change the query as
    SELECT <field_list> FROM EMP &P_1and in the AFTER PARAMETER FORM trigger write the WHERE condition including the WHERE clause, Column_Name etc.
    Hope this helps.
    Regards,
    Manu.

  • Lexical parameters problem ?

    In my data model ,
    I have plsql function which returns ref.cursor.
    with in the function my sql query wants dynamic order by ?
    is it possible ?
    If possible when I pass deptno,mgr I want the resultent records based on deptno,mgr.
    when i pass ename,deptno I want the resultent records based on ename,deptno.
    how can i do this ?
    thanx for help.
    srini

    You need to create dynamic SQL cursors. Check the PL/SQL manual "Chapter 11: Native Dynamic SQL".
    Examples of Dynamic SQL for Records, Objects, and Collections
    As the following example shows, you can fetch rows from the result set of a dynamic multi-row query into a record:
    DECLARE
    TYPE EmpCurTyp IS REF CURSOR;
    emp_cv EmpCurTyp;
    emp_rec emp%ROWTYPE;
    sql_stmt VARCHAR2(200);
    my_job VARCHAR2(15) := 'CLERK';
    BEGIN
    sql_stmt := 'SELECT * FROM emp' || ' WHERE job = :j';
    OPEN emp_cv FOR sql_stmt USING my_job;
    LOOP
    FETCH emp_cv INTO emp_rec;
    EXIT WHEN emp_cv%NOTFOUND;
    -- process record
    END LOOP;
    CLOSE emp_cv;
    END;

  • Please Help to use lexical parameters

    HAI, PLEASE HELP ME..
    I CREATE ON REPORT QUERY IS
    SELECT FACILITY_ID,CODE,NAME FROM CUSTOMER
    &WHERE_CLAUSE
    MY AIM TO TO PASS VALUE FOR &WHERE_CLAUSE FROM FORM
    I CREATE ONE BUTTON AND WRITE
    declare
    repid report_object;
    v_rep varchar2(100);
    v_jobid varchar2(10);
    v_repserver varchar2(20);
    v_repstat varchar2(20);
    v_where varchar2(200);
    begin
    v_where:='WHERE SOH.FACILITY_ID'||:MAIN.FACILITY_ID||' AND CODE='||:MAIN.CODE;      
    repid := find_report_object('SHOP_ORDER_REPORT');
    v_repserver := 'SUHAILREPORTS';
    set_report_object_property(repid,REPORT_DESTYPE,FILE);
    set_report_object_property(repid,REPORT_DESFORMAT, 'HTMLCSS');
    set_report_object_property(repid,REPORT_SERVER, v_repserver);
    set_report_object_property(repid,report_filename,'SHOP_ORDER_REPORT');
    set_report_object_property(repid, report_other, 'WHERE_CLAUSE='||v_where);
    v_rep := RUN_REPORT_OBJECT(repid);
    if v_rep is not null then
    v_jobid := substr(v_rep,(instr(v_rep,'_',-1)+1));
    v_repstat := report_object_status(v_rep);
    end if;
    if v_jobid > 0 then
    web.show_document ('/reports/rwservlet/getjobid'|| v_jobid ||'?server='|| v_repserver,'_SELF');
    end if;
    end;
    but when i run report it shows me
    uable to run report
    unable to report job status
    pls help me

    Hi,
    I think for this purpose you have to try Fromatt trigger.
    Thanks
    Shishu Paul

  • Report based on parameters

    I would like to create a report that runs a different sql statement based on the parameters passed in. The column layout won't change but the group by sections will(I think I can handle that by suppressing field when parameter is null). For example, the parameter asks for Division, Branch and Group. If the user only puts in Division I would like to run a different sql statement then if the user provides Division, Branch or Division, Branch and Group. Thank you very much in advance for your help!
    Holly

    You should start by looking at lexical parameters in the on-line help and seeing how you can alter SQL statements programatically using them.
    You should also look at using format triggers to turn 'off' certain layout objects (by returning false).
    Hope this helps,
    Danny

Maybe you are looking for