Excel da Word biyu ne daga cikin aikace-aikacen Microsoft Office da aka fi amfani da su. Yayin da ake amfani da Excel da farko don adanawa da nazarin bayanan lambobi, Kalma sanannen kayan aiki ne don ƙirƙira da tsara takaddun rubutu. Koyaya, akwai lokutan da zaku buƙaci canza fayil ɗin Excel zuwa takaddar Kalma, wataƙila don ƙirƙirar rahoto ko taƙaita bayanan ku. A cikin wannan shafin yanar gizon fasaha, za mu bincika hanyoyi daban-daban da za ku iya canza Excel zuwa Kalma, ciki har da kayan aiki da fasaha daban-daban da ke samuwa don sarrafa aikin. Za mu kuma tattauna fa’idodi da iyakoki na kowace hanya, don haka zaku iya zaɓar mafi kyawun hanya dangane da takamaiman bukatunku.
Bi wannan labarin don haɓaka Excel zuwa Mai sauya Kalma akan layi don canza fayilolin XLS ɗin ku zuwa cikakkun takaddun da aka tsara a cikin dannawa kaɗan kawai. Cikakke don gabatarwa, rahotanni, da ƙari. Don haka bi wannan jagorar mataki-mataki mai nuna matakai don haɗa fayiloli da amfani da mafi yawan bayanan ku. Gwada shi yanzu!
- API ɗin Canjin Kalma zuwa Excel
- Canza Excel zuwa Kalma a cikin C#
- XLS zuwa Kalma ta amfani da Umarnin CURL
API ɗin Canjin Kalma zuwa Excel
Aspose.Cells Cloud SDK for .NET API ne mai ƙarfi na tushen girgije wanda ke ba masu haɓaka damar canza XLS zuwa takaddun Kalma ba tare da matsala ba. Wannan SDK yana sauƙaƙa sarrafa tsarin jujjuya bayanan Excel zuwa takaddun Kalma, tare da adana duk tsarawa da shimfidawa. Tsarin juyawa yana da sauri da inganci, kuma ana iya yin shi a cikin ƴan layukan lamba. A cikin wannan shafin yanar gizon fasaha, za mu kalli yadda ake canza XLS zuwa Kalma ta amfani da Aspose.Cells Cloud SDK don NET, gami da jagorar mataki-mataki kan yadda ake farawa, zaɓuɓɓukan juyawa daban-daban da ke akwai, da kuma ta yaya. don magance duk wani kurakurai da ka iya faruwa yayin aiwatar da juyawa. Za mu kuma bincika fa’idodi da iyakoki na amfani da wannan API na tushen girgije kuma mu cika burin mu na shigar da maɓalli na Excel a cikin takaddar Kalma.
Don farawa da amfani da SDK, za mu ƙara bayanin sa ta mai sarrafa fakitin NuGet. Kawai bincika “Aspose.Cells-Cloud” kuma danna maɓallin Ƙara Kunshin. Na biyu, idan ba a riga an yi rajista ba akan Cloud Dashboard, da fatan za a ƙirƙiri asusun kyauta ta amfani da ingantaccen adireshin imel kuma sami keɓaɓɓen bayanan abokin ciniki.
Canza Excel zuwa Kalma a cikin C#
Da fatan za a bi matakai da snippet code da aka bayar a ƙasa don fitarwa Excel zuwa kalma ta amfani da C#.
// Don cikakkun misalai da fayilolin bayanai, da fatan za a je zuwa
https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/
// Samu bayanan abokin ciniki daga https://dashboard.aspose.cloud/
string clientSecret = "4d84d5f6584160cbd91dba1fe145db14";
string clientID = "bb959721-5780-4be6-be35-ff5c3a6aa4a2";
// ƙirƙiri misalin CellsApi ta hanyar samar da ClientID da bayanan sirri na ClientSecret
CellsApi instance = new CellsApi(clientID, clientSecret);
// Sunan fayil ɗin shigarwar mu na Excel
string name = "myDocument.xls";
// Tsarin don daftarin aiki na Word
string format = "DOCX";
try
{
// loda fayil ɗin daga rumbun gida
using (var file = System.IO.File.OpenRead(name))
{
// fara aikin juyawa
var response = instance.CellsWorkbookPutConvertWorkbook(file, format: format, outPath: null);
// Ajiye sakamakon CSV zuwa faifan gida
using (var fileStream = new FileStream("myResultant.docx", System.IO.FileMode.OpenOrCreate, FileAccess.Write))
{
response.CopyTo(fileStream);
}
// buga saƙon nasara idan tuba ya yi nasara
if (response != null && response.Equals("OK"))
{
Console.WriteLine("Excel to Word successfully converted !");
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
Bari mu fahimci snippet code na sama:
CellsApi instance = new CellsApi(clientID, clientSecret);
Ƙirƙiri wani abu na CellsApi inda muka wuce bayanan abokin ciniki azaman muhawara.
var file = System.IO.File.OpenRead(name)
Karanta shigarwar takardar aikin Excel ta amfani da hanyar OpenRead(…) na tsarin System.IO.File.
CellsWorkbookPutConvertWorkbook(file, format: format, outPath: resultantFile);
Hanyar da ke sama tana ƙaddamar da fassarar Excel zuwa Kalma kuma an adana sakamakon DOCX zuwa ma’ajiyar girgije.
using (var fileStream = new FileStream("myResultant.docx", System.IO.FileMode.OpenOrCreate, FileAccess.Write))
{
response.CopyTo(fileStream);
}
Yanzu don adana sakamakon Kalma (DOCX) zuwa faifan gida, da fatan za a yi amfani da layin lamba na sama
Kuna iya yin la’akari da zazzage samfurin aikin Excel da aka yi amfani da shi a cikin misalin sama daga myDocument.xlsx.
XLS zuwa Kalma ta amfani da Umarnin CURL
Mayar da XLS zuwa Kalma ta amfani da umarnin cURL na iya zama zaɓi mai dacewa ga masu haɓakawa waɗanda ke neman mafita ta atomatik don canza fayiloli. Tun da Aspose.Cells Cloud an gina shi a saman gine-gine na REST, don haka za mu iya yin sauƙin Excel XLS zuwa fassarar Kalma ta amfani da umarnin CURL.
Yanzu, da farko muna buƙatar samar da alamar samun damar JWT dangane da shaidar abokin cinikinmu:
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bb959721-5780-4be6-be35-ff5c3a6aa4a2&client_secret=4d84d5f6584160cbd91dba1fe145db14" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Yanzu muna buƙatar aiwatar da umarni mai zuwa don canza XLS zuwa takaddar Kalma. Bayan jujjuyawa, ana adana sakamakon sakamakon zuwa ma’ajiyar Cloud:
curl -v -X GET "https://api.aspose.cloud/v3.0/cells/myDocument(1).xlsx?format=DOCX&isAutoFit=true&onlySaveTable=false&outPath=Resultant.docx&checkExcelRestriction=true" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>"
Da fatan za a yi amfani da umarnin cURL mai zuwa don yin fassarar Excel zuwa Kalma da adana abin fitarwa akan tuƙi na gida:
curl -v -X GET "https://api.aspose.cloud/v3.0/cells/myDocument(1).xlsx?format=DOCX&isAutoFit=true&onlySaveTable=false&checkExcelRestriction=true" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>" \
-o "Output.docx"
Karshen Magana
A ƙarshe, canza Excel zuwa Kalma na iya zama tsari mai cin lokaci da wahala, amma tare da kayan aiki da dabaru masu dacewa, ana iya sarrafa shi ta atomatik kuma ya inganta shi sosai. Aspose.Cells Cloud SDK don NET shine irin wannan kayan aiki wanda zai iya sauƙaƙe tsarin kuma ya taimake mu a ceton lokaci da ƙara yawan aiki. Ta hanyar yin amfani da wannan API mai ƙarfi na tushen girgije, masu haɓakawa za su iya sauya fayilolin XLS cikin sauƙi zuwa takaddun Kalma yayin riƙe duk tsarawa da shimfidawa. Ko kuna ƙirƙirar rahotanni, taƙaitawa, ko wasu takardu, Aspose.Cells Cloud SDK don NET yana ba da mafita mai dacewa, abin dogaro, kuma mai tsada don duk buƙatun musanya na Excel zuwa Kalma. Tare da ilhama ta keɓancewa, cikakkar bayanai, da kuma kyakkyawan goyan bayan abokin ciniki, wannan SDK babban zaɓi ne ga masu haɓakawa waɗanda ke neman daidaita ayyukansu da haɓaka aikin su.
Labarai masu alaka
Da fatan za a ziyarci hanyoyin haɗin yanar gizon don ƙarin koyo game da: