Lexical Parameter in Matrix Report

Hi ,
I am faced a problem when i used lexical Parameter in Matrix Report.
I design Query and Report in Group Above Mode The Lexical Parameter
Show the Values in the Field but when I make This Report in Matrix then
This Lexical Parameter Showes The Value Null I try many Solution
But it shows null value in the Output
Thanks

i think you didn't read that i'm mentioned
in datatemplate
<parameters>
<parameter name="P_YOUR_PARAM" dataType = "number" defaultValue="0"></parameter>
</parameters>
<sqlStatement name="Q_DATA">
<![CDATA[
select &your_columns
from  &your_tables
where &your_where_clause
]]>
</sqlStatement>
</dataQuery>
<dataTrigger name="beforeReportTrigger" source="XX_YOUR_PKG.BeforeReport"/>
<dataStructure>
...in package
FUNCTION BeforeReport RETURN BOOLEAN IS
BEGIN
IF P_YOUR_PARAM = 'some_value' THEN
  your_columns := 'column1, column2';
  your_tables := 'table1, table2';
  your_where_clause := 'table1.id = table2.id';
ELSE
  your_columns := 'column3, column4';
  your_tables := 'table2, table3';
  your_where_clause := 'table2.id = table3.id';
END IF;
END;you can use another way - create your xml output by package like
fnd_file.put_line(fnd_file.output, '<ROWSET>');
fnd_file.put_line(fnd_file.output, '<ROW>');
fnd_file.put_line(fnd_file.output, '<DAT>' || some_value || '</DAT>');
fnd_file.put_line(fnd_file.output, '</ROW>');
fnd_file.put_line(fnd_file.output, '</ROWSET>');in package you can use all that you want

