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

Export to Excel with logo

3 Answers 266 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prathibarani
Top achievements
Rank 1
Prathibarani asked on 26 Apr 2013, 08:04 PM

Hi,

My requirement is to export RadGrid data to excel when user clicks on button outside RadGrid.

The following are the customizations that are needed:

1) Save or Open dialogue box should show up for opening or saving excel file.
2) Add company logo to excel file at certain position. Like row1 column1 to row5 column5. Logo size (gif format) is
      always going to be same. Currently we are doing it by accessing worksheet and adding it.
3) we should be able to specify from where data should start showing up like row7..
4) We are hiding some columns in the grid. When exported, these shouldn't be exported.
5) Some rows in the grid are disabled. User can't click them. They shouldn't be exported.
6) Add a title and format it.
7) Format print options like margin etc..

I appreciate your help. Please let me know if there are any links about how to take care of it.

Thanks,
Prathiba.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Apr 2013, 05:07 AM
Hi,

The only excel format where the images are embedded in the file is Biff Excel Format. I suggest that you check out the following help topic where you can find more information about the Biff export.

Thanks,
Princy.
0
Prathibarani
Top achievements
Rank 1
answered on 29 Apr 2013, 08:54 PM
Princy,

Thanks for the link. How ever that code didn't work for me. I did this way:

string

 

 

imageURL = Page.ResolveUrl("~/Images/") + "companylogo.jpg";

 

RadGrid1.ExportSettings.FileName = "Test XML";

 

Telerik.Web.UI.ExportInfrastructure.

 

Table table = e.ExportStructure.Tables[0];

 

xls.

 

Cell cmpCell = table.Cells["A1"];

 

table.InsertImage(cmpCell, imageURL);

table.ShiftRowsDown(1, 8);

I am not sure whether this is the right way to do.

This shows the company logo. Logo showing up as expected. But when we expand column (that shows up below logo) with data, then logo also stretches. We do not want that to happend. we want logo not to stretch but when column is resized, only it should affect data. We acheived this using other vendor product using twips. We are planning to switch to Telerik controls.

Please respond.
Thanks,
Prathiba

0
Kostadin
Telerik team
answered on 01 May 2013, 01:16 PM
Hi Prathibarani,

I already answered your support ticket, but I am afraid there is not a way to prevent the stretching of the image when column is resized.

Regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Prathibarani
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Prathibarani
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or