Free Support Forum - aspose.com

Broken line in the cell border

Hi,

I am trying to produce a document similar to the one attached.we have problem in the top cell where the date and "give us your feedback" are displayed. In order to produce it, i m insering two cells one has the date and other has the "give us your feedback" in it. After generating it there break in the border (red line) in between the cells. can this break be avoided?

I m attaching the code used. please give us your valuble suggestion.

Thanks & regards,

Dowjones.

I cannot reproduce the error using your code, the latest version of Aspose.Words and MS Word 2003.

The screenshot of the resulting document print preview is attached.

Best regards,

Hi,

Border breaks will appear if you save the document as a .htm file (web page filtered). Close the saved htm file and again reopen it. you will see the border break. hope you got what the issue is.

any help in this regard would be of great help to us.

Thanks & Regards,

Dowjones.

If you will convert the generated document to HTML using MS Word, you will see the same problem with border break.

Why don't you use cell borders instead of paragraph borders? By this you will avoid the border break problems.

Best regards,

Hi,

We tried using cell borders, but it doesnt work. border itself is getting disappeared in the word document now.

if possible provide us with the sample code for producing the exact output as we need.

Thanks & regards,

Dowjones.

I have remastered your example with the use of the Cell borders:

DocumentBuilder builder = new DocumentBuilder(doc);

string sSectionID;

//Cognizant - Mar31 - Start

builder.StartTable();

Aspose.Words.CellFormat CF = builder.CellFormat;

Border bottomBorder = CF.Borders[Aspose.Words.BorderType.Bottom];

bottomBorder.Color = System.Drawing.Color.Red;

bottomBorder.LineStyle = Aspose.Words.LineStyle.Single;

bottomBorder.LineWidth = 1;

builder.InsertCell();

CF.Shading.BackgroundPatternColor = Color.FromArgb(217, 217, 217);

CF.Width = 245;

CF.RightPadding = 0;

CF.LeftPadding = 0;

builder.Font.Name = "Helvetica";

builder.Font.Size = 8;

builder.Write(" Week " + 23 + ", ");

builder.Write(DateTime.Now.ToString("MMMM yyyy"));

builder.ParagraphFormat.Alignment = Aspose.Words.ParagraphAlignment.Left;

builder.Font.Size = 0.5;

builder.Writeln("");

builder.Font.Size = 8;

builder.InsertCell();

CF.LeftPadding = 0;

CF.RightPadding = 0;

CF.Shading.BackgroundPatternColor = Color.FromArgb(217, 217, 217);

CF.Width = 245;

builder.ParagraphFormat.Alignment = Aspose.Words.ParagraphAlignment.Right;

builder.Font.Italic = true;

builder.Write("Give us your ");

builder.Font.Color = Color.Blue;

builder.Underline = Aspose.Words.Underline.Single;

builder.Font.UnderlineColor = Color.Blue;

builder.InsertHyperlink("Feedback","mailto:Helen.Vandebovenkamp@ge.com",false);

builder.Font.Italic = false;

builder.Font.Color = Color.Black;

builder.Font.UnderlineColor = Color.Black;

builder.Underline = Aspose.Words.Underline.None;

builder.Font.Size = 0.5;

builder.Writeln("");

builder.Font.Size = 8;

builder.EndRow();

builder.EndTable();

//Cognizant - Mar31 - End

//Cognizant - Mar31 - Start

builder.StartTable();

CF = builder.CellFormat;

bottomBorder = CF.Borders[Aspose.Words.BorderType.Bottom];

bottomBorder.LineStyle = Aspose.Words.LineStyle.None;

bottomBorder.LineWidth = 0;

builder.InsertCell();

CF.Width = 60;

builder.ParagraphFormat.Alignment = Aspose.Words.ParagraphAlignment.Left;

builder.Font.Name = "Helvetica";

builder.Font.Size = 8;

builder.Font.Italic = true;

builder.Write("In this Issue: ");

builder.Font.Italic = false;

//Cognizant - Mar31 - End

//Cognizant - Mar31 - Start

builder.InsertCell();

Aspose.Words.Border leftBorder = CF.Borders[Aspose.Words.BorderType.Left];

leftBorder.Color = System.Drawing.Color.Red;

leftBorder.LineStyle = Aspose.Words.LineStyle.Single;

leftBorder.LineWidth = 3;

CF.Width = 150;

CF.LeftPadding = 6;

builder.Font.Size = 10;

//Cognizant - Mar31 - End

The html output looks ok now.

Hi,

Thanks a lot for your valuble suggestion.

atlast we have got it right!

Thanks & Regards,

Dowjones.