Discussions

 View Only
  • 1.  Adding a report legend using report description

    Posted 07-06-2017 16:44
    I want to add colored icons to my report description. How would I put something like this on top of my report, where I could maybe change the colors by specifying a hex value?


  • 2.  RE: Adding a report legend using report description

    Posted 07-07-2017 20:04
    Is this possible? Anybody?


  • 3.  RE: Adding a report legend using report description

    Posted 07-07-2017 20:06
    This is not possible natively.


  • 4.  RE: Adding a report legend using report description

    Posted 07-07-2017 20:37
    This is possible with some code and can do with Dan's famous IOL technique.

    Are you familiar with IOL technique? If not?

    Please go through this link and read it because Dan had described it in a very simple way.

    https://community.quickbase.com/quickbase/topics/how-do-i-setup-the-image-onload-technique-iol

    Please apply the same in your application and change the code of module.js to this:

    $("#descriptionInFacets").html("Legend  <img src= 'https://images.quickbase.com/si/16/221-point_red.png'> Project Overdue<img src='https://images.quickbase.com/si/16/223-point_yellow.png'> Task Overdue <img src='https://images.quickbase.com/si/16/228-rect_green.png On Time <img src='https://images.quickbase.com/si/16/220-point_gray.png'> Inactive");

    Please let me know if you have any query or need any help in this.

    Thanks,
    Gaurav 


  • 5.  RE: Adding a report legend using report description

    Posted 07-07-2017 20:39
    Thank you! I'll give it a try.


  • 6.  RE: Adding a report legend using report description

    Posted 07-07-2017 20:51
    Just put your raw HTML in the description section of the report and use IOL with this single statement:

    $("#descriptionInFacets").html($("#descriptionInFacets").text());


  • 7.  RE: Adding a report legend using report description

    Posted 07-08-2017 14:32
    Working demo:

    HTML Report Description ~ List All
    https://haversineconsulting.quickbase.com/db/bmwtjd4pk?a=q&qid=1

    Pastie Database
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=588

    Notes:

    (1) The HTML decoding was not applied to the table homepage where the raw HTML markup appears unrendered:

    https://haversineconsulting.quickbase.com/db/bmwtjd4pk?a=td

    (2) There is an unlikely scenario where this might be abused. Although an admin is the only person that could implement this script, once implemented it might be possible for a user to add script to his own report description and then lure others to visit that report.

    <script>alert("xss");</script>

    As a general rule an administrator should have a sufficient level of trust of all users with rights to create reports if they intent to implement this feature.


  • 8.  RE: Adding a report legend using report description

    Posted 07-08-2017 14:46
    UPDATE:

    I put a crude <script> blocker into the code:

    Pastie Database
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=588


  • 9.  RE: Adding a report legend using report description

    Posted 08-14-2018 13:44
    can this method be used to inject application wide variables like start and close dates into the description?


  • 10.  RE: Adding a report legend using report description

    Posted 06-20-2018 14:37
    I have tried using this and have followed all the steps for the IOL.  I can get the "I now own your page" alert to appear in the browser but I cannot get the legend/images to render.  This is what I'm getting:  



    Any idea what I might be doing wrong?  I saw the link to the page where the legend is unrendered.  Making me wonder if I need to do something else - yet it's the exact same formula as the page that shows the legend rendered.  Can anyone point me in the right direction?


  • 11.  RE: Adding a report legend using report description

    Posted 08-14-2018 13:46
    Can't see the whole report but the IOL field (typically noted as [-]) isnt there. You sure you set up IOL correctly?


  • 12.  RE: Adding a report legend using report description

    Posted 08-14-2018 13:49
    Thank you for your reply.  I'll double check!