Conditional links in sql report

Hi all,
i have created a report with 5 columns. First 2 columns are copy and edit links, rest 3 columns are the corresponding row value. If i click on copy then the primary key of the selected row is passed over to the next detail page and details are shown there. Similar is the case with edit link.
But i want to show edit link with only those rows, which the user have access. The table shows all the detail, but the link should only come when the user has the privilege to edit it. Can i provide conditionality in SQL Report link column?
Do reply. Thanks in advance
With Regards,
Sunil Bhatia

Dear Sunil Bhatia!
I'm not sure if it is possible to make a column link conditional so I would suggest you a little workaround. On the detail page where your edit link leads to create a validation (page processing). This should be a page level validation of type SQL or PL/SQL as you like. This validation could check the user rights with SQL and depending on the result of the validation show an error message like "Sorry, You don't have enough rights to edit this row!" or it could display the detail page to edit the row.
I hope this will help you along.
Yours sincerely
Florian W.

Similar Messages

  • Conditional Link on Interactive Report

    I'm trying to make the link column conditional on an interactive report. That is, I only want the pencil icon on the rows which have a field that is greater than 30. So, assume my query says:
    select DEPT_ID, USER_LEVEL
    from my_table;
    I only want the link icon to appear on rows that have USER_LEVEL > 30. I tried (unsuccessfully) to get this to work by adding a condition of "Expression1 = Expression2", and I used the #USER_LEVEL# substitution string. (Note: I know this would be exactly what I want because I want the condition to be on all values > 30, but I couldn't even get this to work when I put #USER_LEVEL# in Expression1 and "30" in Expression2 and looked at the records that had a USER_LEVEL value of exactly 30).
    In the end, I had to create a much more complex query like this...
    select
    case
    when USER_LEVEL >= 30 then
    '<a href="f?p=&APP_ID.:21:&SESSION.::&DEBUG.::P2_DEPT_ID:' || DEPT_ID || "><img src="#IMAGE_PREFIX#menu/pencil16x16.gif" alt="Edit" /></a>'
    else ' '
    end as edit_icon,
    DEPT_ID, USER_LEVEL
    from my_table;
    This doesn't seem right to me. Can someone confirm that I'm doing this the right way?

    Hi -
    It really bugs me this forum has such a problem with code examples, so for a while at least I posted quick example on Google:
    [Conditional Column|http://docs.google.com/Doc?id=dd2tkvv6_212dbzw2ftq]
    Not to complicate too much, but if you wanted to not have empty column except one row, you could of course apply this trick to the column that actually holds the user name in your table... in other words, the user could click right on their own name to go to edit screen, but every other user name but theirs would not be a hyperlink. But that is as they say an exercise for the reader :)
    Good luck.

  • Download column link to SQL report

    Hi ,
    I am using apex 4.1.
    I have a SQL report  with blob image column also . And along with the image i need to add download link as a column can some one please suggest me how to do it.
    Thanks
    Raghav

    raghav1212 wrote:
    I am using apex 4.1.
    I have a SQL report  with blob image column also . And along with the image i need to add download link as a column can some one please suggest me how to do it.
    This is very simple. Reference the image column twice in the report query projection, and apply a download format mask to one column and an image mask to the other.

  • Display a conditional link in interactive report

    Hi, I would like to display a link in a column of an interactive report, if the value of this column is not null.
    This is the sql code.
    Select
    (case
       when mytable.myvalue is not null then ('<a'||' href="'||'f?p=&APP_ID.:59:&APP_SESSION.::NO:59:P59_ITEM_ID:'||mytable.value||'">'||'<img src="#IMAGE_PREFIX#menu/download_32.gif">
    </a>')
       else null
    end) link
    from
    mytableI also tried apex_uil.prepare_url.
    Select
    (case
       when mytable.myvalue is not null then ('<a'||' href="'||apex_util.prepare_url('f?p=&APP_ID.:59:&APP_SESSION.::NO:59:P59_ITEM_ID:'||mytable.value)||'"><img src="#IMAGE_PREFIX#menu/download_32.gif">
    </a>')
       else null
    end) link
    from
    mytableAlthough it seems that is correct, instead of displaying the link, the report displays the html text of the link
    (I omitted the first *<* and the last *>* to display the text in the thread):
    value displayed a href="f?p=101:59:4377010977110083::NO:59:P59_ITEM_ID:146"><img src="/i/menu/download_32.gif"></aI did a lot of researchs of implemented solutions, but to me always return the same result.
    I hope someone can tell me the solution or my mistake that maybe at this time is escaping me.
    thanks
    greetings
    Edited by: diapason on Sep 8, 2011 9:09 AM
    Edited by: diapason on Sep 8, 2011 9:19 AM
    Edited by: diapason on Sep 8, 2011 9:33 AM

    >
    Welcome to the forum.
    Please read the FAQ and forum sticky threads (if you haven't done so already).
    Hi, I would like to display a link in a column of an interactive report, if the value of this column is not null.
    This is the sql code.
    Ah. It looks like you've now found the instructions on how to post code...
    Although it seems that is correct, instead of displaying the link, the report displays the html text of the link:
    value displayed
    <a href="f?p=101:59:4377010977110083::NO:59:P59_ITEM_ID:146"><img src="/i/menu/download_32.gif"></a>I did a lot of researchs of implemented solutions, but to me always return the same result.
    I hope someone can tell me the solution or my mistake that maybe at this time is escaping me.Ensure the Display Text As report column attribute is Standard Report Column rather than the default Display as Text (escape special characters).

  • Column name in link on sql report?

    Hey guys -
    Is there some way to put the column name of a report in a link?
    When you define a link on a column you have the ability to use a substition string for the VALUE of a particular column... but I want to somehow pass the string value of the column.... anyone know how to do this?
    Thanks

    Not the value of the column.. I want the actual column name...
    i.e.
    Items on page to set:
    txtbox1
    txtbox2
    Query:
    Channel          INS1     INS2     INS3     INS4
    Retail          13     1     333     55
    Wholesale     4234     23     1     44Okay, so I want to make a link on the values in the query (the #'s) to set the values of the txtboxes...
    example would be if I click on 333 I want it to set txtbox1="Retail" and txtbox2="INS3"
    The channel one is fine I just use the substition string of #COL1# in the link and it replaces the value... but nothing that I can find on how ot set txtbox2="INS3"
    Edited by: nferreri on May 15, 2009 9:51 AM

  • SQL report link to another report

    Hello,
    I am using Apex 4 and trying to link an sql report with another report. If I were able to use an interactive report I could easily link that to another page, but that would require me to have a primary key. The problem is that I need to link a few tables. So two questions:
    1.) Can I link these via an HTML link to my other page? I would have a HTML link in my report that would link via URL parameter passing. So can I use HTML in a report?
    2.) What is the syntax for a parameter passing via URL? Here is my link that would be:
    a href= f?p=107:40:&APP_SESSION::::P40_NAME:MARK: Are there any other ways to accomplish this?
    Thanks,
    Mark
    Edited by: LondonMark on 23-May-2011 04:18
    Edited by: LondonMark on 23-May-2011 04:20

    I am using Apex 4 and trying to link an sql report with another report. If I were able to use an interactive report I could easily link that to another page
    It's easy in standard reports< /a>. (Ignore the "Interactive Report" typo in step 1.)
    1.) Can I link these via an HTML link to my other page? I would have a HTML link in my report that would link via URL parameter passing. So can I use HTML in a report?You can, but it's better practice to keep data retrieval and HTML structure separate when possible&mdash;in this case by using declarative Column Links.
    2.) What is the syntax for a parameter passing via URL?This is also covered in the documentation.
    Here is my link that would be: a href= f?p=107:40:&APP_SESSION::::P40_NAME:MARK:
    {quote}
    That looks to have the order of the parameters correct, but it's missing some syntax:<a href="f?p=107:40:&APP_SESSION.::::P40_NAME:MARK">...</a>
    The static text exact substitution method of referencing the value of an APEX item requires a terminating dot ("."): <tt>&APP_SESSION.</tt>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Interactive Report Performance With Conditional Link

    Apex 3.2
    I have a interactive report.
    The underlying sql would return 127000 rows
    The sql is
    select
      lde.ods_system,
      lde.ldekey,
      msg.sendersystem, 
      msg.messagetype,
      msg.messageversion,
      msg.msgseqnumber,
      msg.alternatekey,
      msg.crudmarker,
      msg.clrbookdate,
      msg.clrbookresult,
      lower('udf_'||msg.messagetype) button,
      lde.ldekey||'.'||msg.alternatekey||'.'||msg.msgseqnumber udm_key
    from
      clr_esbmessageheader msg,
      clr_adm_systemmessage adm,
      udm_lde lde
    where
      adm.ldeid = lde.ldeid and
      msg.sendersystem = adm.system and
      msg.messagetype = adm.messagetype and
      msg.messageversion = adm.messageversion and
      msg.receiversystem = 'SCIPS'
    order by msg.clrbookdate desc
    This report only takes 1 second to display.
    I need to add a conditional link to another page, so I used
    case
    when lower('udf_'||msg.messagetype) = 'udf_distreceipt' then
    '<a class="type" href="' || apex_util.prepare_url('f?p='||:APP_ID||':52:'||:APP_SESSION||'::'||:DEBUG||':RIR'||':IR_MSG_KEY,P52_PG:'|| lde.ldekey||'.'|| msg.alternatekey ||'.'|| msg.msgseqnumber ||','|| 50, null, 'SESSION') || '"title="Go to udf_distreceipt Report">udf_distreceipt</a>'
    else 'no link' end table_link
    The sql seems to be ok, because the report accepted it, but selecting the new column and saving the report takes forever (over 2 mins)
    Now the report takes over 2 minutes to run and I still need to add more conditions.
    Have I coded the link incorrectly ?
    Gus

    Hi Gus,
    Are you wanting to put the link in the query for a specific reason?
    I had to do a similar thing in the past and just completed the column link section for the column.
    Why not just have the following in the query:
    case
    when lower('udf_'||msg.messagetype) = 'udf_distreceipt' then
    udf_distreceipt
    else null END table_link
    Then do the linking using column link section:
    You would specify your link text as #TABLE_LINK# which should then be conditionally displayed due to the case statement, then add in all the page item and values to pass across using a normal link column.
    Thanks
    Paul

  • Conditional links on report w/ search

    I know there has a number of thread on this topic, but I could not find any addressing my issue.
    I have a report with a conditional link built into the SQL:
    select DECODE(LL_ACCESS, 'edit',
    '<img src="/i/edit.gif" border="0" alt="Edit Icon">',
    '<img src="/i/view.gif" border="0" alt="View Icon">') LL_ACCESS
    ,DIVISION
    ,LL_DATE
    ,CUSTOMER
    ,PROGRAM
    ,PROCESS
    ,MATERIAL
    ,PART_DESC
    ,DEFECT
    ,PROBLEM
    ,ROOT_CLAUSE
    ,SOLUTION
    ,COMMENTS
    ,ATTACHMENTS_YN
    from LESSONS_LEARNED_V;
    Which "links" to either an update page or a view only page based on a user ACL.
    My problem arises when I'm adding a search feature to the report. I have change the report to be base on a PL/SQL statement:
    declare
    l_sql varchar2(4000);
    begin
    l_sql := '
    select DECODE(LL_ACCESS, ''edit'',
    ''<img src="/i/edit.gif" border="0" alt="Edit Icon">'',
    ''<img src="/i/view.gif" border="0" alt="View Icon">'') LL_ACCESS
    ,LL_ID
    ,DIVISION
    ,LL_DATE
    ,CUSTOMER
    ,PROGRAM
    ,PROCESS
    ,MATERIAL
    ,PART_DESC
    ,DEFECT
    ,PROBLEM
    ,ROOT_CLAUSE
    ,SOLUTION
    ,COMMENTS
    ,ATTACHMENTS_YN
    from LESSONS_LEARNED_V';
    IF :P2_REPORT_SEARCH is NOT NULL THEN
    l_sql := l_sql ||' where ';
    l_sql := l_sql ||' (
    upper("DIVISION") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("LL_DATE") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("CUSTOMER") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("PROGRAM") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("PROCESS") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("MATERIAL") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("PART_DESC") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("DEFECT") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("PROBLEM") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("SOLUTION") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("COMMENTS") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("ROOT_CLAUSE") like ''%''||upper(:P2_REPORT_SEARCH)||''%''
    END IF;
    if :P2_VALUE IS NOT NULL then
    l_sql := l_sql ||' and ('||:P2_CHART_FILTER||' = :P2_VALUE) ';
    end if;
    return l_sql;
    end;
    It almost works, except the pk value (in this case LL_ID)is not being returned in the link. I have tried every possible combination of #,&,||,'," to get it to work but with no luck. Does anyone know the correct syntax to get this to work?
    BTW, I'd like to thank all who have posted to this forum, it has been a create help to this old oracle forms guy.

    Hi Rob,
    Try this
    declare
    l_sql varchar2(4000);
    begin
    l_sql := '
    select DECODE(LL_ACCESS, ''edit'',
    ''<img src="/i/edit.gif" border="0" alt="Edit Icon">'',
    ''<img src="/i/view.gif" border="0" alt="View Icon">'') LL_ACCESS
    ,LL_ID
    ,DIVISION
    ,LL_DATE
    ,CUSTOMER
    ,PROGRAM
    ,PROCESS
    ,MATERIAL
    ,PART_DESC
    ,DEFECT
    ,PROBLEM
    ,ROOT_CLAUSE
    ,SOLUTION
    ,COMMENTS
    ,ATTACHMENTS_YN
    from LESSONS_LEARNED_V ';
    IF :P2_REPORT_SEARCH is NOT NULL THEN
    l_sql := l_sql ||' where ';
    l_sql := l_sql ||' (
    upper("DIVISION") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("LL_DATE") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("CUSTOMER") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("PROGRAM") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("PROCESS") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("MATERIAL") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("PART_DESC") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("DEFECT") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("PROBLEM") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("SOLUTION") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("COMMENTS") like ''%''||upper(:P2_REPORT_SEARCH)||''%'' or
    upper("ROOT_CLAUSE") like ''%''||upper(:P2_REPORT_SEARCH)||''%''
    END IF;
    if :P2_VALUE IS NOT NULL and :P2_REPORT_SEARCH is not null then
    l_sql := l_sql ||' and ('||:P2_CHART_FILTER||' = :P2_VALUE) ';
    elsif :P2_VALUE IS NOT NULL and :P2_REPORT_SEARCH is null then
    l_sql := l_sql ||' where ('||:P2_CHART_FILTER||' = :P2_VALUE) ';
    end if;
    return l_sql;
    end;
    I changed the refrenece from #LL_ID# to a direct sql reference. Also I modified your last if condition.
    Hope this Helps
    Vivek

  • Pop up text on clicking link on a sql report

    Hi
    I'm using apex 3.2
    I've a sql report like below
    taskId(edit) Task_details Notes owner .....
    What I want to do is if I click on taskId which is edit link ,pop up text box should open where I can add notes to that row.
    How can I achive this?
    Thanks in advance

    Hi,
    Take a look at the following blog posts and see if they can help you get what you are looking for (there are sample applications in them showing the functionality):
    http://monkeyonoracle.blogspot.com/2010/07/modal-pop-up-with-dynamic-actions.html
    http://www.danielmcghan.us/2008/12/popup-in-report.html
    Hope that's useful for you.
    Regards,
    Sergio

  • Conditional display in a SQL-Report/Report Region

    Hi,
    here I have an example for "Conditional display in a SQL-Report/Report Region". I figured it out in Firefox 3.6.2 using Firebug as development tool on Apex 3.2.1.00.12.
    First you have to put the following javascript code in the Page HTML-Header:
    <script type="text/javascript">
    <!--
    // SOURCE
    // W:\oracle\PRJ DWLS\javascript.07.js
    // Beispiel Funktion zur bedingten Formatierung einer Tabellenzelle.
    // Help (Substitution Strings):
    // http://htmldb.oracle.com/pls/otn/wwv_flow_help.show_help?p_lang=de&p_session=2412201185523196&p_flow_id=4003&p_step_id=420,4003
    // HTML Expression:
    // <script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#DFT_COND1#
    function ex_conditional_td
    ( p_id
    , p_rownum
    , p_cellnum
      var l_td;
      l_td = vd_getColumn(p_id, p_rownum, p_cellnum);
      // hier die Bedingung definieren
      if (true) {
        l_td.style.color = '#808080';
    }  // -- eof ex_conditional_td -- //
    // Beispiel Funktion zum Abstellen der onMouse Funktionalität der Tabellenzeile
    // HTML Expression:
    // <script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#DFT_ID#"
    function ex_conditional_tr
    ( p_id
    , p_rownum
      var l_tr;    // TABLE.TR
      var l_td;    // TABLE.TR.TD
      if (true) {
        l_tr = vd_getRow(p_id, p_rownum);
        l_tr.onmouseover = null;
        l_tr.onmouseout  = null;
        for (var i=0; i<l_tr.cells.length; i++) {
          l_td = l_tr.cells;
    l_td.style.backgroundColor = '#DDDDDD';
    } // -- eof ex_conditional_tr() -- //
    var g_DEBUG = false;
    var g_TBODY = null;
    // Liefert das Body-Element der Tabelle mit der ID <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // Return
    // das Body-Element oder NULL, wenn die Zeile nicht gefunden wurde
    function vd_getBody
    ( p_id
    if (g_TBODY == null) {
    var l_table = null;
    l_table = document.getElementById( p_id );
    if (l_table == null) {
    l_table = document.getElementByName( p_id );
    if (l_table != null) {
    if (vd_debug()) {
    alert("Tabelle gefunden, " + l_table.nodeName);
    g_TBODY = vd_search( l_table, 'TD', 't10data', 'TBODY');
    return g_TBODY;
    } // -- eof vd_getBody() -- //
    // Liefert die Zeile <p_rownum> der HTML-Tabelle mit der Id <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // p_rownum - die Zeilennummer
    // Return
    // die Zeile oder NULL, wenn die Zeile nicht gefunden wurde
    function vd_getRow
    ( p_id
    , p_rownum
    var l_body = vd_getBody(p_id);
    if ( l_body != null
    && l_body.nodeName == 'TBODY'
    && l_body.children[p_rownum].nodeName == 'TR') {
    return l_body.children[p_rownum];
    else {
    return null;
    } // -- eof vd_getRow() -- //
    // Liefert die Spalte <p_column> der Zeile <p_rownum> der HTML-Tabelle mit der
    // Id <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // p_rownum - die Zeilennummer
    // p_column - der Index der Spalte / Zelle
    // Return
    // die Zelle oder NULL, wenn die Zelle nicht gefunden wurde
    function vd_getColumn
    ( p_id
    , p_rownum
    , p_column
    var l_tr = vd_getRow(p_id, p_rownum);
    if ( l_tr != null
    && l_tr.nodeName == 'TR'
    && l_tr.children.length >= p_column
    && l_tr.children[p_column].nodeName == 'TD') {
    return l_tr.children[p_column];
    else {
    return null;
    } // -- eof vd_getColumn() -- //
    // Rekursives Suchen nach einem Node.
    // Zweck: Das bedingte Formatieren einer Tabellenzelle in einem Apex Standard
    // SQL-Report.
    // Diese Funktion durchsucht rekursiv, ab einem Ausgangsknoten <p_node>, alle
    // darunter befindlichen Elemente, ob in dem Element <p_seachIn> sich die
    // Klasse <p_class> befindet.
    // Bei Standard-Reports ist die Reportzelle (TD) mit der Klasse
    // "t10data" formatiert.
    // Zunächst muss dazu die Tabellenzelle (TD) selbst, die übergeordnete
    // Tabellenzeile (TR), der Tabellenbody (TBODY) oder die Tabelle (TABLE)
    // selbst ermittelt werden.
    // Der Beispielaufruf:
    // var l_body;
    // var l_node = document.getElementById( 'R112233' );
    // l_body = search( l_node, 'TD', 't10data', 'TBODY');
    // durchsucht also das mit der Id "R112233" versehene Element [der Report, für
    // den in Apex eine statischen ID vergeben werden musste] rekursiv, bis er
    // die [erste] Tabellenzelle "TD" findet, die als Klasse "t10data"
    // definiert hat. Für diese ermittelt er dann das übergeordnete TBODY-Element.
    // Parameter
    // p_node - das Ausgangselement
    // p_searchIn - der Knotenname, der durchsucht werden soll
    // [node.nodeName == p_searchIn]
    // p_class - der Name der CSS Klasse
    // [node.classList[<index>] == p_class
    // p_parentName - der Name [node.parentNode.nodeName == p_parentName]
    // des Elements, das zurückgeliefert werden soll. Wird als
    // p_parentName der Suchname p_searchIn angegeben, wird
    // das Element selbst zurückgegeben.
    // Return
    // das per p_parentName gesuchte Element (TD, TR, TBODY, TABLE)
    function vd_search
    ( p_node
    , p_searchIn
    , p_class
    , p_parentName
    var LN = "vd_search";
    var l_element = null;
    // DEBUG
    if (vd_debug()) {
    alert(LN + ":" + "Untersuche " + p_node.nodeName + ", id=" + p_node.id);
    // 1) der aktuelle Knoten ist der, der durchsucht werden soll
    if (p_node.nodeName == p_searchIn) {
    if (p_node.classList.length > 0) {
    for(var c=0; c<p_node.classList.length; c++) {
    if (p_node.classList[c] == p_class) {
    // Parent Node dynmisch suchen
    l_node = p_node;
    if (l_node.nodeName == p_parentName) {
    return l_node;
    while(l_node != null && l_node.parentNode != null) {
    if (l_node.parentNode.nodeName == p_parentName) {
    return l_node.parentNode;
    else {
    l_node = l_node.parentNode;
    // 2) wenn nicht 1) oder nicht in 1) gefunden, dann in den Kindelementen
    // weitersuchen
    if (p_node.children.length > 0) {
    var i = 0;
    while (i<p_node.children.length && l_element==null) {
    l_element = vd_search( p_node.children[i], p_searchIn, p_class, p_parentName);
    i++;
    return l_element;
    } // -- eof vd_search() -- //
    // Gibt an, ob Debug ein- (true) oder ausgeschaltet (false) ist.
    // Return
    // true - debug ist eingeschaltet
    // false - debug ist ausgeschaltet
    function vd_debug()
    return g_DEBUG;
    -->
    </script>
    Maybe you have to modify the "vd_getBody" function. I'm searching the table cell with having the class "t10data". When you use another theme, there's maybe another class used.
    Second is, that you set an static id for your report region. I prefer this structure:
    R<app-id><page-id><seq> (Raaaaappppsss) e.g. R094260001010.
    First example is to turn off the onMouse-Effect. Maybe on the first or last column definition you put this code in the "HTML-Expression" area:
    <script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#ID#This will call the example function ex_conditional_tr with the parameter
    a) the region id
    b) the rownum (as oracle always starts with 1 this is the first data row [rownum=0 is the table header row])
    Second example is the conditional formatting of a table cell. Put this in the HML-Expression area:
    <script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#ENAME#This will call the example function ex_conditional_tr with the parameter
    a) the region id
    b) the rownum
    c) the cellnum (here we have to subtract 1 to get the "real" cell index)
    The "ex_conditional" functions are just a representation of how to get the row or cell node.
    Hope this help a bit.
    Tom

    I would use a CASE statement in the select....
    each CASE would be an img src tag for a different button if the button is an image.
    does that make sense? I can include an example if you would like...

  • SQL report region source to call a pl/sql function using DB link

    Hi - I have a pl/sql function fn_dbtype(id NUMBER) defined in database X. The pl/sql function executes couple DML statements and returns a string (a SELECT query). I am able to call this function using SQL Plus (Connected to Database X) as below and it works fine:
    declare
    vSQL VARCHAR2(100);
    begin
    vSQL := fn_dbtype(1);
    end;
    The DML operations completed fine and vSQL contains the "Select" query now.
    In APEX:
    I am trying to create a SQL report in APEX using SQL query(PL/SQL function returning a sql statement) option. I am trying to figure out what to put in the region source so that the output of the "Select" query is displayed in the report.
    Moreover APEX is hosted in a different database instance. So I would need to call this pl/sql function using a DB Link.
    Please let me know what I need to put in the region source to execute the pl/sql function which returns the "Select" query thereby displaying the query output in the report. Thanks.
    Edited by: user709584 on Mar 19, 2009 2:32 PM
    Edited by: user709584 on Mar 19, 2009 2:34 PM

    try something like this:
    return fn_dbtype(1)@dblink;

  • Access Report Link to SQL database

    Hi,
    I have been designing a report interface in Access that is supposed to retrieve data from an SQL Database. The problem is that i don't know how to connect the two so that it (report) retrieves data from the database. How do I connect the two?
    martin

    Hi breakage,
    Based on my understanding, you want to connect to a SQL Server database on Access side, then retrieve the data from the database.
    When connecting to a SQL Server database, Access creates a new table (linked table), and it's structure and contents are corresponding to the source object. In your scenario, you can open the Access database in which you want to create the linked tables,
    then choose External Data tab. With the wizard, you can link the expected SQL Server database. For more information, please refer to the
    Link to SQL Server data section of this article:
    Import or link Access to SQL Server data .     
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • SQL Report Row Highlighting

    Hi,
    Hoping someone can please assist but I am unsure how to highlight a row within my SQL Report based on a condition, i.e. either a DECODE or CASE statement being true - if so, would like that report highlighted light blue say.
    Any help, links,examples would be much appreciated.
    Thanks.
    Tony.

    This should help
    Conditional item formatting (color)
    you will have to tweak it a bit, but its a way forward for you.

  • Changing Row color of standard SQL report

    Hi,
    I am trying to follow this post to change the color of a row in APEX SQL report. Change Colour of Row - Oracle APEX SQL Report
    It's a bit outdated, and trying to figure out how to get to this page: http://img7.imageshack.us/img7/4782/columntemplate.jpg in APEX 4.2 where I can conditionally set background color.
    I am using theme 13 (legacy) and made a copy of the report region. Edited it but cannot find an equivalent section of that apex 3.1 screenshot.
    Any help appreciated.

    William Wallace wrote:
    I sure was :) Cheers for pointing it out.
    Just another question, there are 4 options for the #COLUMN_VALUE# which I have background color conditionally (just like in that screenshot) based on one of the column values. The column can be of 1..5 values, however I only have 4 conditions to work with in the template editor.
    So what APEX is doing is since it can't find a 5th matching condition, it picks the very first one and applies it on it (even though the condition doesn't match).
    Is there anyway I can incorporate a 5th option/condition for column templates? Cheers.Not using that technique. There are a couple of options: another template-based approach using a custom named column report template, or using jQuery. I generally prefer the template method as everything runs on the server.
    1. Start by including a column containing the condition logic to generate a class value in the report query:
    select
            , case
                when sal < 1000 then 'low'
                when sal between 1000 and 2000 then 'medium'
                when sal > 2000 then 'high'
              end sal_class
    from
              empThen create a custom named column report template:
    2. Go to: Shared Components > Templates > Create
    3. In the wizard select: Report > From Scratch
    4. Enter/select:
    Name: [Name for this template]
    Theme: [Your current theme]
    Template Class: Custom 1
    Template Type: Named Column (row template)
    5. Click Create.
    6. Click the Status Report link in the Templates report.
    7. Enter the following properties:
    Row Template 1
    <tr class="#SAL_CLASS#"><td>#1#</td><td>#2#</td>...include a cell with a column substitution for every column in your report...</tr>i.e. the column with the conditional logic in the query is used to apply the required class to the row.
    Before Rows
    <!-- Copy the Before Rows definition from the Standard report template for your current theme and paste here -->
    <tr><th>#1#</th><th>#2#</th>...include a header with a column substitution for every column in your report...</tr>
    After Rows
    <!-- Copy the After Rows definition from the Standard report template for your current theme and paste here -->Add CSS to style the rows:
    8. Edit the Page CSS Attributes for the report page:
    Inline
    tr.low td { background-color: yellow; }
    tr.medium td { background-color: white; }
    tr.high td { background-color: red; }9. Change the report to use the new template.
    For the alternative jQuery approach, Tom created an example for this thread: +{thread:id=2487955}+

  • Add Image column in classic sql report to open a pop page

    I have sql report I want to add a new column which will have image to click, Once user clicks the image a popup page should open.

    Hi Vikram,
    Sorry to bother you, I am very new to apex. Here is my sql query for sql report. Can you please help me.
    <xmp>select
    case
    when ISUPPORT_NUMBER is null or ISUPPORT_NUMBER = 'N/A' then '<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Enter SR Number</p></a>'
    else '<span style="background-color:red;font-weight:bold">'
    || ISUPPORT_NUMBER
    || '</span>'
    end ISUPPORT_NUMBER,
    case
    when ISUPPORT_NUMBER is not null and ISUPPORT_NUMBER != 'N/A' then '<a href="javascript:myFunc4(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#FF0000;font-size:14px;">'|| MACHINE_NAME ||'</p></a>'
    else '<a href="javascript:myFunc4(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:14px;">'|| MACHINE_NAME ||'</p></a>'
    end MACHINE_NAME,
    FUNCTION,
    VERSION,
    VENDOR_CLUSTER,
    case when used_by is null then '<a href="javascript:myFunc2(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Avaliable</p></a>'
    when upper(used_by)=v('APP_USER') then '<a href="javascript:myFunc5(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:blue;font-size:12px;">' || used_by || '</p></a>'
    else used_by
    end used_by,
    case
    when loaned_to is null and ( upper(used_by)=v('APP_USER') or used_by is null) then '<a href="javascript:myFunc(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">Avaliable</p></a>'
    when upper(used_by)=v('APP_USER') then '<a href="javascript:myFunc6(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:blue;font-size:12px;">' || loaned_to || '</p></a>'
    else loaned_to
    end loaned_to,
    LOANED_TO_EXPIRY_DATE,
    LOAN_INFO,
    decode(SCAN_NAME,null,'<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">More Details</p></a>','<a href="javascript:myFunc3(''' || MACHINE_NAME || ''')"><p style="font-weight:bold;color:#04B404;font-size:12px;">More Details</p></a>') SCAN_NAME,
    USERNAME,
    VNC_PASSWORD,
    LAST_UPDATED_BY , </xmp>
    <b>Here I want to add a image column where I can give a link like above to open popup </b>
    from install_dbqa_machines
    Edited by: Sivaramaraju on Jun 19, 2012 9:06 AM
    Edited by: Sivaramaraju on Jun 19, 2012 9:07 AM
    Edited by: Sivaramaraju on Jun 19, 2012 9:08 AM

Maybe you are looking for