示例#1
0
        public void SetPrintTitleToRows(int firstRow, int lastRow)
        {
            XMLDefinedName xMLDefinedName = this._sheetModel.NameManager.CreateDefinedName("_xlnm.Print_Titles");

            xMLDefinedName.Content    = string.Format(CultureInfo.InvariantCulture, "'{0}'!${1}:${2}", this._sheetModel.Name.Replace("'", "''"), firstRow + 1, lastRow + 1);
            xMLDefinedName.SheetIndex = this._sheetModel.Position;
        }
        public XMLDefinedName CreateDefinedName(string name)
        {
            if (this._workbook.DefinedNames == null)
            {
                this._workbook.DefinedNames = new CT_DefinedNames();
            }
            CT_DefinedName cT_DefinedName = new CT_DefinedName();
            XMLDefinedName xMLDefinedName = new XMLDefinedName(cT_DefinedName);

            xMLDefinedName.Name = name;
            this._workbook.DefinedNames.DefinedName.Add(cT_DefinedName);
            return(xMLDefinedName);
        }