jQWidgets Forums

jQuery UI Widgets Forums Grid Export Datas

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

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Export Datas Posts
  • Export Datas #14366

    SylvainD
    Member

    Hi,

    I’m trying to export data to an XML format.

    My source data is composing of 3 values : Id, Date, Number (a float value)
    Source definition is :

    var source = {
    datatype: 'json',
    datafields: [{ name: 'Id', type: 'number' }, { name: 'Date', type: 'date' }, { name: 'Value', type: 'number' }],
    data: { nodeId: '@Model.NodeId', last: '10' },
    id: 'Id',
    url: '...'
    };

    My grid definition is :

    $('#download1TempGrid').jqxGrid({
    source: dataAdapter,
    autoheight: true,
    width: '200',
    columns: [{ text: 'Date', datafield: 'Date', cellsformat: 'dd/MM/yyyy' }, { text: 'Time', datafield: 'Date', cellsformat: 'hh:mm:ss.sss' }, { text: 'Value', datafield: 'Value' }]
    });

    Remark : I splitted the Date field in 2 columns, one for the date and one for the time.

    My grid is well displayed.

    When I export the datas, I only have 2 columns :
    1.The time value
    2.the float value is trunked as a int value

    And the date value has disappeared.

    Below the XML file with 10 rows:

    02:46:35.3535
    15

    02:46:35.3535
    14

    02:46:35.3535
    0

    02:46:35.3535
    30

    02:46:35.3535
    14

    02:46:35.3535
    15

    02:46:35.3535
    12

    02:46:35.3535
    23

    02:46:35.3535
    2

    02:46:35.3535
    9

    Thanks for your help
    Sylvain

    Export Datas #14368

    Peter Stoev
    Keymaster

    Hi SylvainD,

    The column’s datafield is expected to be an unique setting. In your Grid, you have 2 columns with the same datafield. That should be the reason for that behavior.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Export Datas #14369

    SylvainD
    Member

    That’s right for the first issue. If I put Date and Time in the same column the export is ok.

    But my number is still exported as an integer and not a float.

    Sylvain

    Export Datas #14371

    Peter Stoev
    Keymaster

    Hi Sylvain,

    Set the “cellsformat” of that column.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Export Datas #14373

    SylvainD
    Member

    Great Peter.

    Thanks

    Export Datas #14444

    SylvainD
    Member

    Hello,

    last little problem : I use a french localization (I did myself) on my grid, specially for the date and to remove the thousandseparator.

    The display on the grid is fine but the export datas are not. The thousandseparator is always a coma ‘,’.

    Here is my french localization :

    function GetLocalisation_fr() {
    var days = {
    // full day names
    names: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
    // abbreviated day names
    namesAbbr: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"],
    // shortest day names
    namesShort: ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"]
    };
    var months = {
    // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar)
    names: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Decembre", ""],
    // abbreviated month names
    namesAbbr: ["Jan", "Fev", "Mar", "Avr", "Mai", "Jun", "Jul", "Aou", "Sep", "Oct", "Nov", "Dec", ""]
    };
    var localizationobj = {};
    localizationobj.pagergotopagestring = "Aller a:";
    localizationobj.pagershowrowsstring = "Voir ligne:";
    localizationobj.pagerrangestring = " à ";
    localizationobj.pagernextbuttonstring = "précédent";
    localizationobj.pagerpreviousbuttonstring = "suivant";
    localizationobj.sortascendingstring = "Tri ascendant";
    localizationobj.sortdescendingstring = "Tri descendant";
    localizationobj.sortremovestring = "Supprimer tri";
    localizationobj.firstDay = 1;
    localizationobj.percentsymbol = "%";
    localizationobj.currencysymbol = "€";
    localizationobj.currencysymbolposition = "after";
    localizationobj.decimalseparator = ".";
    localizationobj.thousandsseparator = " ";
    localizationobj.days = days;
    localizationobj.months = months;
    return localizationobj;
    };

    Thanks
    Sylvain

    Export Datas #14476

    Peter Stoev
    Keymaster

    Hi Sylvain,

    The Grid’s localization is currently not set in the exporter so Excel will not take into account your localization settings. We will resolve that in the next release.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.