Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

Creates an anchor at a specified position in the worksheet.

Signature
C#C#
Wiki Markup
{description}
{excerpt}Creates an anchor at a specified position in the worksheet. 
{excerpt}
{signature:C#}
 public Anchor CreateAnchor(int rowNumber, int columnNumber, double offsetX, double offsetY)
Signature
{signature}{signature:vb.net
vb.net
}
Public Function CreateAnchor(ByVal rowNumber As Integer, ByVal columnNumber As Integer, ByVal offsetX As Double, ByVal offsetY As Double) As Anchor
Parameters

...

The 0-based row number of the cell in which the anchor will be positioned.

...

The 0-based column number of the cell in which the anchor will be positioned.

...

The X offset from the cell's left side as a percentage of the cell's width. If this worksheet is a chartsheet, this value is a percentage of the chart's width. This value must be between 0 and 100.

...

The Y offset from the top of the cell as a percentage of the cell's height. If this worksheet is a chartsheet, this value is a percentage of the chart's height. This value must be between 0 and 100.

Returns

An Anchor object.

Remarks

An anchor represents the position of a floating (non-cell data) object within a spreadsheet. The position is maintained as a row number + a percentage of the row's width and a column number + a percentage of the column's height.

If this Worksheet is actually a Chartsheet, the rowNumber and columnNumber values are disregarded and the offsetX and offsetY values are interperted to be a percentage of the Chart's width and height, respectivly.

{signature}
{parameters}
{param:rowNumber}The 0\-based row number of the cell in which the anchor will be positioned.{param}
{param:columnNumber}The 0\-based column number of the cell in which the anchor will be positioned.{param}
{param:offsetX}The X offset from the cell's left side as a percentage of the cell's width.  If this worksheet is a chartsheet, this value is a percentage of the chart's width. This value must be between 0 and 100.{param}
{param:offsetY}The Y offset from the top of the cell as a percentage of the cell's height.  If this worksheet is a chartsheet, this value is a percentage of the chart's height. This value must be between 0 and 100.{param}
{returns}An [Anchor|Anchor] object.{returns}
{remarks}
An anchor represents the position of a floating \(non\-cell data\) object within a spreadsheet. The position is maintained as a row number \+ a percentage of the row's width and a column number \+ a percentage of the column's height.

If this Worksheet is actually a Chartsheet, the rowNumber and columnNumber values are disregarded and the offsetX and offsetY values are interperted to be a percentage of the Chart's width and height, respectivly.

{remarks}
{example}{code:csharp|title=C#}
Anchor anch = ws.CreateAnchor(4, 1, 30, 50);
{code}
{code:vb.net
|title=vb.net
}
Dim anch As Anchor = ws.CreateAnchor(4, 1, 30, 50){code}

{example}
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle