C++ ile Veri Tabloları için Dizi Formülü Hesaplama
Aşağıdaki örnek kodda, kaynak excel dosyası‘ı kullandık. Eğer B1 hücresinin değerini 100 olarak değiştirirseniz, Sarı renkle doldurulan Veri Tablosu değerleri 120 olarak değişir ve çıktı PDF’sini oluşturur. Daha fazla bilgi için yorumları okuyunuz.
çıktı PDF’sini oluşturmak için kaynak excel dosyası‘ı kullanılan örnek kod aşağıdaki gibidir. Daha fazla bilgi için yorumları okuyunuz.
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// Source directory path
U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
// Output directory path
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
// Path of input excel file
U16String inputFilePath = srcDir + u"DataTable.xlsx";
// Create workbook from source excel file
Workbook workbook(inputFilePath);
// Access first worksheet
Worksheet worksheet = workbook.GetWorksheets().Get(0);
// When you will put 100 in B1, then all Data Table values formatted as Yellow will become 120
worksheet.GetCells().Get(u"B1").PutValue(100);
// Calculate formula, now it also calculates Data Table array formula
workbook.CalculateFormula();
// Save the workbook in pdf format
workbook.Save(outDir + u"output_out.pdf");
std::cout << "Workbook saved successfully!" << std::endl;
Aspose::Cells::Cleanup();
}