public void GetMultipleCellValuesList() { //Get input properties FileProperty excelFile = GetFileProperty(Constants.SOProperties.ExcelDocumentServices.ExcelFile, true); string worksheetName = GetStringProperty(Constants.SOProperties.ExcelDocumentServices.WorksheetName, true); string multipleCellCoordinates = GetStringProperty(Constants.SOProperties.ExcelDocumentServices.MultipleCellCoordinates, true); ServiceObject serviceObject = ServiceBroker.Service.ServiceObjects[0]; serviceObject.Properties.InitResultTable(); DataTable results = ServiceBroker.ServicePackage.ResultTable; string smoCellValues = ExcelServiceHelper.GetMultipleCellValueFromFile(excelFile, worksheetName, multipleCellCoordinates); string[] cellNames = multipleCellCoordinates.Split(';'); string[] cellValues = smoCellValues.Split(';'); for (int i = 0; i < cellNames.Length; i++) { DataRow dr = results.NewRow(); dr[Constants.SOProperties.ExcelDocumentServices.CellName] = cellNames[i]; dr[Constants.SOProperties.ExcelDocumentServices.CellValue] = cellValues[i]; results.Rows.Add(dr); } }
private void GetWorkSheetNames() { //Get input properties FileProperty excelFile = GetFileProperty(Constants.SOProperties.ExcelDocumentServices.ExcelFile, true); ServiceObject serviceObject = ServiceBroker.Service.ServiceObjects[0]; serviceObject.Properties.InitResultTable(); DataTable results = ServiceBroker.ServicePackage.ResultTable; string[] sheetNames = ExcelServiceHelper.GetSheetNamesFromFile(excelFile); foreach (string sheetName in sheetNames) { DataRow dr = results.NewRow(); dr[Constants.SOProperties.ExcelDocumentServices.WorksheetName] = sheetName; results.Rows.Add(dr); } }
private void GetMultipleCellValues() { //Get input properties FileProperty excelFile = GetFileProperty(Constants.SOProperties.ExcelDocumentServices.ExcelFile, true); string worksheetName = GetStringProperty(Constants.SOProperties.ExcelDocumentServices.WorksheetName, true); string multipleCellCoordinates = GetStringProperty(Constants.SOProperties.ExcelDocumentServices.MultipleCellCoordinates, true); ServiceObject serviceObject = ServiceBroker.Service.ServiceObjects[0]; serviceObject.Properties.InitResultTable(); DataTable results = ServiceBroker.ServicePackage.ResultTable; string smoCellValues = ExcelServiceHelper.GetMultipleCellValueFromFile(excelFile, worksheetName, multipleCellCoordinates); DataRow dr = results.NewRow(); dr[Constants.SOProperties.ExcelDocumentServices.MultipleCellValues] = smoCellValues; results.Rows.Add(dr); }
private void SaveCellValue() { //Get input properties FileProperty excelFile = GetFileProperty(Constants.SOProperties.ExcelDocumentServices.ExcelFile, true); string worksheetName = GetStringProperty(Constants.SOProperties.ExcelDocumentServices.WorksheetName, true); string cellCoordinates = GetStringProperty(Constants.SOProperties.ExcelDocumentServices.CellCoordinates, true); string cellValue = GetStringProperty(Constants.SOProperties.ExcelDocumentServices.CellValue, true); ServiceObject serviceObject = ServiceBroker.Service.ServiceObjects[0]; serviceObject.Properties.InitResultTable(); DataTable results = ServiceBroker.ServicePackage.ResultTable; excelFile = ExcelServiceHelper.SaveCellValueToFile(excelFile, worksheetName, cellCoordinates, cellValue); DataRow dr = results.NewRow(); dr[Constants.SOProperties.ExcelDocumentServices.UpdatedExcelFile] = excelFile.Value; results.Rows.Add(dr); }