列非常多,横向篇幅非常长的表,怎么做续表?

photojjc 2005-02-05 10:44:07
列非常多,横向篇幅非常长的表,不想用纵向显示所有报表对象。据说可以用续表,那续表该如何建立呢?
...全文
952 12 打赏 收藏 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
nytony 2005-05-17
  • 打赏
  • 举报
回复
不知道,帮丁
wqjch 2005-05-15
  • 打赏
  • 举报
回复
rowCount Mod 4 = 0 这句话是我默认一页打5行,也就是只有这一页打印完了才强制换页.
如果你不是固定的行数的话,你可以用打印的有效高度儿判断
wqjch 2005-05-15
  • 打赏
  • 举报
回复

'=============================第一个单元格,画斜线和内容======================================================================================================
e.Graphics.DrawLine(Pens.Black, x + 40, y, x + FirstColumnWidth, y + 60)
e.Graphics.DrawLine(Pens.Black, x, y + 20, x + FirstColumnWidth, y + 60)
_RectangleF = New RectangleF(x + 66, y + 6, 130, 60)
e.Graphics.DrawString("衣服颜色", tableFont, Brushes.Black, _RectangleF)
_RectangleF = New RectangleF(x + 3, y + 2, 40, 19)
e.Graphics.DrawString("物料", tableFont, Brushes.Black, _RectangleF)
_RectangleF = New RectangleF(x + 30, y + 15, 40, 60)
e.Graphics.DrawString("颜色", tableFont, Brushes.Black, _RectangleF)
_RectangleF = New RectangleF(x + 2, y + 44, 40, 60)
e.Graphics.DrawString("部位", tableFont, Brushes.Black, _RectangleF)
_RectangleF = New RectangleF(x + 43, y + 44, 80, 60)
e.Graphics.DrawString("物料", tableFont, Brushes.Black, _RectangleF)

'=====================================画边框==================================================
'画第一列
For i = 0 To _FirstColumnHeight.Length - 1
_RectangleF = New RectangleF(y, x, _FirstColumnHeight(i), FirstColumnWidth)
e.Graphics.DrawRectangle(Pens.Black, _RectangleF.Top, _RectangleF.Left, _RectangleF.Height, _RectangleF.Width)
y += _FirstColumnHeight(i)
Next

x = _left + FirstColumnWidth
y = _top + CON_SPACE_CAPTION_TOP + CON_SPACE_HEADER_BODY

'画第二列以上
If _Widths.Length > 0 Then
For i = 0 To _Height.Length - 1
For j = 1 To _Widths.Length - 1
_RectangleF = New RectangleF(y, x, _Height(i), _Widths(j))
e.Graphics.DrawRectangle(Pens.Black, _RectangleF.Top, _RectangleF.Left, _RectangleF.Height, _RectangleF.Width)
x += _Widths(j)
Next
y += _Height(i)
x = _left + FirstColumnWidth
Next
End If

'========================================添加数据=====================================
'添加列标题(衣服颜色)
_Align.Alignment = StringAlignment.Center
x = _left + FirstColumnWidth
y = _top + CON_SPACE_CAPTION_TOP + CON_SPACE_HEADER_BODY + _Height(0) / 3

If dtCross.Columns.Count > 2 Then
For j = CurrentColumn - 1 To dtCross.Columns.Count - 2
If j > GColumnCount * GColumnCounts Then
Exit For
End If
_RectangleF = New RectangleF(x, y, _Widths(1), _Height(0))
Me.DrawText(dtCross.Columns(j + 1).ColumnName, tableFont, e.Graphics, _RectangleF, _Align)
x += _Widths(1)
Next
End If

'添加部位、物料、物料颜色等的
x = _left
y = _top + CON_SPACE_CAPTION_TOP + CON_SPACE_HEADER_BODY + _Height(0)

If _isForceToChangePage Then
rowCount = initRowCount
End If

Do While dtCross.Rows.Count > rowCount
rowCount += 1
_RectangleF = New RectangleF(x, y, FirstColumnWidth, _FirstColumnHeight(1))
Me.DrawText(dtCross.Rows(rowCount - 1).Item("Description") & "--" & dtCross.Rows(rowCount - 1).Item("MatType"), tableFont, e.Graphics, _RectangleF, _Align)
x = _left + FirstColumnWidth
For j = CurrentColumn - 1 To dtCross.Columns.Count - 2
If j > GColumnCount * GColumnCounts Then
Exit For
End If
Dim _RectangleF1 As RectangleF = New RectangleF(x, y, _Widths(1), _Height(0))
Me.DrawText(dtCross.Rows(rowCount - 1).Item(j + 1).ToString, tableFont, e.Graphics, _RectangleF1, _Align)
x += _Widths(1)
Next

