xceedsoftware / DocX

Fast and easy to use .NET library that creates or modifies Microsoft Word files without installing Word.
Other
1.77k stars 471 forks source link

Can set Cell's Shading color but not Shading pattern #264

Open brahmb opened 6 years ago

brahmb commented 6 years ago

Hallo

I'm able to set the shade color on a word table but I was unable to set the fill pattern.

Based on the following research I determined it is not possible. Please advise if there is an alternative way or a solution in hand?

  1. Added example for manipulating a row as pattern in a table. #24 https://github.com/xceedsoftware/DocX/pull/24

  2. DocX/Examples/Samples/Table/TableSample.cs https://github.com/xceedsoftware/DocX/blob/master/Examples/Samples/Table/TableSample.cs

  3. DocX/Xceed.Words.NET/Src/Paragraph.cs https://github.com/xceedsoftware/DocX/blob/master/Xceed.Words.NET/Src/Paragraph.cs

  4. Visual Studio Meta Data - Could not find "ShadingType"

    region Assembly Xceed.Words.NET, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4

    // C:\Source\Research and Development\Brahm\BB-2018-06-25-TYME Data Merge-branch\TymeDataMerge\TymeDataMergeSolution\packages\DocX.1.2.0\lib\Xceed.Words.NET.dll

    endregion

using System.Collections.ObjectModel; using System.Drawing;

namespace Xceed.Words.NET { public class Cell : Container { public override ReadOnlyCollection Paragraphs { get; } public VerticalAlignment VerticalAlignment { get; set; } public Color Shading { get; set; } public double Width { get; set; } public double MarginLeft { get; set; } public double MarginRight { get; set; } public double MarginTop { get; set; } public double MarginBottom { get; set; } public Color FillColor { get; set; } public TextDirection TextDirection { get; set; } public int GridSpan { get; }

    public Border GetBorder(TableCellBorderType borderType);
    public override Table InsertTable(int rowCount, int columnCount);
    public void SetBorder(TableCellBorderType borderType, Border border);
}

} Your help would be appreciated.

Kind regards Brahm

XceedBoucherS commented 5 years ago

Hi, Yes, currently only the fill color of the shading is implemented. The pattern and its color needs to be implemented. We will investigate on adding this feature. Thank you for reporting this.