Exemple #1
0
        void AddSheetInWorkbook(string res_id, string ws_name, short sheet_number)
        {
            Dictionary <string, string> attrs = new Dictionary <string, string>();

            attrs["name"]    = ws_name;
            attrs["r:id"]    = res_id;
            attrs["sheetId"] = sheet_number.ToString();
            xml_workbook.FillXmlElements(xml_workbook.Document);
            XmlElement sheets = xml_workbook.FindFirstNode("sheets", new Dictionary <string, string>());

            var new_el = xml_workbook.CreateNode("sheet", attrs, String.Empty, sheets);


            xml_workbook.Document.InnerXml = xml_workbook.Document.InnerXml.Replace("xmlns=\"\"", String.Empty).Replace("xmlns:r=\"special_ns\"", String.Empty);
            xml_workbook.SaveDocument(temp_path + "\\xl\\workbook.xml");
        }