Whenever I try to export a large amount of data, only a small portion of it is actually exported - 4 excel rows out of say 300.
Basically my SaveExport method is very similar to the one posted on the excel sample website.
I've also tried playing around with the group by sample given in one of the posts given here.
I got the same problem.
Could you please help me by giving me any ideas....
Thanks
Could you check if the first line of your Click event handler is call to SaveFileDialog.It's also important to call OpenFile right after that
For example:
SaveFileDialog dialog = new SaveFileDialog { Filter = "Excel files|*.xls", DefaultExt = "xls" };bool? showDialog = dialog.ShowDialog();
if (showDialog == true){
using (Stream exportStream = dialog.OpenFile()){
Thanks,George
I'm using MVVM, so my click is not on the button handler but rather on the command.
It works when I click once or twice.
My problem is that even when this works, my data is truncated when I put data into the excel file.
Try to call OpenFile as early as possible.
If it's not the case, please send some sample to look at.
I have found the problem for my issue.
The problem was I was running a loop on my datagrid directly, and this was causing datagrid virtualization to come into the picture, thus, making my columns appear empty.
I need to figure out a solution for this problem now.....