This is a migrated thread and some comments may be shown as answers.

radgrid export to excel problem

8 Answers 239 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
brad
Top achievements
Rank 1
brad asked on 10 Sep 2008, 03:42 PM
Hello,
     my problem is as follows. we have several webpages, some of them hosting radgrids. above these grids that display data we have radtoolbars. in the toolbar, we created an Export to Excel Icon, that when clicked, Excel window should open and display the data format of the grid.

the results are awckard. when the button is clicked, the Grid itself goes into an Excel type format, it removes the checkedboundfields (as expected). but stays displayed on the page itself.

no new window opens. the grid doesn't stay in its current form (instead displays like an Excel form)  we have office 2007. Code using is as follows.

                    Gridview1.ExportSettings.ExportOnlyData = true;
                    Gridview1ExportSettings.OpenInNewWindow = true;
                    Gridview1.ExportSettings.FileName = "RulesExport";
                    Gridview1.MasterTableView.ExportToExcel();

when the Export to Excel button is clicked, the grid does not expand and fill the page, it stays in its current height and width. the columns change as it would if it were going to excel, but does not. no new window opens.

any suggestions to this?

8 Answers, 1 is accepted

Sort by
0
brad
Top achievements
Rank 1
answered on 10 Sep 2008, 03:46 PM
also, to add, i have updated my telerik controls in the recent patch released at the end of August.
0
Daniel
Telerik team
answered on 10 Sep 2008, 04:20 PM
Hello Brad,

Take a look at this blog and try to set the default behavior depending on your scenario.
Excel 2007 & Internet Explorer

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
brad
Top achievements
Rank 1
answered on 10 Sep 2008, 06:44 PM
i have looked at the file options and everything is set accordingly, im still achieving the same results.
0
Accepted
Daniel
Telerik team
answered on 11 Sep 2008, 05:42 AM
Hello Brad,

Could you please send us a simple working example via regular support ticket? Thus we will be able to give you more straight-to-the-point answer.

Greetings,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
brad
Top achievements
Rank 1
answered on 11 Sep 2008, 04:56 PM
Hi,

i figured out the problem. we had sections in the grid that grouped the rows preventing the export to excel to function properly
0
Paul J
Top achievements
Rank 1
answered on 20 Apr 2009, 01:04 PM
We're having a similar problem in that when calling the export function, it changes the grid itself into looking like the exported contents for the excel export, however, it never asks the user to save an excel file, nor ever actually opens excel. we're using the following code:

  SearchGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None
        SearchGrid.MasterTableView.ShowFooter = False
        SearchGrid.MasterTableView.ClearEditItems()
        SearchGrid.MasterTableView.ClearSelectedItems()
        SearchGrid.MasterTableView.AllowPaging = False
        SearchGrid.Rebind()
        SearchGrid.ExportSettings.OpenInNewWindow = True
        SearchGrid.ExportSettings.ExportOnlyData = True
        SearchGrid.MasterTableView.HierarchyDefaultExpanded = False
        SearchGrid.MasterTableView.ExportToExcel()

the grid does have a details table. we're using controls version 2008.3.1314.20
as far as brad's resolution, i'm not quite sure what he meant by sections grouping rows together. as far as I can tell, our grid does not do that...
0
Paul J
Top achievements
Rank 1
answered on 20 Apr 2009, 03:52 PM
Nevermind. I believe the problem is due to the fact that the grid is wrapped within an asp.net update panel via the masterpage.
0
Daniel
Telerik team
answered on 20 Apr 2009, 07:40 PM
Hello Paul,

I recommend you examine the following links:
Export from ajaxified grid
Exclude controls from ajaxifying

Let us know if you need more information.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
brad
Top achievements
Rank 1
Answers by
brad
Top achievements
Rank 1
Daniel
Telerik team
Paul J
Top achievements
Rank 1
Share this question
or