Cells.LinkToXmlMap

Cells.LinkToXmlMap method

Link to a xml map.

public void LinkToXmlMap(string mapName, int row, int column, string path)
ParameterTypeDescription
mapNameStringname of xml map
rowInt32row of the destination cell
columnInt32column of the destination cell
pathStringpath of xml element in xml map

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class CellsMethodLinkToXmlMapWithStringInt32Int32StringDemo
    {
        public static void Run()
        {
            // Create a new workbook
            Workbook wb = new Workbook();
            
            // Add a sample XML map
            int mapIndex = wb.Worksheets.XmlMaps.Add("<Transmittals><Issued_Document>Test</Issued_Document></Transmittals>");
            XmlMap xmlMap = wb.Worksheets.XmlMaps[mapIndex];
            xmlMap.Name = "Transmittals_Map";
            
            // Get the first worksheet
            Worksheet sheet = wb.Worksheets[0];
            Cells cells = sheet.Cells;
            
            // Link cell to XML map
            cells.LinkToXmlMap("Transmittals_Map", 0, 0, "/Transmittals/Issued_Document");
            
            // Save the workbook
            wb.Save("output.xlsx");
        }
    }
}

See Also