تحديث متعدد Cells ستايل يشير REST API إلى تعيين cells style
لخلية في ملف Excel.
رسيت API
Copy
POST http://api.aspose.cloud/v3.0/cells/{ name} /worksheets/{ sheetName} /cells/style
معلمات الطلب هي:
اسم المعلمة
يكتب
المسار/سلسلة الاستعلام/HTTPBody
وصف
اسم
خيط
طريق
اسم المصنف.
اسم الورقة
خيط
طريق
اسم ورقة العمل.
يتراوح
خيط
استفسار
النطاق.
أسلوب
جسم
مع إعدادات نمط التحديث.
مجلد
خيط
استفسار
مجلد المصنف.
اسم التخزين
خيط
استفسار
اسم التخزين.
المواصفات OpenAPI يحدد واجهة برمجة يمكن الوصول إليها بشكل عام ويتيح لك تنفيذ تفاعلات REST مباشرة من متصفح الويب.
يمكنك استخدام أداة سطر الأوامر cURL للوصول إلى خدمات الويب Aspose.Cells بسهولة. يوضح المثال التالي كيفية إجراء مكالمات إلى Cloud API مع cURL.
Request
Copy
curl -v "https://api.aspose.cloud/v3.0/cells/test.xlsx/worksheets/Sheet1/cells/style?range=a1%3Aa10" \
-X POST \
-d "{ \"Font\": { \"Color\": { \"A\":255, \"R\": 255, \"G\": 255, \"B\": 0 }, \"DoubleSize\": 10, \"IsBold\": true, \"IsItalic\": true, \"IsStrikeout\": true, \"IsSubscript\": true, \"IsSuperscript\": true, \"Name\": \"Arial\", \"Size\": 22 }, \"Name\": \"string\", \"CultureCustom\": \"string\", \"Custom\": \"string\", \"BackgroundColor\": { \"A\": 10, \"R\": 10, \"G\": 10, \"B\": 10 }, \"ForegroundColor\": { \"A\": 255, \"R\": 255, \"G\": 255, \"B\": 0 } \
-H " Content-Type: application/json" \
-H " Accept: application/json" \
-H " Authorization: Bearer <jwt token>"
Response
Copy {
"Code" : 200,
"Status" : "OK"
}
عائلة Cloud SDK
يعد استخدام SDK أفضل طريقة لتسريع عملية التطوير. تهتم حزمة SDK بالتفاصيل ذات المستوى المنخفض وتتيح لك التركيز على مهام مشروعك. يرجى التحقق منمستودع جيثب للحصول على قائمة كاملة بـ Aspose.Cells Cloud SDKs.
توضح أمثلة التعليمات البرمجية التالية كيفية إجراء مكالمات إلى خدمات الويب Aspose.Cells باستخدام مجموعات تطوير البرامج (SDK) المتنوعة:
PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-php
require_once('vendor\autoload.php');
use \Aspose\Cells\Cloud\Api\CellsApi;
use \Aspose\Cells\Cloud\Request\PostUpdateWorksheetCellStyleRequest;;
class Cell {
public $instance;
public function __construct() {
$this->instance = new CellsApi(getenv("CellsCloudClientId"),getenv("CellsCloudClientSecret"),"v3.0",getenv("CellsCloudApiBaseUrl"));
}
public function postUpdateWorksheetCellStyle() {
$remoteFolder = "TestData/In";
$localName = "Book1.xlsx";
$remoteName = "Book1.xlsx";
$styleFont = new \Aspose\Cells\Cloud\Model\Font();
$styleFont->setSize(16 );
$style = new \Aspose\Cells\Cloud\Model\Style();
$style->setFont($styleFont );
$request = new PostUpdateWorksheetCellStyleRequest();
$request->setName( $remoteName);
$request->setSheetName( "Sheet1");
$request->setCellName( "A1");
$request->setStyle( $style);
$request->setFolder( $remoteFolder);
$request->setStorageName( "");
$this->instance->postUpdateWorksheetCellStyle($request);
}
}
$instance = new Cell();
$instance->postUpdateWorksheetCellStyle();
?>
Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update cell's style.
def post_update_worksheet_cell_style
name = $BOOK1
sheet_name = $SHEET1
cell_name = 'C1'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell_style(name, sheet_name, cell_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.post_update_worksheet_cell_style
Go