Skip to Main Content
Feature Request FR-2322
Product Area Page Components
Status CLOSED

22 Voters

"Shorten text" as option in plain text report column type and show the full text by clicking on more

markus.wilhelm Public
· Feb 4 2022

Idea Summary

It needs an option to shorten long text for a good looking report. 

The whole text should be able to be displayed as a modular window via a link at the end of the shortened text.

Use Case
In our report we have some columns like Notes where the text is often too long for a good looking report. So I truncated to 80 characters. I do this in the source query like that:

case when length(NOTES) > 80 then substr(NOTES,1,80) ||
 '<span><a href="'|| apex_util.prepare_url('f?p='|| :APP_ID ……. ) || '"> .... more </a></span>'
 else NOTES end NOTES_SHORT,

Preferred Solution (Optional)
An option "Shorten text" with the specification of the character length would be simpler.

This is a great idea! You can already achieve this in APEX today with a slightly different approach.

Comments

Comments

  • jayson hanes Admin OP 3.3 years ago

    This would be really nice. Although easy to manually implement for an experienced APEX developer, not so easy for a novice.

  • markus.wilhelm OP 3.3 years ago

    Thanks Jayson, I think the same.

  • john.snyders APEX Team OP 2.3 years ago

    Makes sense as a new item/column type or possibly an enhancement to an existing one such as display only.

  • michael.weinberger 2 OP 2.3 years ago

    We are using https://github.com/viralpatel/jquery.shorten to achive this in interactive reports:
    $("#TASKS [headers*='BESCHREIBUNG']").shorten({showChars:50,moreText:'mehr',lessText:'weniger'});

    We put this line in a dynamic action (after refresh interactive report region).
    TAKS is the static id of the interactive region and BESCHREIBUNG the header of the column. Works like a charm.
    .

  • fac586 OP 2.2 years ago

    Looks like a viable use case for a Template Component

  • sorin apalaghie OP 1.8 years ago

    @jayson hanes I'd argue that this can easily be achieved by any APEX Developer. They would simply use the HTML Expression section of the column and then copy and adapt one line of code from the Universal Theme App

    <p class="u-lineclamp-1">&MY_COLUMN.</p>  →Interactive Grids
    <p class="u-lineclamp-1">#MY_COLUMN#</p>  →Interactive or Classic Reports. 

    If more lines should be displayed then simply change the class to u-lineclamp-2 , u-lineclamp-3 .

  • michael.weinberger 2 OP 1.8 years ago

    @sorin apalaghie : I have to disagree. This will shorten the text, true. 

    But the enduser can not expand it. It is forever shortend. 
    With the js library I mentioned, it can be shortend, expanded and shortend again with just a click.

  • sorin apalaghie OP 1.8 years ago

    This template component plugin should work on 23.1 onwards
    https://apex.oracle.com/pls/apex/r/sorinu/column-text-to-dialog-lineclamp/home

  • michael.weinberger 2 OP 1.8 years ago

    @sorin apalaghie this does work fine. I was not aware how easy it is to make template components. 
    I like it.