x = _left
y += _FirstColumnHeight(1)

'强制换页
If rowCount Mod 4 = 0 AndAlso dtCross.Columns.Count - 2 > GColumnCount * GColumnCounts Then
CurrentColumn = j + 1
GColumnCounts += 1
initRowCount = rowCount - 4
_isForceToChangePage = True
e.HasMorePages = True
Exit Sub
ElseIf rowCount Mod 4 = 0 Then
Exit Do
End If
Loop

'强制换页
'当它打印到最后的行时,但还有列需要换页打印
If dtCross.Rows.Count <= rowCount Then
If dtCross.Columns.Count - 2 > GColumnCount * GColumnCounts Then
_islastPage = True
CurrentColumn = j + 1
GColumnCounts += 1
initRowCount = rowCount - (rowCount Mod 4)
_isForceToChangePage = True
e.HasMorePages = True
Exit Sub
End If
End If

'正常的换页
If rowCount Mod 4 = 0 And dtCross.Rows.Count > rowCount And Not _islastPage Then
_isForceToChangePage = False
CurrentColumn = 2
GColumnCounts = 1
e.HasMorePages = True
Else
e.HasMorePages = False
End If

Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

#End Region

我是默认打印7列的,但思路是一样的,希望对你有所帮助.
wqjch 2005-05-15
  • 打赏
  • 举报
回复
我做过,就是强制换页
思路如下:
检测当前的所有列宽度是否大于要打印的有效宽度,如果大于而且还有剩下要打印的列,就记下当前的列和行,然后强制换页

下面的代码你参考一下吧:
Dim _islastPage As Boolean = False '是否是最后一页
Dim initRowCount As Integer = 0 '强制换页时的当前行
Dim _isForceToChangePage As Boolean = False '识别该页是否被强制换页
Dim GColumnCounts As Integer = 1 'dtCross的列数是GColumnCount的几倍
Dim CurrentColumn As Integer = 2 '当前列,dtCross默认有两列(description和MatType),所以当前列设置为从第三列开始(以0开始计算)
Const FirstColumnWidth As Integer = 130 '第一单格的宽度
Dim GColumnCount As Integer = 7 '默认是打印7列


#Region "打印事件"

Private Sub ppd_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles pd.PrintPage
Dim i As Integer
Dim j As Integer
Dim _top As Integer
Dim _left As Integer

Try

If g Is Nothing Then
g = e.Graphics
End If

_left = Me.pd.DefaultPageSettings.Margins.Left
_top = Me.pd.DefaultPageSettings.Margins.Top

x = _left
y = _top

'===================================画标题=================================================================
_Align.Alignment = StringAlignment.Center
_RectangleF = New RectangleF(0, y, Me.pd.DefaultPageSettings.PaperSize.Height, Me.pd.DefaultPageSettings.PaperSize.Width)
e.Graphics.DrawString("物料使用对照表", titleFont, Brushes.Black, _RectangleF, _Align)

y += CON_SPACE_CAPTION_TOP

'====================================TOP====================================================================
_Align.Alignment = StringAlignment.Near
Dim space As Integer = _width / 3
_RectangleF = New RectangleF(x, y, space, Me.pd.DefaultPageSettings.PaperSize.Height)
Me.DrawText("客户:", tableFont, e.Graphics, _RectangleF, _Align)

_RectangleF = New RectangleF(x + _width / 2, y, space, Me.pd.DefaultPageSettings.PaperSize.Height)
Me.DrawText("款号:", tableFont, e.Graphics, _RectangleF, _Align)

_RectangleF = New RectangleF(x + _width / 5 * 4, y, space, Me.pd.DefaultPageSettings.PaperSize.Height)
Me.DrawText("办单号:", tableFont, e.Graphics, _RectangleF, _Align)

If dtTop.Rows.Count > 0 Then
Dim _textWidth As Integer
With dtTop.Rows(0)
_textWidth = e.Graphics.MeasureString("客户:", tableFont).Width
_RectangleF = New RectangleF(x + _textWidth, y, space, Me.pd.DefaultPageSettings.PaperSize.Height)
Me.DrawText(dtTop.Rows(0).Item("BuyerName").ToString, tableFont, e.Graphics, _RectangleF, _Align)

_textWidth = e.Graphics.MeasureString("款号:", tableFont).Width
_RectangleF = New RectangleF(x + _width / 2 + _textWidth, y, space, Me.pd.DefaultPageSettings.PaperSize.Height)
Me.DrawText(dtTop.Rows(0).Item("StyleNo").ToString, tableFont, e.Graphics, _RectangleF, _Align)

