Dim doc As New PrintDoc '定义一个报表
Doc.PageSetting.Width = 202
Doc.PageSetting.Height = 280
Doc.PageSetting.LeftMargin = 10 '设置左边距
Doc.PageSetting.RightMargin = 10 '设置右边距
Doc.PageSetting.TopMargin = 20 '设置上边距
Doc.PageSetting.BottomMargin = 20 '设置下边距
Dim rt As New C1.C1Preview.RenderText '定义一个文本对象
Dim rt1 As New C1.C1Preview.RenderText '定义一个文本对象
rt.X = "Parent.left+10"
rt.Y = "Parent.Top+10"
rt.Width = 170 '对象宽度等于页面宽度
rt.Height = 230 '对象高度等于页面高度
rt.Style.Borders.All = New C1.C1Preview.Linedef(1.5, Color.Black) '设置边框
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt1.X = "Parent.left + 12"
rt1.Y = "Parent.Top + 12"
rt1.Width = 170 - 4 '对象宽度等于页面宽度
rt1.Height = 230 - 4 '对象高度等于页面高度
rt1.Style.Borders.All = New C1.C1Preview.Linedef(0.5, Color.Black) '设置边框
doc.Body.Children.Add(rt1) '将文本对象加入到报表
Dim rm As New prt.RenderEmpty
rm.BreakBefore = prt.BreakEnum.Page '打印前换页
doc.Body.Children.Add(rm) '加入到报表中
rt = New C1.C1Preview.RenderText '定义一个文本对象
rt1 = New C1.C1Preview.RenderText '定义一个文本对象
rt.Text = "9999"
rt.X = "Parent.left+10"
rt.Y = "Parent.Top+10"
rt.Width = 170 '对象宽度等于页面宽度
rt.Height = 230 '对象高度等于页面高度
rt.Style.Borders.All = New C1.C1Preview.Linedef(1.5, Color.Black) '设置边框
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt1.X = "Parent.left + 12"
rt1.Y = "Parent.Top + 12"
rt1.Width = 170 - 4 '对象宽度等于页面宽度
rt1.Height = 230 - 4 '对象高度等于页面高度
rt1.Style.Borders.All = New C1.C1Preview.Linedef(0.5, Color.Black) '设置边框
doc.Body.Children.Add(rt1) '将文本对象加入到报表
doc.Preview() '预览