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.
Syncfusion Feedback

Remove Columns from Excel Export

Thread ID:

Created:

Updated:

Platform:

Replies:

120760 Oct 13,2015 05:45 AM UTC Oct 14,2015 10:07 AM UTC LightSwitch Silverlight 1
loading
Tags: XlsIO
Michael Gotfredsen
Asked On October 13, 2015 05:45 AM UTC

Hi,
I'm trying to remove columns from the excel import using exportsettings.Mappings.Remove or RemoveAt, but it seems to be ignoring the command. I can add mappings without issue.

Is there any documentation on this?

Thanks
Michael 

Dilli Babu Nandha Gopal [Syncfusion]
Replied On October 14, 2015 10:07 AM UTC

Hi Michael,

Thank you for contacting Syncfusion support.

We are unable to reproduce the reported issue from our side. You can remove the column in the grid while exporting to excel by using Remove() or RemoveAt() methods of Mapping property in ExcelExportOptions, which is illustrated in below code example.

Code example:

ExcelExportOptions exportSettings = new ExcelExportOptions();

exportSettings.Row = 3;

exportSettings.Column = 2;

exportSettings.Mappings = columnMappings;

// Removes the Column Mapping in the collection

exportSettings.Mappings.Remove(exportSettings.Mappings[2]);

// Removes the Column Mapping at specified index in the collection

exportSettings.Mappings.RemoveAt(2);

using (stream)

{

    ExcelBuilder.Export(this.Books, exportSettings, stream);
}


We have shared the sample for your reference which can be downloaded from following link.
Sample link: http://www.syncfusion.com/downloads/support/forum/120760/ze/BookStoreApplication_20131039436365.zip

Kindly try this sample and let us know whether the issue is resolved. If issue exists then please share us the issue reproducing sample to provide the prompt solution at the earliest.

Regards,
Dilli babu.


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.

Warning Icon 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.Close Icon

;