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. Image for the cookie policy date

Leave out the first row for headines and fill the rest of the excel with a given List<object> ?

Hi

how to leave out the first row for headines and fill the rest of the excel with a given List<object> by using c# ?

3 Replies

AV Abirami Varadharajan Syncfusion Team April 7, 2016 10:03 AM UTC

Hi Testname,

Thank you contacting Syncfusion support.

You can specify first row of excel while importing the list object in ImportData method. Kindly refer below code example to achieve this.

Code Example:


            IList<Customer> customers = this.GetCustomerAsObjects();

            //ImportData(IEnumerable arrObject, int firstRow, int firstColumn, bool includeHeader)
            sheet.ImportData(customers, 5, 1, false);


We have also shared the sample for importing the list object to excel which can be downloaded from the following link. Kindly refer and let us know if it helps.

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/BusinessObject2029168686.zip

To know more about importing data in XlsIO, kindly refer the following UG documentation link.

UG Documentation link: http://help.syncfusion.com/file-formats/xlsio/working-with-data#import-data-from-business-objects

Regards,
Abirami.


TE Testname April 7, 2016 10:21 AM UTC

what if i have anested string array


AV Abirami Varadharajan Syncfusion Team April 8, 2016 09:33 AM UTC

Hi Testname,

Thank you for updating us.

Currently, there is no direct method to importing nested array in XlsIO. As a workaround, we have created a custom method ImportNestedArray for importing a nested array to a worksheet. Kindly refer the sample which can be downloaded from the following link and let us know if it helps.

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/ImportNestedArray-1459708549.zip

Please let us know if you have any concerns.

Regards,
Abirami.

Loader.
Up arrow icon