jQWidgets Forums

jQuery UI Widgets Forums Grid Formatting headers of Grid when exporting.

Tagged: ,

This topic contains 4 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author

  • rajamalik
    Participant

    Hello,

    We are exporting the data of grid into excel and CSV. The data is exported fine but two points:

    1. When rendering the grid, we put pipes(‘|’) symbol for new line. We do not want to export these pipes symbol. How do we remove these?
    2. Grid also contains some aggregation information like count, this too gets exported and we do not want to export this as well?

    Any help will be greatly appreciated.

    Thanks
    RAJA


    Peter Stoev
    Keymaster

    Hi RAJA,

    1. The “exportdata” method has a parameter called “rows” which is the Array of rows which will be exported. You can get the rows into the view using “getrows” method, modify that array by removing these “|” symbols and then pass the result when you call “exportdata”.
    2. If you have aggregates, these would be exported and you can’t modify that.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    rajamalik
    Participant

    Thanks for reply.

    This is what I am doing Peter. I just wanted to know if there is some configuration provided by framework for the same.

    Actually, I call exportdata like:

    var contentGrid = $(gridObj).jqxGrid(‘exportdata’,’tsv’,undefined,true,undefined,false);

    1. Now I get the first(the header) row of contentGrid and manipulate it to remove “|”
    2. Same way, I remove last(aggregation) row from contentGrid using contentGrid.subString(0,contentGrid.getLastIndex(‘\n’))

    Thanks
    Raja


    rajamalik
    Participant

    Hello Peter,

    I also need to format the data. Can we configure the format of date to be exported in jqx grid or we have to do it using getrows method?

    Thanks
    Raja


    Peter Stoev
    Keymaster

    Hi Raja,

    The Grid in the current version exports the Data as it is displayed i.e formatted – http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/dataexport.htm?arctic, but if you wish you can perform some additional formatting by passing the custom rows array.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.