Skip to content
Loading
  • 0
    A Legendary work! It looks great. Thanks a ton Sanjeeb.
    0
  • 0
    So Sanjeeb if I want to do same functionality to other page, there is no change done to aspx page right, apart from the script. Because I tried in another page where it has lot of nested grid and I am getting an error on highlighted one below when I click on Export to Excel.

    THIS ATTACHMENT IS A DIFFERENT PAGE WHICH HAS NESTED GRID.

    <




    html = $.trim(html);
    html = html.replace(/>/g,
    html = html.replace(/$(
    }


    script language="javascript" type="text/javascript">function ExportDivDataToExcel() {var html = $("#divprint").html();'>');'<');"input[id$='HdnValue']").val(html);script>

    t
    0
  • Sanjeeb Lenka
    0
    Hi Vignesh,
     You forgot to give the div id in your code. Means which div you write for grid. so i modified the code and attached it. just check it carefully before update it. Don't forget to attach the jquery.





    if it helps you mark it as answered.
    0
  • 0
    Hi Sanjeeb,

    I tried your code and its still the same. Please look into the attachment for the error message.
    0
  • Sanjeeb Lenka
    0
    hi, paste your code i will check that.
    0
  • 0
    Sanjeeb

    I have attached two pages where I need to bring this functionality and I get the same error for these two pages.
    0
  • Sanjeeb Lenka
    0
    hi,
    you forgot to add Jquery library in both the form just add that and check.



    Mark it as answered if it helps you.
    0
  • 0
    Hi Sanjeeb,
    I have added the Jquery to the library already. Totally I HAVE THREE PAGES, where it works for LOB and doesn't works for BSP and APP pages in the attchment.
    0
  • 0
    It worked great with no problems now! A small doubt, when the report is generated the report doesn't seems nice when compared to the page and can be found in the attachment. Can you pls suggest me something for this.
    0
  • Sanjeeb Lenka
    0
    hi,
     I checked that problem . its came due to the buttons and other controls.
    so i giving you a link just check that link its not in Jquery. you just check and reply.

    http://stackoverflow.com/questions/7525537/how-to-exporting-to-excel-parent-and-nested-gridview-data
    0
  • 0
    Hi Sanjeeb,

    Saw the link and looks like they have used Clear method in the program. So do you think this has to be added to the program.
    0
  • Sanjeeb Lenka
    0
    yes,
     just try it in a separate page and check. 1st remove the javascript form the button click and check.
    0