private static SheetData GenerateSheetdataForDetails(TestModelList data)
        {
            SheetData sheetData1 = new SheetData();

            sheetData1.Append(CreateHeaderRowForExcel());
            foreach (TestModel testmodel in data.testData)
            {
                Row partsRows = GenerateRowForChildPartDetail(testmodel);
                sheetData1.Append(partsRows);
            }
            return(sheetData1);
        }
        public static void CreatePartsForExcel(SpreadsheetDocument document, TestModelList data)
        {
            SheetData    sheetData = GenerateSheetdataForDetails(data);
            WorkbookPart wrkBookP1 = document.AddWorkbookPart();

            GenerateWorkbookPartContent(wrkBookP1);
            WorkbookStylesPart wrkBookStylesP1 = wrkBookP1.AddNewPart <WorkbookStylesPart>("rId3");

            GenerateWorkbookStylesPartContent(wrkBookStylesP1);
            WorksheetPart wrkSheetP1 = wrkBookP1.AddNewPart <WorksheetPart>("rId1");

            GenerateWorksheetPartContent(wrkSheetP1, sheetData);
        }