New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pdf export not working all data with large table #4757
Comments
i can't provide a plunker, but tutorial 401 doesn't work for me... http://ui-grid.info/docs/#/tutorial/401_AllFeatures tested in IE11, Chrome 46.0.2490.86 and Firefox 42 |
Hello guys, same issue here. When I have too many data the browser simply freaks out when exporting to pdf. Csv export works fine. |
This appears to be a duplicate of #2529 (and in turn bpampuch/pdfmake#275). I thought it started working with newer versions of chrome, but apparently it didn't. I am having the same problem now on the 401 tutorial. pdfMake is a great tool when it works. But we probably need to limit the amount of data we send to it. |
@AgDude is it possible to index the pdf generation to a pagination feature? like if we were in the page 3, when exporting it would export only page 3? i have another grid with 982*3 (rows x columns) and it would export to pdf... but when it's like 250 * 17 it crashes, so it would be related to the columns... but i'm just guessing |
I was just reading a but more on this, and found this issue and workaround: bpampuch/pdfmake#280 (comment) @tiagomsmagalhaes would you be able to try that workaround with pdfmake and let us know how that works here? I think an "export current page" option would be a nice feature, but I wouldn't replace the option to export all. We would welcome a pull request that implemented that. |
@AgDude hi... i tried that workaround to my 256*17 grid worked only in IE11... soon after that comment, the OP mentioned a |
@tiagomsmagalhaes You are looking in the pdfMake source, not uiGrid, right?. Have you tried with a new version of pdfMake? I am not sure what version is running on ui-grid.info. This is something that is on my radar, as I need it in my application as well. I am unlikely to have time in the next few weeks to look into it in detail. |
@AgDude Yes, I'm looking at the pdfMake source... I'm not sure if I'm running the most recent because i'm using without package systems.. i could try at home in the MEAN stack |
I would have thought that export visible data would give the same thing as export current page. |
@PaulL1 i confess that i haven't read the default behaviour of that option, but in this situation i'm using the grid with no pagination |
@tiagomsmagalhaes : I know the pdfMake team don't have very good IE support. Does it work in Chrome? |
@PaulL1 i mentioned above that the workaround link provided by @AgDude worked in IE11. i just couldn't figure out one little tweak where the user that created the workaround, because he didn't provide the Line of Code. I think the problem is residing in the columns, because i limited tutorial 401 to 500 rows and it didn't worked. But a colleague was able to generate a pdf with 900 rows and 3 columns, and i have to use one with 17 columns |
I have the same issue. I have a table with 13 cols and over 3300 rows, after 20 minute if have kill the tab. |
I've had this issue as well. Is there a way with ui-grid to change which pdf library is used for export? That way we could use a library other than pdfMake to create PDF exports instead of being held hostage by the limitations of that particular library. You can do this with ng-grid; it's just not a built-in function. |
@trentballew1 sure, you can roll your own export. You can start with the grid options from the gridApi, or if you want the docDefinition that gets sent to pdfMake, have a look at (uiGridExportService)[http://ui-grid.info/docs/#/api/ui.grid.exporter.service:uiGridExporterService]. It isn't exposed as part of the public API, but you can still inject it like any other service. |
@AgDude If there's a way to get the DocDefinition can you give us an example of how to do it? What would I do to fetch and possibly change the DocDefinition? |
There's a callback that gives you the full doc definition once created and allows you to modify it. Check the exporter gridoptions doco or the complex exporter tutorial. Sent from my iPhone On 27 Jan 2016, at 5:09 AM, James Bell <notifications@github.commailto:notifications@github.com> wrote: @AgDudehttps://github.com/AgDude If there's a way to get the DocDefinition can you give us an example of how to do it? What would I do to fetch and possibly change the DocDefinition? Reply to this email directly or view it on GitHubhttps://github.com//issues/4757#issuecomment-175094192. |
I implemented the same functionality, when it gets to Is there a way to set the rows to include all the data that came back and not limit to 100? |
Not sure if it's any help, but in my experimenting with this I found that chrome defaults to pdfMake.open to just open the pdf in another tab, whereas IE downloads it as a file. If I try to export a large table to pdf in chrome, it breaks. If I try in IE, it downloads fine. I modified the source to always do download instead of open in Chrome, and it worked fine. It would be good if there was a param on ui-grid to specify always download, instead of Opening... Looks like constructing the data url and throwing it to a new tab doesn't perform too well with large tables. |
@farnsy it seems to me that is the case. How did you modify the source to do download instead of opening in Chrome? |
It was a bit hacky at the time as I just wanted to see if it would fix the problem. In ui-grid.js, v3.1.1 at line 18230 is the pdfExport method. That first checks if the browser is IE or Edge, and if so it initiates a download, otherwise it opens (i.e. uses the dataurl method). I just modified this so it always did a download. |
@farnsy could you make a PR? |
Hello, this works for me app.controller('ExpenseGridCrtl', ['$scope','$http','uiGridExporterConstants', '$log', '$rootScope', 'ExpenseService', '$location', 'toastr',
}]) .filter('situationFilter', function() { |
first insert pdf libraries using this command after add pdf file path in your file like. <script src="node_modules/pdfmake/build/pdfmake.min.js"></script>
it is working for me.. Thank you.. |
Hi,
I'm running ui-grid 3.0.7 and the export pdf does nothing on a table that has around 250 results with 17 columns. If I select a few rows i get the pdf... but if I select export visible data or all data it does open a tab but with no action.
The text was updated successfully, but these errors were encountered: