Spread ASP.NET 6.0 Product Documentation
SetClip Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class : SetClip Method


row
Starting row index, or -1 for all rows
column
Starting column index, or -1 for all columns
rowCount
Number of rows, or -1 for all rows (may create new rows as needed)
columnCount
Number of columns, or -1 for all columns (may create new columns as needed)
value
Tab-delimited string to set into the range

Glossary Item Box

Sets a tab-delimited string containing the formatted text in a specified range.

Syntax

Visual Basic (Declaration) 
Public Sub SetClip( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer, _
   ByVal value As String _
) 
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim row As Integer
Dim column As Integer
Dim rowCount As Integer
Dim columnCount As Integer
Dim value As String
 
instance.SetClip(row, column, rowCount, columnCount, value)
C# 
public void SetClip( 
   int row,
   int column,
   int rowCount,
   int columnCount,
   string value
)

Parameters

row
Starting row index, or -1 for all rows
column
Starting column index, or -1 for all columns
rowCount
Number of rows, or -1 for all rows (may create new rows as needed)
columnCount
Number of columns, or -1 for all columns (may create new columns as needed)
value
Tab-delimited string to set into the range

Return Value

Tab-delimited string containing the formatted data in the range

Exceptions

ExceptionDescription
System.ArgumentOutOfRangeException Specified row is out of range; index must be between -1 (for all) and the number of rows
System.ArgumentOutOfRangeException Specified column is out of range; index must be between -1 (for all) and the number of columns

Remarks

Provide data for this method using tab characters and carriage returns or line feeds to specify cells and rows. Use tab characters between cells, and carriage returns or line feeds between rows. For C#, use the \t sequence for tabs, and the \n or \r for line feeds or carraige returns. For VB.NET, use the Chr(9) function for tab characters, and the Chr(10) or Chr(13) function for linefeeds or carriage returns, or the VB constants, vbTab, vbLf, vbCr, or vbCrLf.

The data in the range of cells is parsed using the IFormatter in the composite style for the cell in the style model.

Besides using this method, you can get or set the data in a cell using various properties of the sheet (SheetView object) or properties of the cell (Cell object). For more information, see Handling Data Using Sheet Methods and Handling Data Using Cell Properties.

Remember that the data may be displayed differently in a cell depending on the cell type. For more information, see Understanding Cell Type Effects on Displaying Data.

Example

This example gets a tab-delimited string containing the formatted text in a range.
C#Copy Code
FarPoint.Web.Spread.SheetView sv;
sv = FpSpread1.ActiveSheetView;
sv.SetClip(0, 0, 2, 4, "one\ttwo\tthree\tfour\r\nfive\tsix\tseven\teight"); 
string s;
s = sv.GetClip(0, 0, 2, 4);
Response.Write(s);
Visual BasicCopy Code
Dim sv As FarPoint.Web.Spread.SheetView
sv = FpSpread1.ActiveSheetView
sv.SetClip(0, 0, 2, 4, "one" + Chr(9) + "two" + Chr(9) + "three" + Chr(9) + "four" + vbCrLf + "five" + Chr(9) + "six" + Chr(9)
+ "seven" + Chr(9) + "eight")
Dim s As String
s = sv.GetClip(0, 0, 2, 4)
Response.Write(s)

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.