Visokio website     Downloads     Video tutorials     KnowledgeBase  
Content View: Dynamic HTML table scripting? - Visokio Forums
Content View: Dynamic HTML table scripting?
  •     enrico68 February 18, 2013 5:40AM
    Hi - I'm writing script code for an HTML table in a Content View. I'd like to have the number of columns of the table be variable depending on the result of the following:

    ncolloc=

    SUBSET_UNIQUECOUNT('ABICapoGruppo',
    SUBSET2('Dataregolamento','Dataregolamento',datafiltromin,datafiltromax,'>=','<='))<br />
    Which is the correct syntax to include the ncolloc variable in the following COLSPAN definition??

    < td > colspan=????ncolloc??? rowspan=1> Raccolta Netta Collocatori < /td >

    (I intentionally put spaces after < and > to have full definition line visible)

    Thanks
  • 3 Comments
  •     michael February 18, 2013 10:07AM
    Hi Enrico,

    Could you show an example of what you are trying to achieve in Excel or Word file with table with merged cells plus some small dataset example.
  •     enrico68 February 18, 2013 11:46AM
    Attached you can find an example of the table I'd like to obtain.

    Colspan for table section "Raccolta Netta Collocatori" is at the moment fixed to 10 because maximum number of "Collocatori" that can be considered is exactly 10.

    In the first picture in the attached file, filters include year 2012.
    The table columns are shown correctly because all 10 "Collocatori" have valid records for this period.

    Unfortunately, applying filters to consider a shorter period of time, the number of "Collocatori" that have valid values (records) decreases by one.
    As a consequence of this, as you can see in picture 2, one column is missing and the right border is not shown correctly due to this missing "Collocatore".

    So I'd like to make value of colspan depending on the number of "Collocatori" selected by current filters (using SUBSET_UNIQUECOUNT function on "Collocatori" to determine its current value).

    Thanks
    Attachments
    example.doc.docx 369K
  •     michael February 19, 2013 6:03AM
    Hi Enrico,

    Please, try something like in the following example.

    <#
    var categories = SUBSET_UNIQUESLIST("Field 1");
    #>

    <table border=1>
    <tr><td colspan="<#=categories.length#>" >Title</td></tr>
    <tr>
    <#for (var i=0; i<categories.length; i++) {#>
    <td><#=categories[i]#></td>
    <#}#>
    </tr>
    </table>
    Attachments
    colspan.iok 7K

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Tagged