SetDefaultColWidth,SetCellTextStyle不起作用啊

xlt771111 2002-03-20 10:57:58
SetDefaultColWidth定义列宽怎么不起作用,还有SetCellTextStyle定义自动换行也不行,兄弟们给个答复啊,还有cell同志,跑哪里去了?
...全文
245 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
xlt771111 2002-03-20
  • 打赏
  • 举报
回复
还是不行啊,老兄,GetColBestWidth可以把列宽值取出来,但SetColWidth设宽度没有用,你帮我看一下http://highway.dns2go.com:8030
用户名:xlt 密码:76114
Cell 2002-03-20
  • 打赏
  • 举报
回复
来了,来了!!
用GetColBestWidth先得到一个值,在用SetColWidth将宽度设上去。
要是太宽的话,用SetCellTextStyle将单元格设为自动换行,用GetRowBestHeight获得最佳的高度,再用SetRowHeight将高度设上就可以了。
xlt771111 2002-03-20
  • 打赏
  • 举报
回复
谢谢,已经解决了
whitecell 2002-03-20
  • 打赏
  • 举报
回复
既然设置了SetCellTextStyle为自动换行的话,还要麻烦您设置一下SetRowHeight,其实SetColWidth 就没什么用了。
例子1:
Cell1.SetColWidth 1, Cell1.GetColBestWidth(1), 1, 0
Cell1.ReDraw
例子2:
Cell1.SetCellTextStyle 1, 1, 0, 2
Cell1.SetRowHeight 1, Cell1.GetRowBestHeight(1), 1, 0
Cell1.ReDraw
VB使着方便,所以我没用VBS,抱歉!
xlt771111 2002-03-20
  • 打赏
  • 举报
回复
刚才机器重启了,现在可以了
xlt771111 2002-03-20
  • 打赏
  • 举报
回复
我的代码如下,请看一下:
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub button1_onclick
'form1.submit()
<%if count>0 then%>
DCellWeb1.setrows <%=count+2%>,0
DCellWeb1.SetCellTextStyle 5,49,1,2
DCellWeb1.PrintSetHead "" ,"日常事务纪录" ,""
DCellWeb1.PrintSetFoot "","日常事务纪录",""
DCellWeb1.S 1,1,"日期"
DCellWeb1.S 3,1,"发生事项"
DCellWeb1.S 5,1,"处理结果"
DCellWeb1.S 5,49,"处理结果"

<%for i=2 to count+2%>
'DCellWeb1.SetCellTextStyle 1,<%=i%>,1,2
'DCellWeb1.SetCellTextStyle 3,<%=i%>,1,2
'DCellWeb1.SetCellTextStyle 5,<%=i%>,1,2

DCellWeb1.S 1,<%=i%>,"<%=trim(s0(i-2))%>"
DCellWeb1.S 3,<%=i%>,"<%=trim(s1(i-2))%>"
DCellWeb1.S 5,<%=i%>,"<%=trim(s2(i-2))%>"
<%next%>
'DCellWeb1.readonly=true
colwidth1=DCellWeb1.GetColBestWidth(1)
colwidth3=DCellWeb1.GetColBestWidth(3)
colwidth5=DCellWeb1.GetColBestWidth(5)
'msgbox(colwidth3)
DCellWeb1.SetColWidth 1,colwidth1,1,1
DCellWeb1.SetColWidth 1,colwidth3,3,1
DCellWeb1.SetColWidth 1,colwidth5,5,1


DCellWeb1.PrintRange 0,0,0,0
DCellWeb1.PrintPara 1,1,1,1
DCellWeb1.PrintLabel 0,0
DCellWeb1.PrintPreview 1,DCellWeb1.GetCurSheet
<%else%>
msgbox("暂无纪录!")
<%end if%>
End Sub

Sub button2_onclick
DCellWeb1.PrintSheet 1,DCellWeb1.GetCurSheet
End Sub

-->
</SCRIPT>
Cell 2002-03-20
  • 打赏
  • 举报
回复
我上不去啊,还是来电话吧,010-68498479-107

256

社区成员

发帖
与我相关
我的任务
社区描述
其他产品/厂家
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