Shortcuts - Subst. variables in report column

Hello,
I'm wondering why the next thing thing doesn't work:
I have a report with a column displayed as textfield, when I try to put a susbtitution variable (:MYSPEC) in Column Attributes -> Element Attributes it does not recognize it and just writes &myspec.="";
I tried to define a shortcut but then it doesn't work either.
When I use the Apex api "apex_item.text(1, dept ,15,NULL, :MYSPEC) deptno" then it does work.
Am I doing something wrong or is this just normal behaviour?
Kind regards,
Oli

Hi Oli,
the bind-variable syntax (:MYSPEC) only works in code areas like SQL Statements or in PL/SQL code.
If you want to use the value of a page/application item in a property you have to use &MYSPEC.But be aware, not every property supports dynamic values.
Patrick
My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

Similar Messages

  • Using presentation variables in report columns

    Hi.
    I need to create a report column evaluating the difference in days between a field containing a date and a presentation variable.
    My field is defined as:
    TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", @{DataAnalisiScaduto})
    Where DataAnalisiScaduto is a presentation variable passed to the report and it's generated on a date field.
    Executing the report I get an error and looking at the session manager in the generated query I can see:
    TRUNC( (31 / nullif( 12, 0)) / nullif( 2010, 0) ) - TRUNC( T4292.DATA )
    Why ? How can I do ?
    Thanks,
    Andrea

    Erro again ...
    the value passed is 03/02/2011 (picked from the calendar) and the default suggested is 2010-01-10
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46047] Datetime value 03/02/2011 from 03/02/2011 does not match the specified format. (HY000)
    SQL Issued: {call NQSGetQueryColumnInfo('SELECT "Data Incasso"."Data Incasso", "Data Scadenza"."Data Scadenza Fattura", "Dettagli Pagamento"."Cd Fattura", "Dettagli Pagamento"."Cd Tipo Riga Pag", CASE WHEN TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date ''03/02/2011'') <= 0 THEN ''Fino 0 gg'' WHEN TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date ''03/02/2011'') > 0 And TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date ''03/02/2011'') <= 30 THEN ''Fino 30 gg'' WHEN TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date ''03/02/2011'') > 30 And TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date ''03/02/2011'') <= 60 THEN ''Fino 60 gg'' WHEN TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date ''03/02/2011'') > 60 And TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date ''03/02/2011'') <= 90 THEN ''Fino 90 gg'' ELSE ''Oltre 90 gg'' END, Misure.Dovuto, Misure.Pagato, Misure.Scoperto FROM "Vendita - Pagamenti"')}
    SQL Issued: SELECT "Data Incasso"."Data Incasso", "Data Scadenza"."Data Scadenza Fattura", "Dettagli Pagamento"."Cd Fattura", "Dettagli Pagamento"."Cd Tipo Riga Pag", CASE WHEN TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date '03/02/2011') <= 0 THEN 'Fino 0 gg' WHEN TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date '03/02/2011') > 0 And TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date '03/02/2011') <= 30 THEN 'Fino 30 gg' WHEN TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date '03/02/2011') > 30 And TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date '03/02/2011') <= 60 THEN 'Fino 60 gg' WHEN TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date '03/02/2011') > 60 And TIMESTAMPDIFF(SQL_TSI_DAY, "Data Scadenza"."Data Scadenza Fattura", date '03/02/2011') <= 90 THEN 'Fino 90 gg' ELSE 'Oltre 90 gg' END, Misure.Dovuto, Misure.Pagato, Misure.Scoperto FROM "Vendita - Pagamenti"

  • How to use Value Variable in Report Painter Column defined as Formula

    Hi Gurus,
    In report painter, how can I add one field (exchange rate) in selection screen, so that user can provide the exchange rate to be used, then execute the report, the exchange rate will used to multiple local currency amount.
    The reason for this is we want use provided exchange rate to convert the amount from once currency to the other currency.
    Alternatively I am studying the functionality of "Value Variable" and found that I can perform the task from this. I have created the value variable but when I am using the variable in Report Painter columns as "&ZVALVAR", system is giving me error. I read the help and it states that use the variable with "&" and do it as it is mentioned.
    Can anybody suggest what I need to do to make it workable.
    Thanks

    I did try using the presentation variable, but that does not work too. I am setting session variable in the dashboard prompt (select 'request variable'). When I use presentation variable, it hard codes the value of the variable name.
    sql is
    select date from work_order where facility = @{p_facility}
    the physical log sql is
    select date from work_order where facility = 'p_facility'

  • How to generate report with dynamic variable number of columns?

    How to generate report with dynamic variable number of columns?
    I need to generate a report with varying column names (state names) as follows:
    SELECT AK, AL, AR,... FROM States ;
    I get these column names from the result of another query.
    In order to clarify my question, Please consider following table:
    CREATE TABLE TIME_PERIODS (
    PERIOD     VARCHAR2 (50) PRIMARY KEY
    CREATE TABLE STATE_INCOME (
         NAME     VARCHAR2 (2),
         PERIOD     VARCHAR2 (50)     REFERENCES TIME_PERIODS (PERIOD) ,
         INCOME     NUMBER (12, 2)
    I like to generate a report as follows:
    AK CA DE FL ...
    PERIOD1 1222.23 2423.20 232.33 345.21
    PERIOD2
    PERIOD3
    Total 433242.23 56744.34 8872.21 2324.23 ...
    The TIME_PERIODS.Period and State.Name could change dynamically.
    So I can't specify the state name in Select query like
    SELECT AK, AL, AR,... FROM
    What is the best way to generate this report?

    SQL> -- test tables and test data:
    SQL> CREATE TABLE states
      2    (state VARCHAR2 (2))
      3  /
    Table created.
    SQL> INSERT INTO states
      2  VALUES ('AK')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AL')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AR')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('CA')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('DE')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('FL')
      3  /
    1 row created.
    SQL> CREATE TABLE TIME_PERIODS
      2    (PERIOD VARCHAR2 (50) PRIMARY KEY)
      3  /
    Table created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD1')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD2')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD3')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD4')
      3  /
    1 row created.
    SQL> CREATE TABLE STATE_INCOME
      2    (NAME   VARCHAR2 (2),
      3       PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD),
      4       INCOME NUMBER (12, 2))
      5  /
    Table created.
    SQL> INSERT INTO state_income
      2  VALUES ('AK', 'PERIOD1', 1222.23)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('CA', 'PERIOD1', 2423.20)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('DE', 'PERIOD1', 232.33)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('FL', 'PERIOD1', 345.21)
      3  /
    1 row created.
    SQL> -- the basic query:
    SQL> SELECT   SUBSTR (time_periods.period, 1, 10) period,
      2             SUM (DECODE (name, 'AK', income)) "AK",
      3             SUM (DECODE (name, 'CA', income)) "CA",
      4             SUM (DECODE (name, 'DE', income)) "DE",
      5             SUM (DECODE (name, 'FL', income)) "FL"
      6  FROM     state_income, time_periods
      7  WHERE    time_periods.period = state_income.period (+)
      8  AND      time_periods.period IN ('PERIOD1','PERIOD2','PERIOD3')
      9  GROUP BY ROLLUP (time_periods.period)
    10  /
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> -- package that dynamically executes the query
    SQL> -- given variable numbers and values
    SQL> -- of states and periods:
    SQL> CREATE OR REPLACE PACKAGE package_name
      2  AS
      3    TYPE cursor_type IS REF CURSOR;
      4    PROCEDURE procedure_name
      5        (p_periods   IN     VARCHAR2,
      6         p_states    IN     VARCHAR2,
      7         cursor_name IN OUT cursor_type);
      8  END package_name;
      9  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY package_name
      2  AS
      3    PROCEDURE procedure_name
      4        (p_periods   IN     VARCHAR2,
      5         p_states    IN     VARCHAR2,
      6         cursor_name IN OUT cursor_type)
      7    IS
      8        v_periods          VARCHAR2 (1000);
      9        v_sql               VARCHAR2 (4000);
    10        v_states          VARCHAR2 (1000) := p_states;
    11    BEGIN
    12        v_periods := REPLACE (p_periods, ',', ''',''');
    13        v_sql := 'SELECT SUBSTR(time_periods.period,1,10) period';
    14        WHILE LENGTH (v_states) > 1
    15        LOOP
    16          v_sql := v_sql
    17          || ',SUM(DECODE(name,'''
    18          || SUBSTR (v_states,1,2) || ''',income)) "' || SUBSTR (v_states,1,2)
    19          || '"';
    20          v_states := LTRIM (SUBSTR (v_states, 3), ',');
    21        END LOOP;
    22        v_sql := v_sql
    23        || 'FROM     state_income, time_periods
    24            WHERE    time_periods.period = state_income.period (+)
    25            AND      time_periods.period IN (''' || v_periods || ''')
    26            GROUP BY ROLLUP (time_periods.period)';
    27        OPEN cursor_name FOR v_sql;
    28    END procedure_name;
    29  END package_name;
    30  /
    Package body created.
    SQL> -- sample executions from SQL:
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2,PERIOD3','AK,CA,DE,FL', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2','AK,AL,AR', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR                                                        
    PERIOD1       1222.23                                                                              
    PERIOD2                                                                                            
                  1222.23                                                                              
    SQL> -- sample execution from PL/SQL block
    SQL> -- using parameters derived from processing
    SQL> -- cursors containing results of other queries:
    SQL> DECLARE
      2    CURSOR c_period
      3    IS
      4    SELECT period
      5    FROM   time_periods;
      6    v_periods   VARCHAR2 (1000);
      7    v_delimiter VARCHAR2 (1) := NULL;
      8    CURSOR c_states
      9    IS
    10    SELECT state
    11    FROM   states;
    12    v_states    VARCHAR2 (1000);
    13  BEGIN
    14    FOR r_period IN c_period
    15    LOOP
    16        v_periods := v_periods || v_delimiter || r_period.period;
    17        v_delimiter := ',';
    18    END LOOP;
    19    v_delimiter := NULL;
    20    FOR r_states IN c_states
    21    LOOP
    22        v_states := v_states || v_delimiter || r_states.state;
    23        v_delimiter := ',';
    24    END LOOP;
    25    package_name.procedure_name (v_periods, v_states, :g_ref);
    26  END;
    27  /
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR         CA         DE         FL                       
    PERIOD1       1222.23                           2423.2     232.33     345.21                       
    PERIOD2                                                                                            
    PERIOD3                                                                                            
    PERIOD4                                                                                            
                  1222.23                           2423.2     232.33     345.21                       

  • Report painter variables in formula columns

    Hello,
    I need to insert variable in column formula to create  average month result.
    using syntax 'variable' or &variable is Incorrect formula component message .
    How can i enter variables in formula columns?
    Thanks ,
    Ran

    Hi
    I suspect you are not able to use the '& symbol in the formula in your system because the note 593897 was not present in old release.   
    Due to this note there is no need to enter '&' symbol for variables in the formula but in order for the variables to be used please make sure  that the variable is contained in the general data selection of the  report.                                                                
    Kidn Regards
    davide

  • How to accessing current row report column value in Lov Query?

    Hi,
    which access methods (eg. bind variables, substitutions, ...) for getting the current row report column value can be used in the "Lov Query" property of a report column?
    As what I know of and what I have read on the forum there are no bind variables for the report columns. For the "Link Text" property it seems that the column values exist as substitution strings (#COLUMN_NAME#). But they don't work in the Lov Query. => And would be good because of a hard parse each time the Lov query is executed.
    The following post (Re: Simulating a correlated sub query in lov
    is showing a solution to use package variables for temporary storage of the referenced value, but the only problem with that solution is that if a new record is added with the "Add rows to tabular form" process the package variable still contains the value from the last queried row! Is there a way (variable, APEX package, ...) to determine if the lov query is executed for a new record so that the package can return null?
    I know that I could write the package in a way that the value is immediately cleared when lov_pkg.keyval is called (one time read), but then I would have to create several variables if I'm accessing the value multiple times in the query or in another query => I think an one time read solution would be very obscurely.
    Thanks for your help
    Patrick
    http://inside-apex.blogspot.com

    Hi Patrick,
    I agree that it's a waste to continually use Ajax to go back to the server to get the contents of a dynamic select list.
    There are no bind variables for any row item - but what you do have, as per my previous post, is the value of the data entered by the user in the first row. You can pass this into your application process (using get.add("VARIABLENAME", value)), which can use it to retrieve the correct LOV in your Ajax code - this will give you a "bind variable" that your process can use.
    What you could do, however, is generate hidden select lists on your page - one for each possible LOV list and replace the contents of the new row's select list with the contents of the appropriate hidden select list. This is easy to do with javascript (using innerHTML functions). Obviously, though, the usefulness of this depends on the number and size of the select lists.
    Even if you don't generate them to start with, you can keep a copy of any select lists returned by Ajax in the DOM for use on new rows. So, if you have retrieved a select list, you will have a copy of it in DOM which you can then copy into the new row. If you don't have the list in DOM, use Ajax to get it, store a copy of it and copy it into the new row.
    Which method you use will depend on the number/size of select lists needed. If they are few in number and/or size, I would suggest generating hidden lists. If they are large, use Ajax to get them once, store them and then retrieve them from the DOM when needed.
    There is another thread here where Arie recommends going to the server every time to make sure you get the most up-to-date data for the lists. If you want to follow this advice, for this reason, use get.add("VARIABLENAME", value) to pass the value to your process. If this is not an issue, you can use one of the other methods I outlined above.
    Regards
    Andy

  • How to use the prompt value in the report column

    Hi
    I have a report prompt column which is 'Adj Type' which holds values 10,20,30 and when user selects Adj Type = 10 then this value should be passed to report column.
    For Eg. Column 1 value is 10 and this should multiple with prompt value and the output should be 10* 10.
    Any thoughts how to capture the prompt values in report column for calculation.

    hi hsekar,
    1) Declare a presentation variable in prompt under the Set Variable section -->Presentation Variable -->P_var
    2) In Fx Table_name.Your_column * @{P_Var}
    @{P_var}{20} ( 20 is default value it will override when a user selects value in prompt
    Thanks,
    Saichand.v

  • Internal variables of report painter shouldn't be selectable

    Dear collegues,
    I have created two new internal variables in report writer in order to use them in planning layout of TA KP67:
    - previous year: marked as internal variable: calculated as: &1CGJAHE-1 (2008)
    and
    - future year: marked as internal variable: calcualted as: &1CGJAHE+1 (2010).
    In report painter these variables are assigned to key figures and are not shown on the selection screen again as they are calculated internally.
    But in planning layout of TA KP67 cost activity planning these variables are also assigned to key figures like actual costs or fixed planned costs and are indicated as acceptable for input on the selection screen but shouldn't - so how it is possible to define internal variables in co planning layouts as really internal which do not come up if the planning layout is executed via TA KP06?
    Thanks and regards,
    Christian

    Hello Christian,
    when I understand your request correctly, you want to plan for several years like 2008, 2009 and 2010 but you just want to enter one year. Right?
    For the column with the current fiscal year you can use a standard variable like GJAHR. For the other columns you define the year in the column as variable with value "GJAHR-1" (last year) and with value "GJAHR+1" (following year). On the selection screen of the planning transaction you will only have one field for the current year and the fiscal year for the other columns is calculated accordingly when you run the planning.
    Hope this helps.
    Cheers,
    Daniela

  • How to get the Text variables in the Columns Headings

    Hi,
         My requirement is I need to get data for weekly wise and for the last 10 weeks also. For this purpose I used the restricted KF based on the variables (customer exit) and offset. Also used the text variable for displaying from and to days in the column headings. I am getting the right text for the first column only. But the text offset is not considering.
    Ex 07/04/2007 to 07/10/2007      06/27/2007 to 07/03/2007 like that.
    I used the two text variables one for from data and other for to date using the customer exit. I am getting the same text as of the first column for the subsequent columns also. Please help me for getting the right text in the columns.
    Thanks,
    visu

    Hello ,
               The quite simple way is to create a text variable with replacement path , as it replaces the value of customer exit used in the report.
    create two text variables
    First variable:
    1 Replace variable with -
    external characteristic key value
    For interval use ---from value
    2.Secod text variable
    Replace variable with -
    external characteristic key value
    For interval use ---To value
    offset start -0000 offset length0000
    use these variables in the column headings.
    hope it is clear,
    assign points if useful

  • Calling a .rdf report from a link on a apex report column

    Hi,
    I want to call a xxx.rdf report from a link on a apex report column.
    Can anyone help me on this ?
    Best regards,
    JCN

    Hi,
    Sorry - I should have read a bit further in your last post!
    The url variable that you're defining should just be the URL string that you want to create, so you only need the "http://........" part. There's also a + missing after the "&TODT..." string.
    The "DEA_PERMIT_ID=&G_PERMIT_ID." part at the end should have an & at the start to indicate a new parameter in the URL. Otherwise, &G_PERMIT_ID. would be replaced by the value stored in the session for the G_PERMIT_ID item (presumably that is an Application Item?).
    So:
    function callPopup()
    var url = "'http://snapper.accsp.org/reports/rwservlet?destype=cache&desformat=PDF&report=edr_landings_dollars_by_vessel.rdf&userid=evtr_report/chicken99@safis&FROMDT=" + $v("P810_FROM") + "&TODT=" + $v("P810_TO") + "&DEA_PERMIT_ID=&G_PERMIT_ID.";
    popupURL(url);
    }Andy

  • Show the presentation variable on table column header

    hi, experts,
    is it possible to show the presentation variable on the table column header.
    I have created a edit box with presentation variable on the prompt.
    I would like to show the value the user entered on the column header because the values under that column are driven by the presentation variable.
    Thank you very much!

    You cannot put variables in the column headers, as they get considered as text and the same shows in the reports.
    However, you can use the session or repository variables in the alias field in the presentation layer.
    You should make sure, that in this case, all the calculations are done in the BMM layer and not in answers, for the columns where you will be using the variables.

  • JavaScript: Disabling textarea in report column cell

    Hi,
    Andi (ATD) helped me with formatting report columns, coloring them depending on a value. See:
    Javascript - Referencing report column value
    Now I want to add a feature:
    If the value is '1' then disable the textarea in the next column, otherwise not. The function is:
    function hilite(f1)
    var h = document.getElementById(f1);
    var t = h.parentNode;
    while (t.tagName != 'TABLE')
      t = t.parentNode;
    var rows = t.rows;
    var k;
    var i;
    var j;
    var c;
    var headers = t.getElementsByTagName("TH");
    // var textarea = t.getElementsByTagName("textarea");
    for (k = 0; k < headers.length; k++)
      if (headers[k].id == f1)
        c = k;
    for (k = 1; k < rows.length; k++)
      i = rows[k].cells[c];
      j = rows[k].cells[c+1];
      if (i.innerHTML == '2')
        i.style.backgroundColor = 'yellow';
        i.style.color = 'white';
        i.style.fontWeight = 'bold';
        i.style.fontSize = '18px';
      if (i.innerHTML == '1')
        i.style.backgroundColor = 'red';
        i.style.color = 'white';
        i.style.fontWeight = 'bold';
        i.style.fontSize = '18px';
    //  j.style.backgroundColor = 'green';   // testing purpose; colors background green but not textarea
        j.style.visibility = 'hidden';               // works fine but ugly
    //  j.disabled = 'true';                        // nothing happens
    //  j.firstChild.disabled = 'true';           // does not work
    //  j.textarea.disabled = 'true';           // does not work
    }See the 'j' object: I can make the whole cell disappear but it looks ugly. Examining it with firebug I was thinking I must use sth. like firstChild or textarea, but it does not work. I find it still quite tricky to manipulate tables in Apex...
    Could someone help with this?
    Thanks a lot,
    Roger

    Hi Roger,
    You're sort of nearly there!
    The next cell to the right of the one you are testing will contain a TEXTAREA object. Your j variable can get to this using something like:
    j = rows[k].cells[c+1].getElementsByTagName("TEXTAREA")[0];The issue with using the visibility method that you have used will then disappear as you've applied it to the whole TD object, so all borders will go - applying this to the new j will only hide the textarea object instead.
    Andy

  • Dynamic Selection of Report Column Format

    Is it possible to dynamically set the number format on a report column? I thought it would be as easy as setting the 'Number/Date Format' to a session state variable such as &NUMBER_FORMAT. However, when I tried this the column returned the following value ##########.
    Any ideas?
    Thanks,
    David

    OK, this is a favorite hack of mine combined with Sergio's suggestion. Essentially, we select the column twice, display it with one column using Sergio's idea and sort it on another hidden and unformatted copy of the column (hope I didn't lose you yet):
    1) Add another column of the same source to the query and give it an alias:select ename,to_car(sal,'&NUMBER_FORMAT.') sal,sal sal_sort
      from emp2) Edit the report > report attributes > sal_sort column attributes. In the HTML Expression field, type #SAL#.
    3) On the report attributes page, unclick the "Show" column for sal.
    Now you are displaying the SAL column in the SAL_SORT column allowing the reporting engine to properly sort the column based on the unformatted SAL_SORT. I use this technique a lot for quarters. I'll show Q105, but it's sorting on an actual date behind the scenes.
    Happy hacking!
    Tyler

  • Examples of chart in the report column like monitor activity page

    Hello,
    Can anybody help me how to create a report having chart as one of the column in the report like Administration->Monitory Activity pages.
    I have a report having columns like date, salesman, collection%.
    The collection% must be displayed as bar chart showing % in the report column itself.
    I searched a lot and end up with no examples found for this kind of example.
    Any help will be appreciated.
    Thanks,

    First of all, it appears that there is no "HTML EXPRESSION" or an area to assign a CSS class to a column for interactive reports. I've even tried to use "COMPUTE" on an interactive report to introduce the <DIV> tabs and style, but that doesn't seem to work either. So If you're using an interactive report, it looks like you're out of luck.
    But if you use a standard report, here is a quick example using the standard Demo tables on an interactive report. I'll do my best to describe what I'm doing step by step.
    The query I'm using is a simple list of employees that shows the following columns:
    <ul>
    <li> EMPNO
    <li> ENAME
    <li> JOB
    <li> SAL
    <li> COMM
    <li> COMM / (SAL + COMM) *100 (What percent of total Salary is the employees Commission)
    </ul>
    So here is the SQL statement I'm going to use:
    select empno, ename, job, sal, comm, round(nvl((comm / (sal + comm) *100),0)) Pct_Comm
    from empNow, Create an standard (SQL) report on the page of your choice by selecting the CREATE button at the top of the page editor. Select "REGION ON THIS PAGE" => "REPORT" => "SQL REPORT"
    Enter a the TITLE and TEMPLATE of your choice, then click the NEXT button.
    Copy and paste the select statement above into the page region for the select statement, and press the CREATE REGION button.
    Go ahead and run the report and you will see a whole number for the COMM_PCT.
    Now to turn this into a graph within the column perform the following steps.
    <ol>
    <li>Edit the page and then edit the report by clicking on the "Report" link on the page definition. This will bring up the Report Attributes Page.
    <li>Edit the PCT_COMM column by clicking on the EDIT icon at the beginning of the row.
    <li>Cut and paste the html from my above post into the "HTML EXPRESSION" field.
    <li>Edit the HTML you just pasted to remove any unnecessary spaces in the tags that might cause it to render incorrectly.
    <li>In the HTML EXPRESSION string, replace the #COLLECTION_PCT# string with #PCT_COMM#. (This is a substitution variable that represents the value of that column. We're using that to set the WIDTH attribute of the bar).
    <li>Apply your changes and re-run the report.
    </ol>
    et. Voi la! You have a graph in your report.
    Hope that was clear enough.
    Doug

  • Hide Report Column Conditionally

    Hi All,
    I have a report with 12 columns. I want to hide the particular report column if all
    the values in that particular column is 0 (Zero).
    Can you please help me in achieving the same?
    Thanks in advance.
    Thanks,
    SKJ

    Report Attributes > Column Attributes : CBB
    For the display condition, you can't refer to the values store in the column. It wouldn't make any sens to know all the values contain in a column at this point. You can use the #CBB# variable for "Column Formatting" and "Column Link" but you can't use it for "Conditional Display".
    WRONG :
    Value of expression 1 <> Expression 2
    and in Expression 1 i put column name i.e. CBB
    and Expression2 I put 0.
    GOOD :
    You have to use a query or a function to determine if the column should be displayed.
    Condition Type : PL/SQL FunctionBody Returning a Boolean
    Expression 1:
    DECLARE
    l_retval BOOLEAN := TRUE;
    l_sum NUMBER;
    BEGIN
    SELECT sum(your_column) AS sum_of_CBB
    INTO l_sum
    [FROM and WHERE of your initial QUERY goes here];
    IF l_sum = 0 THEN
    l_retval := FALSE;
    END IF;
    return l_retval;
    EXCEPTION
    WHEN no_data_found THEN
    --should never go here since your report would be empty
    null;
    END;

Maybe you are looking for