Beispiel #1
0
        private void CreatePartsForExcel(SpreadsheetDocument document, List <DeviceDeploymentStatus> data)
        {
            SheetData partSheetData = this.GenerateSheetdataForDetails(data);

            WorkbookPart workbookPart = document.AddWorkbookPart();

            this.GenerateWorkbookPartContent(workbookPart);

            WorkbookStylesPart workbookStylesPart = workbookPart.AddNewPart <WorkbookStylesPart>("rId3");

            OpenXMLHelper.GenerateWorkbookStylesPartContent(workbookStylesPart);

            WorksheetPart worksheetPart = workbookPart.AddNewPart <WorksheetPart>("rId1");

            OpenXMLHelper.GenerateWorksheetPartContent(worksheetPart, partSheetData);
        }
        private void CreatePartsForExcel(SpreadsheetDocument document, List <DeviceRegistryApiModel> data, List <ColumnMappingModel> columnMapping)
        {
            SheetData partSheetData = this.GenerateSheetdataForDetails(data, columnMapping);

            WorkbookPart workbookPart = document.AddWorkbookPart();

            this.GenerateWorkbookPartContent(workbookPart);

            WorkbookStylesPart workbookStylesPart = workbookPart.AddNewPart <WorkbookStylesPart>("rId3");

            OpenXMLHelper.GenerateWorkbookStylesPartContent(workbookStylesPart);

            WorksheetPart worksheetPart = workbookPart.AddNewPart <WorksheetPart>("rId1");

            OpenXMLHelper.GenerateWorksheetPartContent(worksheetPart, partSheetData);
        }