Problems with BackgroundPatternColor and LineStyle


#1

This is a large project I am working on -

The basic problem I am having is - some of the lines in my table come out invisible whenever I specify "backColor" = "Color.White." Using Color.Transparent turns the backgroundColor to black.

Furthermore - this is only noticable when the document is printed - viewing in Word doesn't show the problem.. I have included the attachment.

Is there something I am doing wrong? Can you please correct me if so?

BTW - most table construction is handled via this routine:

public void InsertCell(string value,

double width,

bool isHeader,

double indentLevel,

ParagraphAlignment alignment,

Color backColor,

Color fontColor,

short fontSize,

bool isBold,

string fontName

)

{

_documentBuilder.InsertCell();

_documentBuilder.CellFormat.Borders.ClearFormatting();

_documentBuilder.Font.ClearFormatting();

_documentBuilder.ParagraphFormat.ClearFormatting();

if(IsGridVisible)

{

_documentBuilder.CellFormat.Borders[BorderType.Top].LineStyle =

LineStyle.Single;

_documentBuilder.CellFormat.Borders[BorderType.Bottom].LineStyle =

LineStyle.Single;

_documentBuilder.CellFormat.Borders[BorderType.Left].LineStyle =

LineStyle.Single;

_documentBuilder.CellFormat.Borders[BorderType.Right].LineStyle =

LineStyle.Single;

}

else

{

_documentBuilder.CellFormat.Borders[BorderType.Top].LineStyle =

LineStyle.None;

_documentBuilder.CellFormat.Borders[BorderType.Bottom].LineStyle =

LineStyle.None;

_documentBuilder.CellFormat.Borders[BorderType.Left].LineStyle =

LineStyle.None;

_documentBuilder.CellFormat.Borders[BorderType.Right].LineStyle =

LineStyle.None;

}

_documentBuilder.Font.Bold = isBold;

_documentBuilder.Font.Name = fontName;

_documentBuilder.Font.Size = fontSize;

if(width > 0)

{

_documentBuilder.CellFormat.Width = width;

}

_documentBuilder.ParagraphFormat.LeftIndent = indentLevel;

_documentBuilder.ParagraphFormat.Alignment = alignment;

_documentBuilder.CellFormat.TopPadding = 3;

_documentBuilder.CellFormat.BottomPadding = 3;

_documentBuilder.RowFormat.HeadingFormat = isHeader;

_documentBuilder.CellFormat.Shading.BackgroundPatternColor =

backColor;

_documentBuilder.Font.Color = fontColor;

_documentBuilder.Write(value.ToString());

}


#2

Sorry - bumping for response...


#3

Please give me one more day for research.


#4

Take your time - I apologize for the bump I just wanted to ensure it wasnt overlooked.. Thanks.


#5

Have you tried using Color.Empty instead?


#6

I have now - works great for Aspose.Words - thanks a bunch.