esvit / ng-table-export Goto Github PK
View Code? Open in Web Editor NEWExport data from ngTable to CSV
License: BSD 3-Clause "New" or "Revised" License
Export data from ngTable to CSV
License: BSD 3-Clause "New" or "Revised" License
Hi,
I tried to export to a csv file using the ng table export. I need the hebrew letters but till didn't get a hebrew letter.
Can you help me with that?
Thanks
Hi, I'm using this code and when I open the file with the default CSV handler, which like in several other machines happens to be Excel, I get garbage characters instead of my Unicode characters. Yet, the CSV is built correctly and I can see it if I save it before opening. This is a known issue for Excel, and the workaround is prepending the CSV with the BOM code, by changing your code at line #20 to data = '\uFEFF'; instead of just data='';. This way, any modern version of Excel (probably above 2003) opens the file correctly. Maybe you could consider integrating this change into your code.
Thank you!
I'm using ng-table 0.3.1 with ng-table-export master branch. When I export to csv I only get the results of the page and count that has been selected. I would like to download the full result set, not just the current page that is being displayed.
Ideally could the export trigger the ngTableParams.getData function with a parameter indicating it's a csv export. I could then choose to paginate or not.
When exporting a CSV, the plugin ignores filters applied to table.
Plugin code contains the following:
if (tr.hasClass("ng-table-filters")) {
return;
}
...but this doesn't seem to have any effect. Would greatly appreciate a solution.
When opening the file with Excel on a Mac, it works just fine, but on a PC, Excel expects the separator to be a comma, not a semicolon.
An easy fix is to change a line in the code such as to insert 'sep=;' at the very top of the file. Then it works fine both on Excel Mac and Windows.
generate: function() {
data = 'sep=;' + "\n";
it would be great if export can works with some additional features
for example export only checked items
I`ll try to add it, but maybe you can say me where is do it better?
...
5 min later :)
we can pass some argumets to generate()
ng-mousedown="csv.csv.generate({
quotes: '"',
delimeter: ';',
headers: true,
data: 'all' | 'filter' | 'check'
})"
as I understand this code - to skip headers?
https://github.com/esvit/ng-table-export/blob/master/src/scripts/00-directive.js#L26
...
if (tr.hasClass('ng-table-filters')) {
return;
}
...
PS
nice addon for ng-table, let`s do it together better
Has anyone been able to get the export to work in Internet Exploder (v11)?
It is occuring on this line:
a(d.exportCsv).assign(b.$parent, f)
When i tried to download a csv file, it download a file with extension(file name as download).
hi, i need full/filtered dataset of ng-table (with pagination),
so that i can use it to export file as pdf. please provide a sample how i can make table without pagination and hit css2pdf@cloudformatter service and get pdf and again set the table with pagination
update the link please.
I use ngTable 0.3.2 and ngTableExport 0.1.0 installed using bower, when click export the output also include pagination in CSV file
10 25 50 100 « 1 2 »
where is my mistake?
<>
<td data-title="'Group Name'" filter="{ 'name': 'text' }" sortable="'name'">{{item.name}}</td>
<td data-title="'Group Email'">{{item.email}}</td>
</tr>
</tbody>
</table>
<>
$scope.tableParams = new ngTableParams({
page: 1, // show first page
count: 10, // count per page
filter: {
name: '' // initial filter
}
}, {
total: objects.bookings.length, // length of objects.bookings
getData: function($defer, params) {
// use build-in angular filter
var filteredData = params.filter() ?
$filter('filter')(objects.bookings, params.filter()) :
objects.bookings;
var orderedData = params.sorting() ?
$filter('orderBy')(filteredData, params.orderBy()) :
objects.bookings;
params.total(orderedData.length); // set total for recalc pagination
$defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
}
});
The demo site is not working.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.