jQWidgets Forums

jQuery UI Widgets Forums Grid Export into excel file from grid

This topic contains 24 replies, has 6 voices, and was last updated by  Peter Stoev 9 years, 8 months ago.

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
  • Export into excel file from grid #6257

    Neelam
    Member

    Hello,

    Do we have export feature in grid? I want to download/export the grid info into excel file.

    Thanks,
    Neelam

    Export into excel file from grid #6261

    Peter Stoev
    Keymaster

    Hi Neelam,

    jqxGrid does not have data export capabilities. When we implement the requested feature, we’ll definitely add examples and documentation about it. However, the feature is still not in our Roadmap.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Export into excel file from grid #6271

    Neelam
    Member

    Ok not an issue.

    I have another problem. I want to another currency symbol rather than $. If I make a column as a float , it shows $ by default for that. How can I show another currency sign fetch from database?

    Regards,
    Neelam

    Export into excel file from grid #6281

    Peter Stoev
    Keymaster

    Hi Neelam,

    You can take a look at this help topic: jquery-grid-localization.htm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Export into excel file from grid #7882

    Neelam
    Member

    Hello,

    Nice to see new version 2.4. I am using export to excel in jqgrid where it works fine. but in html page, I have used 2 grids which are toggled by clicking on button. so when first time page renders and I click on export button, then export funcationality works good. after I click on a button say ‘detail’ whic h gives me second grid. it also has export functionality but it doesn’t work for second grid.

    Regards,
    Neelam

    Export into excel file from grid #7883

    Peter Stoev
    Keymaster

    Hi Neelam,

    Please, provide a sample so we can test your scenario, too. Also make sure that you use jQWidgets 2.4.2.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Export into excel file from grid #7889

    Neelam
    Member

    Hi,

    I created a sample script but its working fine. but the same script in my application giving me popup to stop script.

    Could you please tell me what could be the problem?

    Export into excel file from grid #7893

    Peter Stoev
    Keymaster

    Hi Neelam,

    Unfortunately, I don’t have any idea. It is possible that you may be you have some restrictions in your app or PC which prevents the communication with the server. It is also possible that we have an issue that we don’t know about. If you are able to provide a sample, we will be able to debug and trace the issue, but without a sample, I am afraid that I can’t help. Note that the export has client and server side and the server side is hosted on http://www.jqwidgets.com.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Export into excel file from grid #7896

    Neelam
    Member

    Hi Peter,

    I found the issue. The data which is being shown in jqgrid is very huge and varies in size. So I am able to export data for max 8.6MB. If data exceeds more than this it redirects me to the below url.

    http://www.jqwidgets.com/export_server/save-file.php

    Regards,
    Neelam

    Export into excel file from grid #7900

    Peter Stoev
    Keymaster

    Hi Neelam,

    I suppose that depends on the server’s limits. If you host the save-file.php on your own server, you may have a different capacity. However, that file is provided only to licensed customers. If you have a valid license, please feel free to contact us by e-mail.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Export into excel file from grid #7950

    Neelam
    Member

    Hi,

    How this file work with jqxgrid.export.js and jqxgrid.filter.js? There is no connection of save-file.php with filter js file.

    It should export data with filter condition irrespective of data size?

    Regards,
    Neelam

    Export into excel file from grid #7951

    Peter Stoev
    Keymaster

    Hi Neelam,

    The Grid exports the data which is in the View i.e the visible data i.e if you have applied filter, it will export the visible rows. If you have sorted the rows, it will export the rows keeping the sort order i.e the same as what you see.

    Example code with applied Filter:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.8.1.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsresize.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.export.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.export.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.sort.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.filter.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../../scripts/gettheme.js"></script>
    <script type="text/javascript" src="generatedata.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = getTheme();
    // prepare the data
    var data = generatedata(100);
    var source =
    {
    localdata: data,
    datatype: "array",
    updaterow: function (rowid, rowdata) {
    // synchronize with the server - send update command
    }
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    var addfilter = function () {
    var filtergroup = new $.jqx.filter();
    var filter_or_operator = 1;
    var filtervalue = 'Beate';
    var filtercondition = 'contains';
    var filter1 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
    filtervalue = 'Andrew';
    filtercondition = 'starts_with';
    var filter2 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
    filtergroup.addfilter(filter_or_operator, filter1);
    filtergroup.addfilter(filter_or_operator, filter2);
    // add the filters.
    $("#jqxgrid").jqxGrid('addfilter', 'firstname', filtergroup);
    // apply the filters.
    $("#jqxgrid").jqxGrid('applyfilters');
    }
    // initialize jqxGrid
    $("#jqxgrid").jqxGrid(
    {
    width: 670,
    source: dataAdapter,
    theme: theme,
    altrows: true,
    ready: function () {
    addfilter();
    },
    filterable: true,
    sortable: true,
    selectionmode: 'multiplecellsextended',
    columns: [
    { text: 'First Name', datafield: 'firstname', width: 90 },
    { text: 'Last Name', datafield: 'lastname', width: 90 },
    { text: 'Product', datafield: 'productname', width: 177 },
    { text: 'Available', datafield: 'available', width: 67, cellsalign: 'center', align: 'center' },
    { text: 'Ship Date', datafield: 'date', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'd' },
    { text: 'Quantity', datafield: 'quantity', width: 70, align: 'right', cellsalign: 'right' },
    { text: 'Price', datafield: 'price', width: 65, cellsalign: 'right', align: 'right', cellsformat: 'c2' }
    ]
    });
    $("#excelExport").jqxButton({ theme: theme });
    $("#xmlExport").jqxButton({ theme: theme });
    $("#csvExport").jqxButton({ theme: theme });
    $("#tsvExport").jqxButton({ theme: theme });
    $("#htmlExport").jqxButton({ theme: theme });
    $("#jsonExport").jqxButton({ theme: theme });
    $("#excelExport").click(function () {
    $("#jqxgrid").jqxGrid('exportdata', 'xls', 'jqxGrid');
    });
    $("#xmlExport").click(function () {
    $("#jqxgrid").jqxGrid('exportdata', 'xml', 'jqxGrid');
    });
    $("#csvExport").click(function () {
    $("#jqxgrid").jqxGrid('exportdata', 'csv', 'jqxGrid');
    });
    $("#tsvExport").click(function () {
    $("#jqxgrid").jqxGrid('exportdata', 'tsv', 'jqxGrid');
    });
    $("#htmlExport").click(function () {
    $("#jqxgrid").jqxGrid('exportdata', 'html', 'jqxGrid');
    });
    $("#jsonExport").click(function () {
    $("#jqxgrid").jqxGrid('exportdata', 'json', 'jqxGrid');
    });
    });
    </script>
    </head>
    <body class='default'>
    <div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
    <div id="jqxgrid"></div>
    <div style='margin-top: 20px;'>
    <div style='float: left;'>
    <input type="button" value="Export to Excel" id='excelExport' />
    <br /><br />
    <input type="button" value="Export to XML" id='xmlExport' />
    </div>
    <div style='margin-left: 10px; float: left;'>
    <input type="button" value="Export to CSV" id='csvExport' />
    <br /><br />
    <input type="button" value="Export to TSV" id='tsvExport' />
    </div>
    <div style='margin-left: 10px; float: left;'>
    <input type="button" value="Export to HTML" id='htmlExport' />
    <br /><br />
    <input type="button" value="Export to JSON" id='jsonExport' />
    </div>
    </div>
    </div>
    </body>
    </html>

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Export into excel file from grid #7952

    Neelam
    Member

    Hi,

    Thanks but as I said in my previous post that export throws me to the save-file.php file for data more than 8 MB. So if I host this file on our server, it has no connection with export plugin.

    Regards,
    Neelam

    Export into excel file from grid #7958

    Neelam
    Member

    Hello,

    Please suggest me something what can I do for large data size to make export functionality working otherwise export is no more useful for us.

    Regards,
    Neelam

    Export into excel file from grid #7959

    Peter Stoev
    Keymaster

    Hi Neelam,

    You need to host the save-file.php on your server and use it in the export process by changing the default server in the jqxgrid.export.js. Navigate to the ‘exportToFile’ method call and add your URL as third param.

    exporter.exportToFile(datatype, filename, exportServerURL);

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 15 posts - 1 through 15 (of 25 total)

You must be logged in to reply to this topic.