_textWidth = e.Graphics.MeasureString("办单号:", tableFont).Width
_RectangleF = New RectangleF(x + _width / 5 * 4 + _textWidth, y, space, Me.pd.DefaultPageSettings.PaperSize.Height)
Me.DrawText(dtTop.Rows(0).Item("sampleNO").ToString, tableFont, e.Graphics, _RectangleF, _Align)
End With
End If

y += CON_SPACE_HEADER_BODY

'一贴写不下,再接下面一贴
SeeSunSet 2005-05-03
  • 打赏
  • 举报
回复
大就大呗.用A3的纸打印.
lupenda 2005-04-28
  • 打赏
  • 举报
回复
顶啊,等待高手解答
tangxiaogang510 2005-03-02
  • 打赏
  • 举报
回复
你有好多列嘛,有没有50列?关于多列、动态列和动态显示数据的问题我正在研究,有一点点起色了,便还不完善,我的报表竖向线条现在还没有控制好,你现在做成什么样子?
李环汀 2005-02-18
  • 打赏
  • 举报
回复
我也曾经遇到过,不过我用了pb,datawindow可以实现
pcdogyu 2005-02-18
  • 打赏
  • 举报
回复
cross-table
anmeier 2005-02-18
  • 打赏
  • 举报
回复
我也遇到同样的问题,等待高人..........
photojjc 2005-02-16
  • 打赏
  • 举报
回复
顶顶
hedonister 2005-02-09
  • 打赏
  • 举报
回复
up
代码转载自:https://pan.quark.cn/s/a4b39357ea24 自动驾驶是当前科技界高度关注的研究方向,其研究范畴涵盖了人工智能、计算机视觉、机器学习以及传感器融合等多个重要学科。这份题为"自动驾驶论文"的资料,无疑为人们提供了一个深入了解这一复杂系统的机会。以下是基于其标题和描述所呈现的一些关键知识点的详细阐述: 1. **自动驾驶技术**:自动驾驶指的是车辆在无需人类驾驶员参与的情况下,借助各类传感器和智能算法来感知周围环境,制定行驶路线,并执行驾驶行为。这种技术的核心宗旨在于提升交通安全性、缓解交通压力,并改善出行体验。 2. **Python编程语言**:Python是一种在数据处理和科学计算领域得到广泛应用的高级编程语言,由于其语法简洁且拥有丰富的库支持,经常被应用于自动驾驶领域的数据处理、模型构建和系统集成。 3. **源代码分析**:论文中提供的源代码可能包含了自动驾驶算法的实现细节,可能涵盖环境感知模块(包括图像处理、激光雷达数据解读)、决策模块(涉及路径规划、行为分析)、控制模块(涵盖车辆动力学建模、控制策略设计)等,这些代码可作为学习和研究自动驾驶算法的实践范例。 4. **计算机视觉**:自动驾驶系统中的计算机视觉技术主要用于识别道路标识、行人、其他车辆等,这通常涉及图像分类、目标识别和语义分割等任务,常见的技术包括卷积神经网络(CNN)、区域提议网络(RPN)、YOLO、Faster R-CNN等。 5. **机器学习**:机器学习是自动驾驶技术的核心,用于训练模型以理解和预测复杂的驾驶情境。深度学习,特别是深度强化学习,在决策制定和控制策略方面已取得显著进展。 6. **传感器融合**:自动驾驶汽车通常装备多种传...
内容概要:本文提出了一种改进的多旋翼无人机动态模拟的模块化仿真环境,基于Matlab/Simulink平台实现。该仿真环境通过模块化设计,集成了无人机的气动模型、动力系统模型、传感器模型及控制算法等多个关键子系统,能够精确模拟多旋翼无人机在复杂飞行条件下的动态响应特性。系统改进之处在于增强了模型的真实性和可扩展性,优化了仿真计算效率,并支持硬件在环(HIL)测试,便于控制算法的快速原型验证与迭代开发。该环境不仅可用于无人机飞控算法的设计与验证,也可服务于飞行器性能评估、故障诊断与容错控制等研究。; 适合人群:具备一定控制理论基础和Matlab/Simulink使用经验的高校研究生、科研机构研究人员及无人机相关领域的工程技术人员。; 使用场景及目标:①用于多旋翼无人机飞行动力学建模与仿真分析;②支持先进飞行控制算法(如PID、LQR、MPC、自适应控制等)的开发与验证;③作为教学工具帮助学生理解无人机系统构成与控制原理;④为无人机产品开发提供前期仿真测试平台,降低实飞风险与研发成本。; 阅读建议:建议读者结合Matlab/Simulink环境动手实践,逐步搭建并调试各个模块,重点关注各子系统间的接口关系与数据交互逻辑。同时可参考文中提供的仿真案例,深入理解参数设置对系统动态性能的影响,进而开展个性化功能扩展与算法创新。

4,818

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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