Similar Messages

  • How to define Lexical Parameter in Oracle report.

    Dear all,
    I need to know that how i will define lexical parameter in query of report builder
    i have like this
    SELECT R.EXCEPTION_MESSAGE EXP_MESSAGE,
    ER.PROD_ID PRODUCT,
    ER.TNAME SEGMENT1 ,
    DECODE(R.STATUS,'Y','ROW',
    'L','TABLE',
    'Z','CIB LEVEL',
    NULL) STATUS,
    NVL(COUNT(*),0) CNT
    FROM EXCEPTION_RECORDS ER,CIB_PROC_TABLES_RULES R
    WHERE ER.TABLE_ID=R.CIB_TABLE_ID
    AND ER.EXP LIKE '%'||R.EXCEPTION_MESSAGE||'%'
    AND ER.BRWR=:v_brwr
    &v_where
    GROUP BY R.EXCEPTION_MESSAGE,ER.PROD_ID,ER.TNAME,R.STATUS
    ORDER BY 2
    It is giving an error

    V_WHERE should be defined same way as regular parameter. It should acquire certain value that makes the query syntaxically correct bofore the sql is run, usually in the After Param Form trigger, e.g.
    v_where := 'WHERE 1=1';
    ...

  • Lexical Parameter in Oracle Reports . . .

    Hi all,
    I am trying to pass a value to a query in oracle reports . . .
    the use of the parameter is to add 2 additional columns to an existing query, if a bind parameter is set to 'Yes' else the parameter carries a value NULL;
    Here is the code I have written in After Parameter Form:
    if :P_ROLL_DETAIL_PRN='Yes' then
    :P_CUSTOM_CODE:=NULL;
    :P_CUSTOM_CODE:=:P_CUSTOM_CODE||'wdd.LOT_NUMBER' ||','||'wdd.SUBLOT_NUMBER';
    else
    :P_CUSTOM_CODE:='';
    end if;
    P_Roll_detail is the bind parameter . . and P_CUSTOM_CODE is the Lexical Parameter . ..
    It works for value 'No' of P_ROLL_DETAIL .. . but for Value 'Yes' I get an error . . .
    REP-0499: Column '' selected by the query is incompatible with report defination
    Kindly help...
    Regards
    Jagan

    Lexical parameters can not be used to change the number of selected columns. Consider selecting max number of columns always, but populating last two columns with either NULL values or table columns based on the parameter. Also, manipulations can be done in the layout model using format triggers.

  • Lexical parameter in bi report

    Hi All,
    I have a requirement as below :
    I have a select query in my XML file which is returning two rows for a order
    ex: select email,fax,order_number from
    oe_order_headers_all
    hz_contact_points,
    My requirement is i need to pass 3 parameters such as order_number, email, fax to the report in that case it should take only the parameters what i am passing, and it should not take the hz_contact_points table from the query
    so i need to achieve this through lexical parameter, any one please help me on this.
    Thanks

    i think you didn't read that i'm mentioned
    in datatemplate
    <parameters>
    <parameter name="P_YOUR_PARAM" dataType = "number" defaultValue="0"></parameter>
    </parameters>
    <sqlStatement name="Q_DATA">
    <![CDATA[
    select &your_columns
    from  &your_tables
    where &your_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReportTrigger" source="XX_YOUR_PKG.BeforeReport"/>
    <dataStructure>
    ...in package
    FUNCTION BeforeReport RETURN BOOLEAN IS
    BEGIN
    IF P_YOUR_PARAM = 'some_value' THEN
      your_columns := 'column1, column2';
      your_tables := 'table1, table2';
      your_where_clause := 'table1.id = table2.id';
    ELSE
      your_columns := 'column3, column4';
      your_tables := 'table2, table3';
      your_where_clause := 'table2.id = table3.id';
    END IF;
    END;you can use another way - create your xml output by package like
    fnd_file.put_line(fnd_file.output, '<ROWSET>');
    fnd_file.put_line(fnd_file.output, '<ROW>');
    fnd_file.put_line(fnd_file.output, '<DAT>' || some_value || '</DAT>');
    fnd_file.put_line(fnd_file.output, '</ROW>');
    fnd_file.put_line(fnd_file.output, '</ROWSET>');in package you can use all that you want

  • Problem when using WEB.SHOW_DOCUMENT and passing in lexical parameter

    Hi,
    I got a blank page with error "An error has occured while trying to use this document" when I tried to use web.show_document and passing a lexical parameter to 10g report on 10gAS. The URL in the web.show_document is:
    http://<srvname>:<portnum>/reports/rwservlet?server=repserver90&report=myrpt.rdf&destype=Cache&desformat=pdf&userid=<usr>/<pw>@<db>&where_clause=where%20product_type%20in%20('REPORT')
    If I change the desformat to htmlcss, it is fine to display the report. But doesn't work with desformat=pdf. The pdf file has been generated in the cache. Why can't it display on the screen.
    Also I tried to use double quote the value for where_clause. The pdf report showed up. But it ignored the where clause.
    Experts please help.
    Ying

    I use lexical parameters and they work fine, but I use a parameter list. The code is contained in a form that is called by all forms that wish to run a report. This way you only need the logic for printing in a single form. If you want the form, email me at [email protected]

  • 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.R

    Hi,
    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

  • Calling report from form with lexical parameter

    hi
    DECLARE
         repid REPORT_OBJECT;
         v_rep VARCHAR2(1000);
         rep_status VARCHAR2(20);
    BEGIN
              repid := FIND_REPORT_OBJECT( 'REPORT34' );
              set_report_object_property(repid,report_other,'p_SEASON_YEAR='||:SALE_ORDER.SEASON_YEAR
              ||' &sort='||:sale_order.sort1);
              --set_report_object_property(repid,report_other,'p_g_id =20');
              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
    --Display report in the browser
    WEB.SHOW_DOCUMENT('http://127.0.0.1:8889/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
    ELSE
    message('Error when running report');
    END IF;
    PAUSE;
    END;i had made a lexical parameter in reports the reports code is
    SELECT s.season_year,sd.prod_id,P.PROD_NAME,sum(sd.total_qty)
    FROM sale_order s,sale_order_detail sd,PRODUCT P,CUSTOMER_MASTER cm,CUSTOMER_DETAIL cd
    where s.id=sd.id and P.PROD_ID=SD.PROD_ID AND s.season_year = :p_season_year
    AND CD.CUST_ID=CM.CUST_ID AND CD.CUST_ID=S.CUST_ID AND CD.COUNTRY NOT LIKE 'SPA%' AND Sd.PROD_ID LIKE  'CA%'
    group by s.season_year,sd.prod_id,P.PROD_NAME
    &sortthanks and regards
    vikas

    Vikas,
    So, is your code producing an error when your report is called? Also, it would be helpful to know your Forms and Reports versions. Is ":p_season_year" set up as a USER_PARAMETER (UP) in your report or is it a true lexical parameter (meaning you should reference it with '&' instead of ':')? If it is a UP, the typical way to pass a value to this UP from Forms is to use a ParamList object instead of the REPORT_OTHER parameter of the Set_Report_Object_Property built-in. For example:
    DECLARE
       pl_id    ParamList;
       pl_name  VARCHAR2(10) := 'REPORT34';
       v_rep VARCHAR2(1000);
       rep_status VARCHAR2(20);
    BEGIN
       pl_id := Get_Parameter_List(pl_name);
       IF id_null(pl_id) THEN
          pl_id := Create_Parameter_List(pl_name);
       END IF;
       Add_Parameter(pl_id, 'P_SEASON_YEAR', TEXT_PARAMETER, :SALE_ORDER.SEASON_YEAR);
       repid := FIND_REPORT_OBJECT( 'REPORT34' );
       v_rep := RUN_REPORT_OBJECT(repid, pl_id);
       ...  rest of your code here  ...
    END;Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • SSRS Matrix report to show or hide year column based on parameter value "Date" selected.

    Hey experts!
    I have a requirement an ssrs matrix report should display columns (year/s) based on parameter value (date/s). 
    My Dataset fileds are: Product, Year_name, Month_name, Date
    Currently my report output looks like this-
    Param Date: 2013-08-01 00:00:0.000
    Product +Calender2011      +Calender2012     -Calender 2013........                        +Calender2014
                             Total
                      Total Jan13  Feb 13  Mar13..  Dec13   Total           Total
    Abc                      100
                        220
    10      20         30.......  20       250              400
    Xyz 110
    200 50      80         40.......  30       450              600
    My requirement:  if I'm selecting Date parameter value as '2013-xx-xx' I should only able to see Year column 'Calender2013' and rest of the years should hide. Similarly If I'm selecting Date parameter value as '2014-xx-xx' I should only able to
    see Year column 'Calender2014' .
    Appreciate your kindly help. 
    Afan

    Hi Afan,
    According to your description, you want to only show the selected year on your report, right?
    In this case, you need to get the year from the date parameter using the expression below
    =Year(Parameters!Date.Value)
    And then use the expression below to get the year from Year_Name field.
    =Right(Fields!Year_Name.Value,4)
    Then add a filter to the dataset to filter the data like below
    Expression:=Year(Parameters!Date.Value)
    Operator:=
    Value:=Right(Fields!Year_Name.Value,4)
    Reference
    http://msdn.microsoft.com/en-IN/library/dd255287.aspx
    If you have any questions, please feel free to ask.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Run Report with Pass Number and Varchar Lexical Parameter values

    Dear Sir/Madam
    Due to an urgent change required to a report I would most appreciate it if you can please advise me if it is possible to get this report working by either passing in multiple lexical parameters or one signle lexical parameter when calling the SRW.RUN_REPORT command with the following methods:
    Firstly: When calling report with a run_no and spr_cd passed in through one lexical:
    cmd_line: REPORT=D:\DEV\REMITTANCE.rdf BACKGROUND=YES BATCH=NO DESFORMAT=PDF DESTYPE=FILE DESNAME=D:\DEV\REMITTANCE.pdf
    CP_L_PARAM=RUN_NO=TO_NUMBER(28) AND SPR_CD=SUPP1
    Both with a TO_NUMBER and without, whereby I attempt to do a SUBSTR within the query of the called report to derive the RUN_NO Oracle Reports fails to accept the SUBSTR.
    Secondly: I am now trying to call the with passing two lexical parameters into the report as follows:
    cmd_line: REPORT=D:\DEV\REMITTANCE.rdf BACKGROUND=YES BATCH=NO DESFORMAT=PDF DESTYPE=FILE DESNAME=D:\DEV\REMITTANCE.pdf
    CP_L_RUN_NO=||TO_CHAR(lv_run_no)|| CP_L_SPR_CD=||lv_spr_cd;          
    NOTE: The above is an output of the actual command line and not what is passed into the command line, thus the quotes are missing. Please also note that the report is running fine with the only a hard coded RUN_NO value PASSED without the SPR_CD.
    Unfortunately this is also causing issues as the RUN_NO is a number and as you know you can only pass in strings.
    Your urgent help is required on this matter please as our client is expecting a solution this afternoon.
    Hope to hear form you soon.
    Kind regards
    Andrew Mason

    Dont Worry I've worked it out...

  • 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.

  • Lexical Parameter in Reports 6i Program Unit

    A report I'm writing requires me to use the lexical parameter in a program unit rather than a query in the data model. Lexical parameters in a query have always worked with the example "WHERE &my_parameter". But using "WHERE :my_parameter" or "WHERE &my_parameter" in a program unit gave me the error "expression is of wrong type" so the code wouldn't compile in the editor.
    The parameter returns "segment1 = '8675309' AND segment2 = 'Jenny'I was able to resolve it by using the first column of the expression and the replace function on the parameter so the program unit editor thinks it's a valid expression and the resulting line is a valid predicate that gets the correct data. Here's my example:
    WHERE segment1 = replace(:my_parameter, 'segment1 = ')The replace function strips off the "segment1 = " from the lexical parameter so the resulting line that gets passed to the server is:
    WHERE segment1 = '8675309' AND segment2 = 'Jenny'This solution will not work where the parameter could return something other than "segment1 = " at the beginning of the parameter string like "segment1 BETWEEN " or a different column name to compare other than segment1. Anyway, this is working but if there are better ways to do it I'd like to try them. Using Reports 6i with EBS 11.5.10.2.

    Hello,
    You'll find explanations and examples here :
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwwhthow/whatare/dmobj/sq_a_lexical_references.htm
    This documentation is for Reports 10.1.2 but is valid for Reports 6i too ...
    Regards

  • Report are not working using lexical parameter

    Hi !
    i am using oracle 10g and i my query i have laxical parameter as follow
    &to_date
    in after paramform we have
    IF :P_DATE_TO IS NOT NULL THEN
         :TO_DATE := 'AND to_date(head.updated_date,'||chr(39)||'DD/MM/RRRR'||chr(39)||') between TO_DATE(t2.term_start_date,'||chr(39)||'DD/MM/RRRR'||chr(39)||') AND TO_DATE('||CHR(39)||:P_DATE_TO||CHR(39)||','||chr(39)||'DD/MM/RRRR'||chr(39)||')';
    --ELSE
         --:TO_DATE := NULL;
    END IF;
    after compile this report when i run this report then i have following error
    REP-304: '&' in SELECT statement was not followed by a valid lexical parameter.
    any body can tell me how can i resove it.

    What denis is trying to say that change the TO_DATE parameter to any other name because TO_DATE is actually reserve word. So instead of TO_DATE try for example P_TO_DATE or any other name.
    -Ammad

  • Passing single quotes in a lexical parameter from forms11g to reports 11g

    Hi,
    We've upgraded our forms and reports from 10.1.2.3 to 11.1.2.1 and this has broken a number of reports where we pass a string of single quoted variables to reports as a lexical parameter.
    v_string := ''''||:block.item1||''''||','||''''||:block.item2||''''
    select *
    from emp
    where emp_id in (&p_string)
    where v_string is simply passed as a text parameter to the report.
    I'm not clear why this should break now (its worked since 6i) and whether anyone is aware of it and/or a solution.
    Any help much appreciated as always
    Thank you

    Hi,
    Thanks for the suggestion I will try and give it a go.
    Do you mean for example in the form:
    v_string := $$dq||:block.item1||$$dq||','||$$dq||:block.item2||$$dq
    And in the report
    Begin
    replace(p_where_string,'$q','''');
    end;
    I would say that this even if this works it will prove painful to be updating every form AND report where this is used as we have a lot! I do really appreciate anyone taking the time to reply though!
    It would appear that there are several bugs recorded against this type of problem when moving to reports 11...
    Bug 11840698 - SIMPLE QUOTE REMOVED WHEN USING RUN_REPORT_OBJECT WITH PARAMLIST
    Status 11 - Code/Hardware Bug (Response/Resolution
    I will continue to update with responses from my SR.
    Thanks

  • Lexical parameter report in oracle reports

    Hello
          I am new in oracle forms and reports.I am using oracle weblogic 10.3.5 with oracle forms and reports 11g at windows 7.
    I have need to create a lexical parameter report In which I have query as:
    select &P_1 ename,sal from emp
    this works well but here I have to give the default value with lexical parameter which is ename but i do not want it.
    Here If I give the value to P_1 --> empno
    then It returns all data but there is column heading  is ename for data empno from emp table.
    Is there any way so that to eliminate the default value for lexical parameter.Actually I want the sql data source query like
    select &P_1 ,sal from emp
    But flashes error ORA 00936 of missing expression.
    Please suggest me
    Thank You
    regards aaditya

    Hi,
    Check the datatype of the USERNAME and width value assigned for it. Because the cause for this error is:
    An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).
    Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.
    Thanks,
    Vidya Viswanathan.

  • Can we use formula column in lexical parameter in sql query ...

    hi
    can we use formula column in lexical parameter in sql query ...
    as example
    i want to give
    select * from & c_table
    forumula
    function c_table
    if :p_sort = 1 then
    return 'dept'
    else
    return 'emp'
    end;
    c_table formula column
    is this possible ...
    i have such example in oracle apps reports
    if i try in ordinary report usinf emp table it show error ..
    how we can give formula column...
    please help me in this regard...
    Edited by: 797525 on Feb 20, 2012 9:31 PM

    thanks sir,
    iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from     mtl_demand md,     mtl_system_items msi,     mtl_txn_source_types     mtst,     mtl_item_locations loc     &C_source_from &C_from_cat
    &c_source_from and &c_from_cat formula column and there are defined at report level only ......
    pl/sql code &c_source_from is
    function C_source_fromFormula return VARCHAR2 is
    begin
    if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
    else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
    else if :P_source_type_id = 5 then
         if :C_source_where is null then
              return NULL;
         else
              return(',WIP_ENTITIES wip');
         end if;
    else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id is null then
    return(',MTL_SALES_ORDERS      mkts,
    MTL_GENERIC_DISPOSITIONS mdsp,
    GL_CODE_COMBINATIONS gl ');
    else null;
    end if; end if; end if; end if; end if; end if;
    RETURN NULL; end;
    this is forumula column i hope that you understand what iam saying
    please help me in this regard....
    thanking you...

Maybe you are looking for

  • My Wife's iPod is not recognized by itunes

    My wife has a 30GB ipod and all of a sudden when she connects it to her Dell Laptop it is only recognized as a Store Drive but the itunes never recognized it, she is unable to see her ipod on the itunes. I have restored it by pressing the center butt

  • Sales Tax Jurisdictions

    Sales Tax Jurisdication setup has changed in a recent release.  Does anyone have new import templates for the Data Transfer Workbench (preferably a functional sample). Thanks,

  • Help with removing minor animation?

    hello can smeone please help me remove this minr animation from this flash file. the animation i would like to remove is the one dat appears in the start and gives it the effec of moving the menu from left to rite. i have gone thoguh the all the movi

  • Best way to implement 100% discount in Pricing Prod  based on Customer

    What would be the simplest way to implement 100% discount based on customer. I was thinking to do it via Customer Hierarchy... Suggestions are appreciated.. Message was edited by:         Robert Robbin

  • [nQSError: 46036] Internal Assertion:

    Hi All, I am getting the below error while designing RPD.Pls Help. [nQSError: 46036] Internal Assertion: Condition i + 1 < numKeys, file .\Src\SQLogicalRqtGenerator.cpp, line 645. Regards, Darwin S