定义了rpar段落对象 和 rt 表格文本,其中rpar段落对象为粗体 rt表格文本为一般字体,以下这段代码生成的文本为rpa和rt分别在两行,怎么能组合一行而且定义的字体不变。
'''
Dim doc As New PrintDoc '定义一个新报表
Dim tb As Table = Tables("财务报告")
For r As Integer = 0 To tb.Rows.Count -1 '开始填入该列内容
Dim rpar As New prt.RenderParagraph() '定义一个段落对象
Dim f As New Font("宋体",16,FontStyle.Bold) '定义一个同样但加粗的字体
rpar.Content.AddText(tb(r,0) & "、" & tb(r,1),f)
rpar.Style.TextIndent = 12 '首行缩进12毫米
rpar.Style.LineSpacing = 200 '设置双倍行距
rpar.Style.Spacing.Bottom = 4
Dim rt As New prt.RenderText '定义一个新表格
rt.Style.Font = tb.Font
rt.Style.TextIndent = 12 '首行缩进12毫米
rt.Style.LineSpacing = 200 '设置双倍行距
rt.Style.Font = New Font("宋体", 14) '设置字体
rt.Text = "销售金额" & tb(r,2) & "元,销售成本" & tb(r,3) & "元,销售费用" & tb(r,4) & "元," & iif(tb(r,5)=0,"","销售折扣" & tb(r,5)) & "元,销售税金" & tb(r,6) & "元,其他支出" & tb(r,7) & "元."
doc.Body.Children.Add(rpar)
doc.Body.Children.Add(rt) '将表格加入到报表 iff(tb(r,3)=0,"","元,集资情况_预付利息" & tb(r,3))
Next
doc.Preview()