jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Export using local server example
Tagged: export, Exporting using a local server, grid, jqxGrid ;, local server
This topic contains 15 replies, has 6 voices, and was last updated by Peter Stoev 6 years, 7 months ago.
-
Author
-
Is there an example exporting using a local server? I would appreciate some help with this…
Thanks…
Hello DavidSimmons,
To be able to export using a local server, you would have to host the file save-file.php on your server and specify the url to the file as the last parameter to the exportdata method. Here is more on the method from the jqxGrid API Documentation:
Exports all rows loaded within the Grid to Excel, XML, CSV, TSV, HTML, PDF or JSON.
The first parameter of the export method determines the export’s type – ‘xls’, ‘xml’, ‘html’, ‘json’, ‘tsv’ or ‘csv’.
The second parameter is the file’s name. If you don’t provide a file name, the Grid will export the data to a local variable.
For example:
var data = $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘json’);The third parameter is optional and determines whether to export the column’s header or not. Acceptable values are – true and false. By default, the exporter exports the columns header.
The fourth parameter is optional and determines the array of rows to be exported. By default all rows are exported. Set null, if you want all rows to be exported.
The fifth parameter is optional and determines whether to export hidden columns. Acceptable values are – true and false. By default, the exporter does not export the hidden columns.
The last parameter is optional and determines the url of the export server. By default, the exporter is hosted on a jQWidgets server.Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/I seem to having an issue with the fourth parameter. When you say Set null for all rows, do you mean ”?
The fourth parameter is optional and determines the array of rows to be exported. By default all rows are exported. Set null, if you want all rows to be exported.
$(jqxgrid).jqxGrid(‘exportdata’, ‘csv’, ‘jqxgrid’, true, ” ,true,’http://192.168.1.10′);
try this
$(jqxgrid).jqxGrid(‘exportdata’, ‘csv’, ‘jqxgrid’, true,null ,true,’http://192.168.1.10:8242′);
Marco
Marco thanks, but does not work. If you leave anything out it goes to the JQWidgets server.
By the documentation I can’t tell if null is something like this (Which goes to the JQWidgets server and gives me column headings)
$(jqxgrid).jqxGrid(‘exportdata’, ‘csv’, jqxgrid, true, true, ‘http://192.168.1.10’);Things I have tried…
$(jqxgrid).jqxGrid(‘exportdata’, ‘csv’, jqxgrid, true, ”, true, ‘http://192.168.1.10’);$(jqxgrid).jqxGrid(‘exportdata’, ‘csv’, jqxgrid, true, “”, true, ‘http://192.168.1.10’);
$(jqxgrid).jqxGrid(‘exportdata’, ‘csv’, jqxgrid, true, true, ‘http://192.168.1.10’);
$(jqxgrid).jqxGrid(‘exportdata’, ‘csv’, jqxgrid, true, null, true, ‘http://192.168.1.10’);
Seems like an example in the document page would help define what they mean as null…
I know I don’t want my data going to their site….
Hi guys,
By null, we mean null, not “”. In addition, the URL parameter should point to the save-file.php hosted on your server.
Regards,
Peter StoevCan you please help me understand what I am doing wrong. I need all records exported to csv.
$(jqxgrid).jqxGrid(‘exportdata’, ‘csv’, ‘Application’, true, ,true, ‘http://192.168.1.10/jqw/save-file.php’);
try this: $(jqxgrid).jqxGrid(‘exportdata’,’csv’,’Application’, true, null, true, ‘/jqw/safe-file.php’);
Don’t forget the null, “true,null,true” not “true,,true”
I am doing local development. Several questions
Is the last paramter ie, url mandatory?
Where is the actual export done?
Is it on client or on server?
If server, which server? Is it jqwidget’s server?My local dev env server is based on google appengine java. Therefore, I cannot provide a php file.
Hi rajesh.gupta,
The url is mandatory if you wish the export to happen to your server and you own a license with the dataexport.php file included in it i.e Developer or Team license. If you omit the url param, the export will be for evaluation purposes only going through our server with data export limitations.
Best Regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.comWhat is the equivalent of dataexport.php in java/servlet.
Please give more steps: Is the export happening on the client side? Is export happening on the server side? If on server side, what jar file needs to be included?
We also tried omitting the url on local server dev, nothing happens.
Hi rajesh.gupta,
For Java, you can still use a PHP file for export. The export happens both client and server side. You cannot omit the URL param.
Best Regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.comWe are running a java local server (java appengine). Please explain the steps. we are confused.
Please point to a document.We tried the following on the java local server
– we omitted the url. it does not work.Where should we include the php file on the java local server?
Thanks.
Hi Rajesh,
The data export uses a PHP file called dataexport.php. The URL param should point to the file’s location on your server. Like https://www.myserver.com/export/dataexport.php.
Regards,
PeterWe owned a license with the ‘dataexport.php’ file included in it and we put it on web app folder(server) as you said above.
We included the URL parameter in export data method which points to the file ‘dataexport.php’ location on server.
– But we are still getting same error.* We are running java local server.
What might be the problem?
Can you please help me out with this issue?
Thanks.
-
AuthorPosts
You must be logged in to reply to this topic.