I want to download,copy and print the HTML contents from the grid. From the below code i'm just able

I want to download,copy and print the HTML contents from the grid. From the below code i'm just able

sundar pawarsundar pawar Posts: 7Questions: 2Answers: 0

$('#tableQnAs').dataTable(

    {

         dom: 'Bfrtip',
                buttons: [
                   'copy', 'excelHtml5', 'print',

        ],

For example in grid i'm using Anchor tag where the text appears as "Please Click" in grid the same is downloading but i required the content in Anchor tag or entire anchor tag to download , copy and print

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Answer ✓

    Thanks for your question. As noted in the forum rules, please post a link to a running test case showing the issue so we can offer some help. 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.

    Allan

  • sundar pawarsundar pawar Posts: 7Questions: 2Answers: 0

    Hi Allan,

    PFB test case URL

    https://codepen.io/anon/pen/Laoqyj

    Where in the last column by name "Content" i'm getting "Click and Click Here" while downloading i'm getting the same text. But i required entire Anchor tag or a URL and if text is their text to download.

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Answer ✓

    You can use the stripHtml option of the buttons.exportData() method (which is accessed through exportOptions object for the button): https://codepen.io/anon/pen/PLrwPb .

    Note that it doesn't create a link in Excel though. Its just preserving the HTML.

    Allan

  • sundar pawarsundar pawar Posts: 7Questions: 2Answers: 0

    I'm getting HTML contents .But after download i'm getting the value in cells in below format
    <span id="cphMain_rptQnAs1_lblanswer_30"><a href="\AMERICAS.CORPDIR.NET\DAFS\TOR_DEPARTMENT SHARE\BSPI\IT Support\Documentations\ACM -ONBOARDING -OFFBOARDING SYSTEM"> Please Click</a></span>

This discussion has been closed.