ActiveReport2中,如果字段内容因过长分行显示时,画在旁边的竖线却不会自动延长,怎么办?

asdf12369874 2003-10-17 11:43:53
ActiveReport2中,如果字段内容因过长分行显示时,画在旁边的竖线却不会自动延长,怎么办?
表格线是这样画的吗?
怎么不能像水晶中那样跨节来画
...全文
74 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
y1g1y1 2003-12-23
  • 打赏
  • 举报
回复
http://ygyuan.yeah.net/
源代码.
kuanghai 2003-10-20
  • 打赏
  • 举报
回复
得到长度:
Function CountWord(Optional word As String) As Integer
Dim i, j As Integer
i = 0
For j = 1 To Len(word)
If Asc(Mid(word, j, 1)) < 0 Then i = i + 1
i = i + 1
Next
CountWord = i
End Function

以动态添加标题为例

Private Sub ActiveReport_ReportStart()
With ReportHeader.Controls
Set ctl = .Add("DDActiveReports2.Field")
ctl.Text = RepTitle
ctl.Font.Size = 30
ctl.width = (CountWord(ctl.Text) + 1) * 10 * ctl.Font.Size
ctl.Left = (9025 - ctl.width) / 2
ctl.Top = 0
ctl.Font.Bold = True
ctl.Font.Italic = True
ctl.Font.Name = "宋体"
ctl.ForeColor = &H800000
End With
Me.Caption = RepTitle
TxtDate.Text = format(Now, "yyyy-mm-dd hh:nn")
End Sub


不知道你明白了没有?

顺带问一句:你有没有ActiveReport2 for net的正式版?
asdf12369874 2003-10-19
  • 打赏
  • 举报
回复
具体怎么做?在哪个事件里?怎么得到内容长度?有没代码
kuanghai 2003-10-17
  • 打赏
  • 举报
回复
ActiveReport2的动态作的很好,我的方法是在写的时候得到内容的长度,动态调整宽度!

效果很好!哈哈!
asdf12369874 2003-10-17
  • 打赏
  • 举报
回复
up

6,108

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 数据库报表
社区管理员
  • 数据库报表社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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