XML i C++ ile Excel Çalışma Kitabına İçe Aktarın

Microsoft Excel kullanarak XML Haritası İçe Aktarma

Aşağıdaki ekran görüntüsü, Microsoft Excel kullanarak XML Haritası İçe Aktarma işlemini göstermektedir.

todo:image_alt_text

Aspose.Cells kullanarak XML Haritası İçe Aktarma

Aşağıdaki örnek kod, Workbook.ImportXml() metodunun nasıl kullanılacağını gösterir. Bu, bu ekran görüntüsünde gösterilen çıktı Excel dosyasını oluşturur.

todo:image_alt_text
#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\\");

    // Create a workbook
    Workbook workbook;

    // URL that contains your XML data for mapping
    U16String XML(u"http://www.aspose.com/docs/download/attachments/434475650/sampleXML.txt");

    // Import your XML Map data starting from cell A1
    workbook.ImportXml(XML, u"Sheet1", 0, 0);

    // Save workbook
    U16String outputPath = outDir + u"output_out.xlsx";
    workbook.Save(outputPath);

    std::cout << "Workbook saved successfully with imported XML data!" << std::endl;

    Aspose::Cells::Cleanup();
}

Gelişmiş Konular