Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Commented Issue: CreateDrawingPatriarch only works once [11330]

$
0
0
NPOI 2.0 alpha<br>
<br>
When using XSSH and invoking CreateDrawingPatriarch() on a sheet only the first call will return an IDrawing object. Subsequent calls will return null.<br>
<br>
Sample Code:<br>
<br>
<p>private static void SetCellComment(ISheet worksheet, int columnPosition, int rowPosition, string comment)<br>
{<br>
//Get row<br>
var row = worksheet.GetRow(rowPosition) ?? worksheet.CreateRow(rowPosition);</p>

<p> //Get or Create Cell<br>
var cell = row.GetCell(columnPosition) ?? row.CreateCell(columnPosition);<br>
<br>
//We need a drawing patriarch as a graphics surface.<br>
var drawingSurface = worksheet.CreateDrawingPatriarch();</p>

<p> //The creation helper can provide basic objects.<br>
var objectFactory = worksheet.Workbook.GetCreationHelper();</p>

<p> //Create the new comment.<br>
var newComment = drawingSurface.CreateCellComment(objectFactory.CreateClientAnchor());<br>
newComment.String = objectFactory.CreateRichTextString(comment);</p>

<p> //Link the comment to the desired cell.<br>
cell.CellComment = newComment;<br>
}</p>
Comments: ** Comment from web user: tonyqus **

The latest code is in googlecode SVN instead of codeplex svn.


Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>