Member 12942460 Ответов: 1

Разрыв страницы rtfcontrster windows application 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);


Что я уже пробовал:

Привет сэр Арджент требуйте ответа пожалуйста дайте решение

1 Ответов

Рейтинг:
7

Matt Comb

Вы пробовали использовать тег \\page ?