Spread Windows Forms 7.0 Product Documentation
AddCustomName(String,String,Int32,Int32,Boolean,String) Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class > AddCustomName Method : AddCustomName(String,String,Int32,Int32,Boolean,String) Method


name
Custom name to add
value
String value for the custom name
baseRow
Base row index for calculating relative row references in the value
baseColumn
Base column index for calculating relative column references in the value
sheetViewScope
comment
Comment for the custom name

Glossary Item Box

Adds a custom name to the model using the specified string value.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub AddCustomName( _
   ByVal name As String, _
   ByVal value As String, _
   ByVal baseRow As Integer, _
   ByVal baseColumn As Integer, _
   ByVal sheetViewScope As Boolean, _
   ByVal comment As String _
) 
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim name As String
Dim value As String
Dim baseRow As Integer
Dim baseColumn As Integer
Dim sheetViewScope As Boolean
Dim comment As String
 
instance.AddCustomName(name, value, baseRow, baseColumn, sheetViewScope, comment)
C# 
public void AddCustomName( 
   string name,
   string value,
   int baseRow,
   int baseColumn,
   bool sheetViewScope,
   string comment
)

Parameters

name
Custom name to add
value
String value for the custom name
baseRow
Base row index for calculating relative row references in the value
baseColumn
Base column index for calculating relative column references in the value
sheetViewScope
comment
Comment for the custom name

Example

This example uses the AddCustomName method.
C#Copy Code
fpSpread1.ActiveSheet.AddCustomName("Alpha", "Sum(A1,A2)", 1, 1, true, "Comment");
fpSpread1.ActiveSheet.SetFormula(1, 1, "Alpha");
fpSpread1.ActiveSheet.SetValue(0, 0, 10);
fpSpread1.ActiveSheet.SetValue(1, 0, 10);
//Set scope to true for a sheet level custom name
//Set scope to false for a workbook level custom name
//fpSpread1.Sheets.Count = 3;
//fpSpread1.Sheets[0].AddCustomName("Alpha", "Sum(A1,A2)", 1, 1, false, "test");
//fpSpread1.Sheets[0].SetFormula(1, 1, "Alpha");
//fpSpread1.Sheets[0].SetValue(0, 0, 10);
//fpSpread1.Sheets[0].SetValue(1, 0, 10);
//fpSpread1.Sheets[1].SetFormula(1, 1, "Alpha");
VB.NETCopy Code
FpSpread1.ActiveSheet.AddCustomName("Alpha", "Sum(A1,A2)", 1, 1, True, "Comment")
FpSpread1.ActiveSheet.SetFormula(1, 1, "Alpha")
FpSpread1.ActiveSheet.SetValue(0, 0, 10)
FpSpread1.ActiveSheet.SetValue(1, 0, 10)
'Set scope to true for a sheet level custom name
'Set scope to false for a workbook level custom name
'FpSpread1.Sheets.Count = 3;
'FpSpread1.Sheets(0).AddCustomName("Alpha", "Sum(A1,A2)", 1, 1, False, "test")
'FpSpread1.Sheets(0).SetFormula(1, 1, "Alpha")
'FpSpread1.Sheets(0).SetValue(0, 0, 10)
'FpSpread1.Sheets(0).SetValue(1, 0, 10)
'FpSpread1.Sheets(1).SetFormula(1, 1, "Alpha")

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.