
Microsoft Office Excel을 사용하면 텍스트 데이터를 스프레드시트나 워크북 형식으로 레이아웃할 수 있습니다. 다양한 파일과 위치에서 정보와 데이터를 단일 대상으로 가져와 단일 파일에서 압축하고 분석할 수 있습니다. Excel 워크시트에서 다양한 색상 음영, 굵게, 기울임꼴을 정의하여 중요한 데이터를 강조 표시할 수 있습니다. 빠른 분석을 위해 적절한 색상 구성표를 선택할 수 있습니다. Excel 파일의 일반적인 용도는 다음과 같습니다.
- 데이터 입력 및 저장
- 사업 데이터 수집 및 검증
- 행정 및 관리 업무
- 회계 및 예산
- 데이터 분석
- 보고 + 시각화
- 예측
조건부 서식
조건부 서식은 많은 스프레드시트 애플리케이션의 기능입니다. 특정 기준을 충족하는 셀에 특정 서식을 적용할 수 있습니다. 스프레드시트에 저장된 데이터와 정보를 강조하거나 강조하거나 구별하기 위해 색상 기반 서식으로 가장 많이 사용됩니다. 조건이 거짓이면 셀 범위가 서식 지정되지 않습니다. 예를 들어, 천 미만의 숫자는 빨간색으로, 천 이상의 숫자는 파란색으로 지정할 수 있습니다.
아래에는 사용 가능한 인기 있는 조건부 서식 시각화가 나와 있습니다.
- 배경색 음영(셀)
- 전경색 음영(글꼴)
- 데이터 막대
- 아이콘(4가지 다른 이미지 유형이 있음)
- 가치
아래 지정된 주제는 더 자세히 설명되어 있습니다.
워크시트의 조건부 서식 가져오기
Aspose.Cells Cloud는 Excel 워크시트에서 조건부 서식 정보를 읽는 기능을 제공합니다. API의 GetWorksheetConditionalFormattings 메서드를 사용하면 Excel 워크시트에서 서식 세부 정보를 읽을 수 있습니다. 첫 번째 단계는 개인화된 클라이언트 ID와 클라이언트 비밀을 기반으로 JWT 토큰을 생성하는 것입니다. 자세한 내용은 클라이언트 ID와 클라이언트 비밀 키를 사용하여 JWT 토큰을 얻는 방법을 참조하세요.
cURL 명령은 아래에 표시되어 있으며, 이를 통해 Excel 워크시트에서 서식 세부 정보를 읽는 데 도움이 됩니다.
curl -X GET "https://api.aspose.cloud/v3.0/cells/conditional.xlsx/worksheets/Sheet1/conditionalFormattings" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>"
C# .NET
// 전체 예제와 데이터 파일은 https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/에서 확인하세요.
CellsApi instance = new CellsApi(clientId, clientSecret, apiVersion, testbaseurl);
string name = BOOK1;
string sheetName = SHEET1;
string folder = TEMPFOLDER;
instance.UploadFile(folder + @"\" + name, File.Open( @"C:\TestData\" +name));
var response = instance.CellsConditionalFormattingsGetWorksheetConditionalFormattings(name, sheetName, folder);
Assert.IsInstanceOf<ConditionalFormattingsResponse>(response, "response is ConditionalFormattingsResponse");
Assert.AreEqual(response.Code, 200);
조건부 서식 추가
Microsoft Excel은 조건부 서식, 데이터 막대, 색상 눈금 및 아이콘 집합에 대한 세 가지 사전 설정을 제공하며 Aspose.Cells Cloud API는 이러한 모든 유형을 지원합니다. 유형, 연산자, 스타일, 셀 영역 등을 포함하여 조건의 다양한 매개변수를 지정합니다.
cURL 명령
curl -X PUT "https://api.aspose.cloud/v3.0/cells/conditional.xlsx/worksheets/Sheet1/conditionalFormattings?cellArea=C4%3AC6" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>" \
-H "Content-Type: application/json" \
-d "{ \"link\": { \"Href\": \"string\", \"Rel\": \"string\", \"Title\": \"string\", \"Type\": \"string\" }, \"Priority\": 2, \"Type\": \"CellValue\", \"StopIfTrue\": true, \"AboveAverage\": { \"IsAboveAverage\": true, \"IsEqualAverage\": true, \"StdDev\": 0 }, \"ColorScale\": { \"MaxCfvo\": { \"IsGTE\": true, \"Type\": \"string\" }, \"MaxColor\": { \"A\": 100, \"R\": 200, \"G\": 200, \"B\": 0 }, \"MidCfvo\": { \"IsGTE\": true, \"Type\": \"string\" }, \"MidColor\": { \"A\": 0, \"R\": 0, \"G\": 0, \"B\": 0 }, \"MinCfvo\": { \"IsGTE\": true, \"Type\": \"string\" }, \"MinColor\": { \"A\": 0, \"R\": 0, \"G\": 0, \"B\": 0 } }, \"DataBar\": { \"AxisColor\": { \"A\": 0, \"R\": 0, \"G\": 0, \"B\": 0 }, \"AxisPosition\": \"string\", \"BarBorder\": { \"Color\": { \"A\": 0, \"R\": 0, \"G\": 0, \"B\": 0 }, \"Type\": \"string\" }, \"BarFillType\": \"string\", \"Color\": { \"A\": 0, \"R\": 0, \"G\": 0, \"B\": 0 }, \"Direction\": \"string\", \"MaxCfvo\": { \"IsGTE\": true, \"Type\": \"string\" }, \"MaxLength\": 0, \"MinCfvo\": { \"IsGTE\": true, \"Type\": \"string\" }, \"MinLength\": 0, \"NegativeBarFormat\": { \"BorderColor\": { \"A\": 0, \"R\": 0, \"G\": 0, \"B\": 0 }, \"BorderColorType\": \"string\", \"Color\": { \"A\": 0, \"R\": 0, \"G\": 0, \"B\": 0 }, \"ColorType\": \"string\" }, \"ShowValue\": true }, \"Formula1\": \"string\", \"Formula2\": \"string\", \"IconSet\": { \"CfIcons\": [ { \"ImageData\": \"string\", \"Index\": 0, \"Type\": \"string\" } ], \"Cfvos\": [ { \"IsGTE\": true, \"Type\": \"string\" } ], \"IsCustom\": true, \"Reverse\": true, \"ShowValue\": true, \"IconSetType\": \"string\" }, \"Operator\": \"string\", \"Style\": { \"link\": { \"Href\": \"string\", \"Rel\": \"string\", \"Title\": \"string\", \"Type\": \"string\" }, \"Font\": { \"Color\": { \"A\": 0, \"R\": 0, \"G\": 0, \"B\": 0 }, \"DoubleSize\": 0, \"IsBold\": true, \"IsItalic\": true, \"IsStrikeout\": true, \"IsSubscript\": true, \"IsSuperscript\": true, \"Name\": \"string\", \"Size\": 0, \"Underline\": \"string\" }, \"Name\": \"string\", \"CultureCustom\": \"string\", \"Custom\": \"string\", \"BackgroundColor\": { \"A\": 220, \"R\": 10, \"G\": 120, \"B\": 0 }, \"ForegroundColor\": { \"A\": 0, \"R\": 0, \"G\": 0, \"B\": 0 }, \"IsFormulaHidden\": true, \"IsDateTime\": true, \"IsTextWrapped\": true, \"IsGradient\": true, \"IsLocked\": true, \"IsPercent\": true, \"ShrinkToFit\": true, \"IndentLevel\": 0, \"Number\": 0, \"RotationAngle\": 0, \"Pattern\": \"None\", \"TextDirection\": \"Context\", \"VerticalAlignment\": \"Center\", \"HorizontalAlignment\": \"General\", \"BorderCollection\": [ { \"LineStyle\": \"string\", \"Color\": { \"A\": 120, \"R\": 0, \"G\": 0, \"B\": 0 }, \"BorderType\": \"BottomBorder\", \"ThemeColor\": { \"ColorType\": \"string\", \"Tint\": 0 }, \"ArgbColor\": -16777216 } ], \"BackgroundThemeColor\": { \"ColorType\": \"string\", \"Tint\": 0 }, \"ForegroundThemeColor\": { \"ColorType\": \"string\", \"Tint\": 0 } }, \"Text\": \"string\", \"TimePeriod\": \"string\", \"Top10\": { \"IsBottom\": true, \"IsPercent\": true, \"Rank\": 0 }}"
아래 C# 코드 조각은 Excel 워크시트에 조건부 서식을 추가합니다.
C# .NET
// https://dashboard.aspose.cloud/에서 AppKey와 AppSID를 가져옵니다.
// Nuget 패키지 Aspose.Cells-Cloud 설치
// 전체 예제와 데이터 파일은 https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet에서 확인하세요.
CellsApi cellsApi = new CellsApi(AppKey, AppSid);
string name = "BOOK1.xlsx";
string sheetName = "SHEET1";
string cellArea = "A1:C10";
FormatCondition formatcondition = new FormatCondition();
formatcondition.Type = "CellValue";
formatcondition.Operator = "Between";
formatcondition.Formula1 = "10";
formatcondition.Formula2 = "20";
var color = new Color();
color.A = 1;
color.R = 132;
color.G = 157;
color.B = 204;
Style style = new Style();
style.BackgroundColor = color;
formatcondition.Style = style;
string folder = "TEMPFOLDER";
var response = cellsApi.CellsConditionalFormattingsPutWorksheetConditionalFormatting(name, sheetName, cellArea, formatcondition, folder);
모든 조건부 서식 지우기
Aspose.Cells Cloud를 사용하면 조건부 서식의 서식을 지울 수 있습니다. DeleteWorksheetConditionalFormattings 메서드는 Excel 스프레드시트에서 조건부 서식을 지울 수 있는 레버리지를 제공합니다. 아래에 제공된 cURL 명령을 사용하여 이 요구 사항을 달성할 수 있습니다.
cURL 명령
curl -X DELETE "https://api.aspose.cloud/v3.0/cells/conditional.xlsx/worksheets/Sheet1/conditionalFormattings" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>"
C# .NET
// 전체 예제와 데이터 파일은 https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/에서 확인하세요.
CellsApi instance = new CellsApi(clientId, clientSecret, apiVersion, testbaseurl);
string name = BOOK1;
string sheetName = SHEET1;
string folder = TEMPFOLDER;
instance.UploadFile(folder + @"\" + name, File.Open( @"C:\TestData\" +name));
var response = instance.CellsConditionalFormattingsDeleteWorksheetConditionalFormattings(name, sheetName, folder);
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
Assert.AreEqual(response.Code, 200);
위의 방법은 모든 조건부 서식을 제거하고 특정 서식을 제거하려면 DeleteWorksheetConditionalFormatting 방법을 사용해 보세요. 이 방법은 Excel 스프레드시트의 서식 조건에 대한 인덱스 번호를 허용합니다.
아래 명령은 인덱스 1(인덱스 값은 0부터 시작)의 조건부 서식을 제거합니다.
cURL 명령
curl -X DELETE "https://api.aspose.cloud/v3.0/cells/conditional.xlsx/worksheets/Sheet1/conditionalFormattings/1" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>"

이미지 1: Excel 워크시트에서 서식이 제거되었습니다.
특정 영역의 조건부 서식 제거
특정 영역에서 조건부 서식을 제거해야 하는 경우 DeleteWorksheetConditionalFormattingArea 메서드를 사용하세요. 요구 사항을 충족하려면 startRow, startColumn, totalRows 및 totalColumns 정보를 지정해야 합니다. 행 및 열 인덱스는 0부터 시작한다는 점에 유의하세요.
cURL 명령
curl -X DELETE "https://api.aspose.cloud/v3.0/cells/conditional.xlsx/worksheets/Sheet1/conditionalFormattings/area?startRow=4&startColumn=1&totalRows=3&totalColumns=1" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>"
결론
Aspose.Cells Cloud API는 놀라운 제품이며 MS Excel 및 OpenOffice 시트 파일을 다른 지원 형식으로 생성, 조작 및 변환하는 기능을 제공합니다. 제품 설치가 필요하지 않습니다.
자세한 내용은 Aspose.Cells Cloud 홈페이지를 방문하세요. 프로그래밍 언어별 SDK 설치 및 구성에 대한 정보는 Aspose.Cloud SDK 설치 방법을 방문하세요.