Node.jsを使ったC++経由で複数のワークブックを1つのワークブックに結合

画像とグラフを使用したワークブックの結合

この例のコードは、Aspose.Cells for Node.js via C++を使って2つのワークブックを1つに結合します。ソースワークブックを読み込み、Workbook.combine(Workbook)メソッドを使って結合し、出力ワークブックを保存します。

ソースワークブック

出力ワークブック

スクリーンショット

以下は、ソースおよび出力ワークブックのスクリーンショットです。

チャートワークブックの最初のワークシート - 積み重ね

todo:image_alt_text

チャートワークブックの2番目のワークシート - 折れ線

todo:image_alt_text

画像ワークブックの最初のワークシート - 画像

todo:image_alt_text

結合されたワークブックの3つのワークシート - 積み重ね、折れ線、画像

todo:image_alt_text

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");

// Define the first source
// Open the first excel file.
const sourceBook1 = new AsposeCells.Workbook(path.join(dataDir, "SampleChart.xlsx"));

// Define the second source book.
// Open the second excel file.
const sourceBook2 = new AsposeCells.Workbook(path.join(dataDir, "SampleImage.xlsx"));

// Combining the two workbooks
sourceBook1.combine(sourceBook2);

const outputPath = path.join(dataDir, "Combined.out.xlsx");
// Save the target book file.
sourceBook1.save(outputPath);

高度なトピック