إضافة شكل على ورقة عمل Excel يشير REST API إلى إضافة شكل في ورقة عمل Excel.
رسيت API
Copy
PUT http://api.aspose.cloud/v3.0/cells/{ name} /worksheets/{ sheetName} /shapes
معلمات الطلب هي:
اسم المعلمة
يكتب
المسار/سلسلة الاستعلام/HTTPBody
وصف
اسم
خيط
طريق
اسم الملف.
اسم الورقة
خيط
طريق
اسم ورقة العمل.
com.shapeDTO
جسم
drawType
خيط
استفسار
نوع كائن الشكل
UpperLeftRow
عدد صحيح
استفسار
مؤشر الصف العلوي الأيسر.
UpperLeftColumn
عدد صحيح
استفسار
فهرس العمود الأيسر العلوي.
قمة
عدد صحيح
استفسار
يمثل الإزاحة الرأسية لـ Spinner من الصف الأيسر بوحدة البكسل.
غادر
عدد صحيح
استفسار
يمثل الإزاحة الأفقية لـ Spinner من العمود الأيسر بوحدة البكسل.
عرض
عدد صحيح
استفسار
يمثل ارتفاع Spinner بوحدة البكسل.
ارتفاع
عدد صحيح
استفسار
يمثل عرض Spinner بوحدة البكسل.
مجلد
خيط
استفسار
مجلد الوثيقة.
اسم التخزين
خيط
استفسار
اسم التخزين.
المواصفات OpenAPI يحدد واجهة برمجة يمكن الوصول إليها بشكل عام ويتيح لك تنفيذ تفاعلات REST مباشرة من متصفح الويب.
يمكنك استخدام أداة سطر الأوامر cURL للوصول إلى خدمات الويب Aspose.Cells بسهولة. يوضح المثال التالي كيفية إجراء مكالمات إلى Cloud API مع cURL.
عائلة Cloud SDK
يعد استخدام SDK أفضل طريقة لتسريع عملية التطوير. تهتم حزمة SDK بالتفاصيل ذات المستوى المنخفض وتتيح لك التركيز على مهام مشروعك. يرجى التحقق منمستودع جيثب للحصول على قائمة كاملة بـ Aspose.Cells Cloud SDKs.
توضح أمثلة التعليمات البرمجية التالية كيفية إجراء مكالمات إلى خدمات الويب Aspose.Cells باستخدام مجموعات تطوير البرامج (SDK) المتنوعة:
C#
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-dotnet/
namespace Aspose.Cells.Cloud.SDK.Example
{
using Aspose.Cells.Cloud.SDK.Api;
using Aspose.Cells.Cloud.SDK.Request;
using System;
public partial class CellsApiExample
{
public void PutWorksheetShapeExample()
{
CellsApi cellsApi = new CellsApi(Environment.GetEnvironmentVariable("CellsCloudTestClientId"), Environment.GetEnvironmentVariable("CellsCloudTestClientSecret"));
PutWorksheetShapeRequest request = new PutWorksheetShapeRequest { name = "Book1.xlsx", sheetName="Sheet1", upperLeftColumn=1, upperLeftRow=1, DrawingType="button", height =10, left=12, top=10, width =10, folder = "TestData/In" };
cellsApi.PutWorksheetShape(request);
}
}
}
Java
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
package com.aspose.cloud.cells.api;
import com.aspose.cloud.cells.client.*;
import com.aspose.cloud.cells.model.*;
import com.aspose.cloud.cells.request.*;
import java.io.IOException;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.util.HashMap;
public class Example {
private CellsApi api;
public Example(){
try {
api = new CellsApi(
System.getenv("CellsCloudClientId"),
System.getenv("CellsCloudClientSecret"),
"v3.0",
System.getenv("CellsCloudApiBaseUrl")
);
} catch (ApiException e) {
e.printStackTrace();
}
}
public void Run(){
try{
String remoteFolder = "TestData/In";
String localName = "Book1.xlsx";
String remoteName = "Book1.xlsx";
UploadFileRequest uploadFileRequest = new UploadFileRequest();
uploadFileRequest.setPath( remoteFolder + "/" + remoteName );
uploadFileRequest.setStorageName( "");
HashMap<String,File> files = new HashMap<String,File>();
files.put( localName , new File(localName ));
uploadFileRequest.setUploadFiles(files);
api.uploadFile(uploadFileRequest);
PutWorksheetShapeRequest request = new PutWorksheetShapeRequest();
request.setName(remoteName);
request.setSheetName("Sheet1");
request.setShapeDTO(null);
request.setDrawingType("button");
request.setUpperLeftRow(1);
request.setUpperLeftColumn(1);
request.setTop(10);
request.setLeft(10);
request.setWidth(100);
request.setHeight(90);
request.setFolder(remoteFolder);
request.setStorageName("");
CellsCloudResponse response = api.putWorksheetShape(request);
} catch (ApiException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}
}
}
Perl
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-perl/
use strict;
use warnings;
use utf8;
use File::Slurp;
use MIME::Base64;
use AsposeCellsCloud::CellsApi;
my $config = AsposeCellsCloud::Configuration->new( client_id => $ENV{'ProductClientId'}, client_secret => $ENV{'ProductClientSecret'});
my $instance = AsposeCellsCloud::CellsApi->new(AsposeCellsCloud::ApiClient->new( $config));
my $remoteFolder = 'TestData/In';
my $remoteName = 'Book1.xlsx';
my $shape_dto = AsposeCellsCloud::Object::Shape->new();
my $request = AsposeCellsCloud::Request::PutWorksheetShapeRequest->new();
$request->{name} = $remoteName;
$request->{sheet_name} = 'Sheet1';
$request->{shape_dto} = $shape_dto;
$request->{drawing_type} = 'arc';
$request->{upper_left_row} = 1;
$request->{upper_left_column} = 1;
$request->{top} = 10;
$request->{left} = 10;
$request->{width} = 100;
$request->{height} = 100;
$request->{folder} = $remoteFolder;
$request->{storage_name} = '';
my $result = $api->put_worksheet_shape(request=> $request);
Go
Swift