Imports data from a SharePoint View to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved.

public static Area ImportData(this Area area, Microsoft.SharePoint.SPView view, Microsoft.SharePoint.SPList list, DataImportProperties props)
Public Shared Function ImportData(ByVal area As Area, ByVal view As Microsoft.SharePoint.SPView, ByVal list As Microsoft.SharePoint.SPList, ByVal props As DataImportProperties) As Area

The current Area object which is calling ImportData

SharePoint View to use as a data source for the template

SharePoint List associated with the SharePoint View

A DataImportProperties object that contains a set of properties that will determine the behavior of the data import.

An Area object representing the set of cells populated with the imported values.

This is an extension method for the Area object to be used for binding SharePoint data to spreadsheets from within SharePoint. To use this method, you must add a reference to SoftArtisans.OfficeWriter.ExcelWriter.SharePointIntegration.dll

          DataImportProperties importProps = wb.CreateDataImportProperties();
          importProps.Transpose = true;
          Area importedArea = a.ImportData(myView, myList, importProps);

          Dim importProps As DataImportProperties = wb.CreateDataImportProperties()
          importProps.Transpose = True
          Dim importedArea As Area = a.ImportData(myView, myList, importProps)