Display none HTML tags of a column shown . How exclude those from excel export

Display none HTML tags of a column shown . How exclude those from excel export

haiderTyagihaiderTyagi Posts: 11Questions: 2Answers: 0

<tr>
<td>Meeting<label calss="hide" style="display:none">0</label></td>
</tr>
or it can be
<tr>
<td><sapn>Meeting</span><label calss="hide" style="display:none">0</label></td>
</tr>

In column there is a label with dispay none attribute .. that label is not showing in browser but when i excel export
its show in excell sheet like Meeting0
How Show only Meeting not the display none tag

Answers

  • haiderTyagihaiderTyagi Posts: 11Questions: 2Answers: 0
    edited April 2019

    exportOptions: { columns: [':visible'] }, not works bcz. its not the column which is hidden. this is a label inside column,, and i also try stripHtml this stripHtml work in print but not in excel export
    In Excel Export it shows
    Meeting<label calss="hide" style="display:none">0</label>

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    Hi @haiderTyagi ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • haiderTyagihaiderTyagi Posts: 11Questions: 2Answers: 0
    edited April 2019
  • allanallan Posts: 61,729Questions: 1Answers: 10,110 Site admin

    Thanks for the example. You could use an export formatter, but it would be better if you could just put the label information as an attribute for the td tag - e.g.:

    <td>2000 Usd<label style="display:none" class="notS">Hr001</label></td>
    

    could become:

    <td data-label="Hr001">2000 Usd</td>
    

    The data is still present (assuming you need it for some scripting thing, since it isn't visible to the end user) and the export will work just fine.

    Allan

  • haiderTyagihaiderTyagi Posts: 11Questions: 2Answers: 0
    edited April 2019

    @colin @allan
    Will you please check that

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    Hi @haiderTyagi ,

    What would you like us to check? Allan gave a couple of solutions in his reply.

    Cheers,

    Colin

  • haiderTyagihaiderTyagi Posts: 11Questions: 2Answers: 0

    Hi @allan
    Thank You for ur suggestion
    What if i use
    <td><sppn class="show">2000 Usd<span><span style="display:none" class="notS">Hr001</spanl></td>
    **
    instead of **<td data-label="Hr001">2000 Usd</td>

    is there any other way to over come the problem

    by D wy Thx for ur answer

  • haiderTyagihaiderTyagi Posts: 11Questions: 2Answers: 0

    @allan

    actually.. i also give an id to that label and showing that label on behalf of some condition

  • haiderTyagihaiderTyagi Posts: 11Questions: 2Answers: 0
  • haiderTyagihaiderTyagi Posts: 11Questions: 2Answers: 0

    This My table With Real Data

This discussion has been closed.