Spread Windows Forms 8.0 Product Documentation
AddCustomName(String,String,Int32,Int32,Boolean,String) Method
Example 


Custom name to add
String value for the custom name
Base row index for calculating relative row references in the value
Base column index for calculating relative column references in the value
Comment for the custom name
Adds a custom name to the model using the specified string value.
Syntax
'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 _
) 
'Usage
 
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)
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.
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");
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

Reference

SheetView Class
SheetView Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.