Forum Stats

  • 3,728,079 Users
  • 2,245,538 Discussions
  • 7,853,304 Comments

Discussions

Multiple CARD_TEXT in APEX

Rotan
Rotan Member Posts: 119
edited May 2017 in APEX Discussions

Hi,

How can have multiple #CARD_TEXT# in a APEX page with 'Cards' Template for Report.

I meant, Usually we wrtie a SQL query as below

Select

'aaaa' 'CARD_INITIALS',

'bbbb' 'CARD_HEADING',

'cccc' 'CARD_TEXT',

'dddd' 'CARD_SUBTEXT'

from dual:

Suppose, I need to have multiple CARD_TEXT to be used in my Apex Card.

How can this be done, as SQL will allow only one 'CARD_TEXT' alias name.

I need to have 1 heading and 4 lines with same fontsize in the card.

Any help appreciated !!!

Thanks

Rotan

Best Answer

  • fac586
    fac586 Senior Technical Architect Member Posts: 19,545 Black Diamond
    edited May 2017 Accepted Answer
    Rotan wrote:The data consists of 'Total Records', 'Processed Records', 'Error Records'.

    That would appear to be three elements, not four...

    Assuming the data is sourced from three (or four) columns or expressions, here's how to do this using semantic mark-up and proper separation of concerns:

    1. In the report source query, return null for the CARD_TEXT column value, and the data elements in separate columns:

    select    ...                     card_title  , ...                     card_link                                          , null                    card_text  , null                    card_subtext  , coalesce(total, 0)      total  , coalesce(processed, 0)  processed  , coalesce(errors, 0)     errors  ...

    2. Set the CARD_TEXT column HTML Expression to

    <dl>  <dt>Total Records<dd>#TOTAL#  <dt>Processed Records<dd>#PROCESSED#  <dt>Error Records<dd>#ERRORS#</dl>

    3. Set the report template option Body Text to Auto.

    4. Add a style sheet to the page Inline CSS property to position the terms and descriptions so they appear on the same line:

    .t-Card-desc dt {    display: inline-block;    width: 8.65em;}  .t-Card-desc dd:before {  content: ": ";}.t-Card-desc dd {    display: inline;    margin: 0;  }  .t-Card-desc dd:after {    display: block;    content: "";  }  
    RotanRotan

Answers

  • fac586
    fac586 Senior Technical Architect Member Posts: 19,545 Black Diamond
    edited May 2017
    3299849 wrote:

    Please update your forum profile with a recognisable username instead of "3299849": Video tutorial how to change nickname available

    How can have multiple #CARD_TEXT# in a APEX page with 'Cards' Template for Report.I meant, Usually we wrtie a SQL query as belowSelect'aaaa' 'CARD_INITIALS','bbbb' 'CARD_HEADING','cccc' 'CARD_TEXT','dddd' 'CARD_SUBTEXT'from dual:Suppose, I need to have multiple CARD_TEXT to be used in my Apex Card.How can this be done, as SQL will allow only one 'CARD_TEXT' alias name.I need to have 1 heading and 4 lines with same fontsize in the card.

    Why? What exactly does this data consist of?

  • Rotan
    Rotan Member Posts: 119
    edited May 2017

    The data consists of 'Total Records', 'Processed Records', 'Error Records'.

  • Rotan
    Rotan Member Posts: 119
    edited May 2017

    The data consists of 'Total Records', 'Processed Records', 'Error Records'.

  • LA County APEX
    LA County APEX Member Posts: 637
    edited May 2017

    Try this:

    '<table><tr><td>Total Records:</td><td style="width:100px;text-align:right;">' || tcnt || '</td></tr><tr><td>Processed Records</td><td style="width:100px;text-align:right;">' || pcnt || '</td></tr><tr><td>Error Records</td><td style="width:100px;text-align:right;">' || ecnt || '</td></tr></table>' card_subtext

  • fac586
    fac586 Senior Technical Architect Member Posts: 19,545 Black Diamond
    edited May 2017 Accepted Answer
    Rotan wrote:The data consists of 'Total Records', 'Processed Records', 'Error Records'.

    That would appear to be three elements, not four...

    Assuming the data is sourced from three (or four) columns or expressions, here's how to do this using semantic mark-up and proper separation of concerns:

    1. In the report source query, return null for the CARD_TEXT column value, and the data elements in separate columns:

    select    ...                     card_title  , ...                     card_link                                          , null                    card_text  , null                    card_subtext  , coalesce(total, 0)      total  , coalesce(processed, 0)  processed  , coalesce(errors, 0)     errors  ...

    2. Set the CARD_TEXT column HTML Expression to

    <dl>  <dt>Total Records<dd>#TOTAL#  <dt>Processed Records<dd>#PROCESSED#  <dt>Error Records<dd>#ERRORS#</dl>

    3. Set the report template option Body Text to Auto.

    4. Add a style sheet to the page Inline CSS property to position the terms and descriptions so they appear on the same line:

    .t-Card-desc dt {    display: inline-block;    width: 8.65em;}  .t-Card-desc dd:before {  content: ": ";}.t-Card-desc dd {    display: inline;    margin: 0;  }  .t-Card-desc dd:after {    display: block;    content: "";  }  
    RotanRotan
  • Rotan
    Rotan Member Posts: 119
    edited May 2017

    Hi,

    Thank You for your response.

    Drifting off.... how can I mark answer as correct answer. I just see Like , Helpful, comment , Actions (there is no actions under the action link )

    pastedImage_0.png

This discussion has been closed.