We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Sheet Name

Thread ID:

Created:

Updated:

Platform:

Replies:

124644 Jun 20,2016 10:09 AM Jun 27,2016 12:34 AM LightSwitch Silverlight 3
loading
Tags: XlsIO
Osvaldo Djivelekian
Asked On June 20, 2016 10:09 AM

Hi, everybody.

I am trying to customize an application for export data to Excel.

One of the customizations I need to do is to change the default sheet name "Sheet1" to another name, using the following sentence:

     exportSettings.SheetName = "TestExport"

But when Lightswitch tries to execute the export, i get an error message indicating that this sheet does not exists.

Also, I've tried to create the sheet using 

     exportSettings.Worksheet.Application.Worksheets.Create("TestExport")

and remove the default sheet using

     exportSettings.Worksheet.Application.Worksheets.Remove("Sheet1")

without success.

Please, I need help on this matter.

And I´ll be glad if you post some documentation on exportSettings.Worksheet functionality.

Thank you
Osvaldo


Kesavan D [Syncfusion]
Replied On June 21, 2016 08:04 AM

Hi Osvaldo, 

Thank you for contacting Syncfusion support. 

Please find the detailed response for your queries. 
I need to do is to change the default sheet name "Sheet1" to another name, using the following sentence: 
 
     exportSettings.SheetName = "TestExport" 

SheetName property is similar to ActiveSheet(i.e) only existing sheet name can be assigned to “ExcelExportOptions.SheetName”. 

You can rename the worksheet by using the following code snippet 
 
exportSettings.Worksheet.Application.Worksheets["Sheet1"].Name = "TestExport"; 


We have created sample to illustrate the above code snippet which is available for download in the following link. 


Please try this sample and let us know if your requirement is fulfilled. 


I've tried to create the sheet using  
 
     exportSettings.Worksheet.Application.Worksheets.Create("TestExport") 
 
and remove the default sheet using 
 
     exportSettings.Worksheet.Application.Worksheets.Remove("Sheet1") 
 
without success. 

We are unable to reproduce this issue in our end. The expected behavior of adding a new sheet and removing existing is working fine. If you still face this issue, we request you to share the issue reproducing sample which will be helpful for us to provide you a solution to you at the earliest.  
 I´ll be glad if you post some documentation on exportSettings.Worksheet functionality. 
ExcelExportOptions is a custom helper class used for exporting in our BookStoreApplication. Currently, we don’t have a documentation for the custom classes. You can make of these class in your project and let us know if you need any clarification in it. 


Regards, 
Kesavan 


Osvaldo Djivelekian
Replied On June 26, 2016 10:37 PM

Hi Kesavan

Thank you for your response.

I have tested both options and now are working fine.

Thank you very much for your help.

Regards,
Osvaldo



Kesavan D [Syncfusion]
Replied On June 27, 2016 12:34 AM

Hi Osvaldo, 

We are glad to know that your requirement is fulfilled. 

Please let us know if you need any further assistance on this. 

Regards, 
Kesavan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;