找回密码
 立即注册

QQ登录

只需一步,快速开始

terry1434

高级会员

6

主题

24

帖子

1928

积分

高级会员

积分
1928

活字格认证

terry1434
高级会员   /  发表于:2010-12-23 16:38  /   查看:8563  /  回复:5
别人已经提供了带Spread的画面,但是发现显示有问题,不知道如何改,请帮忙看下
图片上的使用可否这栏的显示位置靠上,怎么让他和其他的列一样居中呢

jpg

jpg

5 个回复

倒序浏览
gw0506
超级版主   /  发表于:2010-12-24 09:17:00
沙发
Cell对象上有一个VerticalAlignment属性,调整为Center。
回复 使用道具 举报
terry1434
高级会员   /  发表于:2010-12-24 10:04:00
板凳
我设置完了属性,好像不行,效果还是原来的样子
另外,我的.asp文件里有一段很长的spread代码,而且是一行到底,看起来特麻烦,是不是spread自动生成的呢?我觉得是这里面的问题
<FarPoint:SheetView AllowPage="False" AllowSort="True" DesignString="<?xml version="1.0" encoding="utf-8"?><Sheet><Data><RowHeader class="FarPoint.Web.Spread.Model.DefaultSheetDataModel" rows="1" columns="1"><AutoCalculation>True</AutoCalculation><AutoGenerateColumns>True</AutoGenerateColumns><ReferenceStyle>A1</ReferenceStyle><Iteration>False</Iteration><MaximumIterations>1</MaximumIterations><MaximumChange>0.001</MaximumChange></RowHeader><ColumnHeader class="FarPoint.Web.Spread.Model.DefaultSheetDataModel" rows="1" columns="11"><AutoCalculation>True</AutoCalculation><AutoGenerateColumns>True</AutoGenerateColumns><ReferenceStyle>A1</ReferenceStyle><Iteration>False</Iteration><MaximumIterations>1</MaximumIterations><MaximumChange>0.001</MaximumChange><Cells><Cell row="0" column="1"><Data type="System.String">原価センターコード</Data></Cell><Cell row="0" column="2"><Data type="System.String">原価センター名</Data></Cell><Cell row="0" column="3"><Data type="System.String">原価センターグループコード</Data></Cell><Cell row="0" column="4"><Data type="System.String">通貨コード</Data></Cell><Cell row="0" column="5"><Data type="System.String">作成日</Data></Cell><Cell row="0" column="6"><Data type="System.String">作成者</Data></Cell><Cell row="0" column="7"><Data type="System.String">更新日</Data></Cell><Cell row="0" column="8"><Data type="System.String">更新者</Data></Cell><Cell row="0" column="9"><Data type="System.String">使用可否</Data></Cell><Cell row="0" column="10"><Data type="System.String">使用可否区分</Data></Cell></Cells></ColumnHeader><DataArea class="FarPoint.Web.Spread.Model.DefaultSheetDataModel" rows="1" columns="11"><AutoCalculation>True</AutoCalculation><AutoGenerateColumns>True</AutoGenerateColumns><ReferenceStyle>A1</ReferenceStyle><Iteration>False</Iteration><MaximumIterations>1</MaximumIterations><MaximumChange>0.001</MaximumChange><SheetName>Sheet1</SheetName></DataArea></Data><resentation><ActiveSkin class="FarPoint.Web.Spread.SheetSkin"><Name>Classic2</Name><BackColor>Empty</BackColor><CellBackColor>White</CellBackColor><CellForeColor>Black</CellForeColor><CellSpacing>0</CellSpacing><GridLines>Both</GridLines><GridLineColor>#dedfde</GridLineColor><HeaderBackColor>#6b696b</HeaderBackColor><HeaderForeColor>White</HeaderForeColor><FlatColumnHeader>True</FlatColumnHeader><FlatRowHeader>True</FlatRowHeader><HeaderFontBold>True</HeaderFontBold><SelectionBackColor>#ce5d5a</SelectionBackColor><SelectionForeColor>White</SelectionForeColor><EvenRowBackColor>#f7f7de</EvenRowBackColor><OddRowBackColor>White</OddRowBackColor><ShowColumnHeader>True</ShowColumnHeader><ShowRowHeader>True</ShowRowHeader></ActiveSkin><HeaderGrayAreaColor>Empty</HeaderGrayAreaColor><AxisModels><Row class="FarPoint.Web.Spread.Model.DefaultSheetAxisModel" defaultSize="22" orientation="Vertical" count="1"><Items><Item index="-1"><Size>22</Size></Item></Items></Row><Column class="FarPoint.Web.Spread.Model.DefaultSheetAxisModel" defaultSize="90" orientation="Horizontal" count="11"><Items><Item index="-1"><Size>90</Size><SortIndicator>Ascending</SortIndicator></Item><Item index="0"><Size>50</Size></Item><Item index="1"><Size>110</Size></Item><Item index="2"><Size>120</Size></Item><Item index="3"><Size>160</Size></Item><Item index="4"><Size>76</Size></Item><Item index="5"><Size>80</Size></Item><Item index="6"><Size>70</Size></Item><Item index="7"><Size>80</Size></Item><Item index="8"><Size>70</Size></Item><Item index="9"><Size>80</Size></Item><Item index="10"><Size>80</Size></Item></Items></Column><RowHeaderColumn class="FarPoint.Web.Spread.Model.DefaultSheetAxisModel" defaultSize="40" orientation="Horizontal" count="1"><Items><Item index="-1"><Size>40</Size><SortIndicator>Ascending</SortIndicator></Item></Items></RowHeaderColumn><ColumnHeaderRow class="FarPoint.Web.Spread.Model.DefaultSheetAxisModel" defaultSize="22" orientation="Vertical" count="1"><Items><Item index="-1"><Size>22</Size></Item></Items></ColumnHeaderRow></AxisModels><StyleModels><RowHeader class="FarPoint.Web.Spread.Model.DefaultSheetStyleModel" Rows="1" Columns="1"><AltRowCount>2</AltRowCount><DefaultStyle class="FarPoint.Web.Spread.NamedStyle" Parent="HeaderDefault"><BackColor>SteelBlue</BackColor><Border class="FarPoint.Web.Spread.Border" Size="1"><Bottom Color="#dedfde" Style="Solid" /><Right Color="#dedfde" Style="Solid" /></Border><Font><Bold>True</Bold><Italic>False</Italic><Overline>False</Overline><Strikeout>False</Strikeout><Underline>False</Underline></Font><ForeColor>White</ForeColor><HorizontalAlign>Center</HorizontalAlign></DefaultStyle><ConditionalFormatCollections /></RowHeader><ColumnHeader class="FarPoint.Web.Spread.Model.DefaultSheetStyleModel" Rows="1" Columns="11"><AltRowCount>2</AltRowCount><DefaultStyle class="FarPoint.Web.Spread.NamedStyle" Parent="HeaderDefault"><BackColor>SteelBlue</BackColor><Border class="FarPoint.Web.Spread.Border" Size="1"><Bottom Color="#dedfde" Style="Solid" /><Right Color="#dedfde" Style="Solid" /></Border><Font><Bold>True</Bold><Italic>False</Italic><Overline>False</Overline><Strikeout>False</Strikeout><Underline>False</Underline></Font><ForeColor>White</ForeColor><HorizontalAlign>Center</HorizontalAlign></DefaultStyle><ConditionalFormatCollections /></ColumnHeader><DataArea class="FarPoint.Web.Spread.Model.DefaultSheetStyleModel" Rows="1" Columns="11"><AltRowCount>2</AltRowCount><DefaultStyle class="FarPoint.Web.Spread.NamedStyle" Parent="DataAreaDefault"><BackColor>White</BackColor><ForeColor>Black</ForeColor></DefaultStyle><AltRowStyles><AltRowStyle Index="0" class="FarPoint.Web.Spread.StyleInfo"><BackColor>GhostWhite</BackColor></AltRowStyle><AltRowStyle Index="1" class="FarPoint.Web.Spread.StyleInfo"><BackColor>White</BackColor></AltRowStyle></AltRowStyles><ColumnStyles><ColumnStyle Index="0" class="FarPoint.Web.Spread.StyleInfo"><CellType class="FarPoint.Web.Spread.ButtonCellType"><CommandName>Button</CommandName><Type>LinkButton</Type><ButtonCellType /></CellType><Font><Bold>False</Bold><Italic>False</Italic><Overline>False</Overline><Strikeout>False</Strikeout><Underline>True</Underline></Font><ForeColor>Blue</ForeColor><HorizontalAlign>Center</HorizontalAlign><VerticalAlign>Middle</VerticalAlign></ColumnStyle><ColumnStyle Index="1" class="FarPoint.Web.Spread.StyleInfo"><VerticalAlign>Middle</VerticalAlign></ColumnStyle><ColumnStyle Index="2" class="FarPoint.Web.Spread.StyleInfo"><VerticalAlign>Middle</VerticalAlign></ColumnStyle><ColumnStyle Index="3" class="FarPoint.Web.Spread.StyleInfo"><VerticalAlign>Middle</VerticalAlign></ColumnStyle><ColumnStyle Index="4" class="FarPoint.Web.Spread.StyleInfo"><VerticalAlign>Middle</VerticalAlign></ColumnStyle><ColumnStyle Index="5" class="FarPoint.Web.Spread.StyleInfo"><HorizontalAlign>Center</HorizontalAlign><VerticalAlign>Middle</VerticalAlign></ColumnStyle><ColumnStyle Index="6" class="FarPoint.Web.Spread.StyleInfo"><HorizontalAlign>Center</HorizontalAlign><VerticalAlign>Middle</VerticalAlign></ColumnStyle><ColumnStyle Index="7" class="FarPoint.Web.Spread.StyleInfo"><HorizontalAlign>Center</HorizontalAlign><VerticalAlign>Middle</VerticalAlign></ColumnStyle><ColumnStyle Index="8" class="FarPoint.Web.Spread.StyleInfo"><HorizontalAlign>Center</HorizontalAlign><VerticalAlign>Middle</VerticalAlign></ColumnStyle><ColumnStyle Index="9" class="FarPoint.Web.Spread.StyleInfo"><HorizontalAlign>Center</HorizontalAlign><VerticalAlign>Middle</VerticalAlign></ColumnStyle></ColumnStyles><CellStyles><CellStyle Row="0" Column="0" class="FarPoint.Web.Spread.StyleInfo"><HorizontalAlign>Center</HorizontalAlign></CellStyle><CellStyle Row="0" Column="10" class="FarPoint.Web.Spread.StyleInfo"><HorizontalAlign>Center</HorizontalAlign><VerticalAlign>Middle</VerticalAlign></CellStyle></CellStyles><ConditionalFormatCollections /></DataArea></StyleModels><MessageRowStyle class="FarPoint.Web.Spread.Appearance"><BackColor>LightYellow</BackColor><ForeColor>Red</ForeColor></MessageRowStyle><SheetCornerStyle class="FarPoint.Web.Spread.NamedStyle" Parent="HeaderDefault"><BackColor>SteelBlue</BackColor><Border class="FarPoint.Web.Spread.Border" Size="1"><Bottom Color="#dedfde" Style="Solid" /><Right Color="#dedfde" Style="Solid" /></Border><ForeColor>White</ForeColor></SheetCornerStyle><AllowLoadOnDemand>false</AllowLoadOnDemand><LoadRowIncrement >10</LoadRowIncrement ><LoadInitRowCount >30</LoadInitRowCount ><TopRow>0</TopRow></Presentation><Settings><Name>Sheet1</Name><Categories><Appearance><ColumnHeaderAutoText>Blank</ColumnHeaderAutoText><SelectionBorder class="FarPoint.Web.Spread.Border" /><SelectionForeColor>White</SelectionForeColor><SelectionBackColor>Lavender</SelectionBackColor><HeaderGrayAreaColor>Empty</HeaderGrayAreaColor><SelectionForeColor>White</SelectionForeColor><GridLineColor>#dedfde</GridLineColor></Appearance><Behavior><ageSize>100</PageSize><AllowPage>False</AllowPage><AllowSort>True</AllowSort><OperationMode>SingleSelect</OperationMode></Behavior><Layout><ColumnCount>11</ColumnCount><RowCount>1</RowCount><ColumnHeaderRowCount>1</ColumnHeaderRowCount><RowHeaderColumnCount>1</RowHeaderColumnCount></Layout></Categories><ColumnHeaderRowCount>1</ColumnHeaderRowCount></Settings></Sheet>"
                        GridLineColor="222, 223, 222" OperationMode="SingleSelect" PageSize="100" SelectionBackColor="Lavender"
                        SelectionForeColor="White" SheetName="Sheet1" ColumnHeaderAutoText="Blank">
                        <ColumnHeader AutoText="Blank" />
                    </FarPoint:SheetView>

jpg

jpg
回复 使用道具 举报
terry1434
高级会员   /  发表于:2010-12-24 10:17:00
地板
刚才我在vb代码里,显示检索结果前加了
FpSpread1.Sheets(0).Columns(SPR_COL.USE_KBN_NM).VerticalAlign = VerticalAlign.Middle
问题解决了,但是其他的列都没有设置这个属性却可以居中,为什么这最后一列就不行呢?
回复 使用道具 举报
gw0506
超级版主   /  发表于:2010-12-24 10:39:00
5#
你可以跟踪一下,别的列或者cell应该也设置了。默认值是NotSet,相当于Top。
回复 使用道具 举报
terry1434
高级会员   /  发表于:2010-12-24 11:22:00
6#
vb代码是我自己写的,没有对SPREAD进行任何格式化的操作,可能是客户提供的.asp页面没画好吧
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部