Is there way to print the full data grid without adjusting the panes? I am html printing the data grid but I only get half of the grid when I print.
I am using the blazor version of the data grid.
I am getting the following error when I try to print using JavaScript. "Failed to execute CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0."
Is there a way to edit the canvas element?
Hello Luis,
I have been discussing the ability to print the FinancialChart individually from the rest of your application, and there’s nothing built-in to the FinancialChart that would allow you to do this, and I am not sure of a Blazor-specific way to do it from a .razor page at the moment either.
What you can do in this case though, is call into a JavaScript method from your .razor page, and then you would print the window. Here is a link on how to call into Javascript methods from your .razor page: https://docs.microsoft.com/en-us/aspnet/core/blazor/call-javascript-from-dotnet?view=aspnetcore-5.0.
Also, here is an article I found about using Javascript to print the contents of a window: https://www.geeksforgeeks.org/print-the-contents-of-a-div-element-using-javascript/.
The thing about this though, is that is not simple to just render existing HTML from your full application to an image, let alone a complex component like the FinancialChart, and so I would recommend in this case that you have a separate .razor page in your application that you print that only has the content to be printed on it. The problem with this is that the view of your application would likely need to change in order to do this printing, or perhaps you could have a link to another page in your application to open on a separate tab in the browser and print from there?
If you would like to see a way of printing the FinancialChart potentially implemented in the Ignite UI for Blazor toolset, I would recommend suggesting a new product idea for it at our Blazor Ideas Site, here. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.
Please let me know if you have any other questions or concerns on this matter.
What would you recommend for for printing the financial chart Individually, same scenario as the previous question above?
I have been investigating into the behavior you are seeing, and while I am a bit unsure of what you mean by “Html Printing” your data grid, I imagine that this likely has something to do with the DOM?
If I am correct in this case, I would recommend against doing this, because not all of the rows or cells of the grid are going to show up in the DOM. This is because they are virtualized by default. If they weren’t, you would see some serious performance issues when using larger data sources, as the entirety of the grid would need to be rendered and added to the DOM.
My best recommendation in this case to print the Ignite UI for Blazor would be to loop through your underlying bound data source of the grid and printing out the values that way.