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

Data Export - not opening excel application automatically

3 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Milan Gurung
Top achievements
Rank 1
Milan Gurung asked on 03 Feb 2009, 11:34 AM

Hi,

I have a RadGrid which exports data successfully in both Excel and .CSV file. The odd behaviour I am noticing is that when the page is run in intranet, IE prompts to either open/save the exported file. If I click on open, Excel application automatically opens it.

The same application when deployed in internet behaves differently. Exported data from grid is not opened automatically by excel instead prompts "OPEN WITH" different list of applications to choose from. File type is not recognized and original file name should be "PO_Media_Report_Excel.xls" rather it shows PO_Media_Report [1] or something like that.... :(
Could you please let me know why is it happening?

Codesnippet as below:

 

gridPOMedia.ExportSettings.ExportOnlyData =

True

 

 

gridPOMedia.ExportSettings.IgnorePaging = True

 

 

gridPOMedia.ExportSettings.OpenInNewWindow = True

 

 

gridPOMedia.ExportSettings.FileName = "PO_Media_Report_Excel" + Now.Date

 

gridPOMedia.MasterTableView.ExportToExcel()



On the same note, why the .pdf export looks so horrible. If you have say around 10-15 columns in the grid, column data are overlapping.

Many thanks for suggestion.

Milan G

3 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetoslav
Telerik team
answered on 05 Feb 2009, 01:07 PM

Hi Milan,

Try removing the Now.Date from your FileName assignment statement and see if the file opens correctly.

As for the pdf export, you have to set the width of the pdf page beforehand and wide enough to accomodate all the columns of the RadGrid.

Greetings,

Tsvetoslav
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Milan Gurung
Top achievements
Rank 1
answered on 07 Feb 2009, 11:01 AM
Thanks. It seems to be working. Just wondering it is a issue with RadGrid or the IE?

Cheers,
Milan
0
Tsvetoslav
Telerik team
answered on 09 Feb 2009, 05:58 PM
Hello Milan,

I believe the reason is that the browser gets confused by the special characters (such as slashes or dots) that the date substring adds to the file name.

Kind regards,
Tsvetoslav
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Milan Gurung
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Milan Gurung
Top achievements
Rank 1
Share this question
or