SoftArtisans:形状中的文本方向

时间:2015-12-22 17:15:46

标签: c# excel officewriter

我正在尝试使用SoftArtisans'ExcelApplicationAnchorShape创建图表。

我能够将形状显示在输出文件中;但是,我要求Shape中显示的文字必须从下到上阅读,即 SHAPE 必须显示为:

电子

P

A

ħ

取值

我正在使用以下代码在文件上创建我的形状,该代码存在于for循环中:

if (prevRow != null && prevRow.FixtureY != pogPicDtl.FixtureY)
{
    currRow += 3;
    currCol = 0;
}

double prodX = (double)pogPicDtl.PositionX;
double prodY = (double)pogPicDtl.PositionY;

Shapes sheetShapes = wb.Worksheets[sheetNumber].Shapes;
Anchor anchor = wb.Worksheets[sheetNumber].CreateAnchor(currRow, currCol, prodX * .1, prodY );
Shape box = sheetShapes.CreateShape(ShapeType.Rectangle, anchor);

box.FillColor = blue;
box.FillTransparency = 0.50;
box.Height =(double) pogPicDtl.PositionHeight *10;
box.Width = (double)pogPicDtl.PositionWidth*10;

// I want this Text to read upw
box.Text = Math.Round(pogPicDtl.PositionX,0).ToString() + "," + Math.Round(pogPicDtl.PositionY,0).ToString();

SoftArtisans可以实现吗?当使用Excel本身时,当然可以这样做,但是通过API,我还没有发现文本方向在与Shape相关时可以修改。

1 个答案:

答案 0 :(得分:0)

根据http://wiki.softartisans.com/display/EW9/Shape,目前不支持此属性。但是,ExcelWriter会保留大多数设置。是否可以在输入文件中设置已经设置了文本旋转的形状,只需更改文本。

另一个选项,取决于形状,可能只是设置形状旋转http://wiki.softartisans.com/display/EW9/Shape.Rotation,以便文本看起来向上读。