分页符rtfcontrster windows应用程序C# [英] Page break rtfcontrster windows application C#

查看:88
本文介绍了分页符rtfcontrster windows应用程序C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Actually i am printing MSSQL Data to RTF(Word) Using c# Class file. And i want to break page  and new page using code, For ex-If i want to give a title of a Word Document on first page and than want to write some description in next page. So that's the exactly problem, All data printing in 1st page .<pre>
 I Want to This Code Use Page Break This Code Argent 

<pre>RtfTable tb = new RtfTable(RtfTableAlign.Center, 3, 1);
tb.Width = TwipConverter.ToTwip(24, MetricUnit.Centimeter);
tb.Columns[0].Width = TwipConverter.ToTwip(2, MetricUnit.Centimeter);
tb.Columns[1].Width = TwipConverter.ToTwip(12, MetricUnit.Centimeter);
tb.Columns[2].Width = TwipConverter.ToTwip(4, MetricUnit.Centimeter);
tb[0, 0].Definition.Style = new RtfTableCellStyle(RtfBorderSetting.None, Centered10, RtfTableCellVerticalAlign.Top, RtfTableCellTextFlow.LeftToRightTopToBottom);
tb[0, 0].AppendText(new RtfFormattedText("Ref. No.", RtfCharacterFormatting.Bold));
tb[1, 0].Definition.Style = new RtfTableCellStyle(RtfBorderSetting.None, Centered10, RtfTableCellVerticalAlign.Top, RtfTableCellTextFlow.LeftToRightTopToBottom);
tb[1, 0].AppendText(new RtfFormattedText(RtfDataFile.RefNo, RtfCharacterFormatting.Bold));
// tb[2, 0].Definition.Style = new RtfTableCellStyle(RtfBorderSetting.None, Centered10, RtfTableCellVerticalAlign.Top, RtfTableCellTextFlow.LeftToRightTopToBottom);
tb[2, 0].Definition.Style = new RtfTableCellStyle(RtfBorderSetting.None, LeftAligned12, RtfTableCellVerticalAlign.Top);
//string dtimeval = RtfDataFile.DateValuation;
//string dtmeval1 = dtimeval = ("yyyy-MM-dd");
string valDate = string.Empty;
string format = "dd-MM-yyyy";
valDate = RtfDataFile.DateValuation.ToString(format);
string InsDate = string.Empty;
string format1 = "dd-MM-yyyy";
InsDate = RtfDataFile.DateInspection.ToString(format1);
tb.DefaultCellStyle = new RtfTableCellStyle(RtfBorderSetting.None, Centered10);
tb[2, 0].AppendText(new RtfFormattedText("Dated-" + (valDate), RtfCharacterFormatting.Bold));
tb[2, 0].AppendParagraph(new RtfFormattedText("", RtfCharacterFormatting.Bold));
tb[2, 0].AppendParagraph(new RtfFormattedText("", RtfCharacterFormatting.Bold));
RtfTable TblVal = new RtfTable(RtfTableAlign.Center, 1, 1);
TblVal.Width = TwipConverter.ToTwip(23, MetricUnit.Centimeter);
TblVal.Columns[0].Width = TwipConverter.ToTwip(19, MetricUnit.Centimeter);
TblVal.DefaultCellStyle = new RtfTableCellStyle(RtfBorderSetting.None, Centered10);
TblVal[0, 0].Definition.Style = new RtfTableCellStyle(RtfBorderSetting.None, LeftAligned12, RtfTableCellVerticalAlign.Center);





我尝试过:



嗨Sir Argent需要回答请给出解决方案



What I have tried:

Hi Sir Argent require Answer Please Give Solution

推荐答案

您是否尝试过使用\\page标记?
Have you tried using the \\page tag ?


这篇关于分页符rtfcontrster windows应用程序C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