diff --git a/Examples/DocsExamples/PluginsExamples/ProcessorXlsxFilesPlugin.cs b/Examples/DocsExamples/PluginsExamples/ProcessorXlsxFilesPlugin.cs index 3480afda8..7147c24c3 100644 --- a/Examples/DocsExamples/PluginsExamples/ProcessorXlsxFilesPlugin.cs +++ b/Examples/DocsExamples/PluginsExamples/ProcessorXlsxFilesPlugin.cs @@ -1,30 +1,49 @@ using Aspose.Words.Drawing.Charts; using Aspose.Words; using NUnit.Framework; +using Aspose.Words.Tables; +using System.Drawing; namespace PluginsExamples { public class ProcessorXlsxFilesPlugin : PluginsExamplesBase { [Test] - public void CreateChartXlsxFiles() + public void CreateTableXlsxFiles() { - //ExStart:CreateChartXlsxFiles + //ExStart:CreateTableXlsxFiles //GistId:e57f464b45000561f7792eef06161c11 var doc = new Document(); var builder = new DocumentBuilder(doc); + + builder.StartTable(); + builder.ParagraphFormat.Alignment = ParagraphAlignment.Center; + builder.CellFormat.Shading.BackgroundPatternColor = Color.AliceBlue; - var shape = builder.InsertChart(ChartType.Pie, 432, 252); - var chart = shape.Chart; - chart.Title.Text = "Produced by Aspose.Words Processor plugin."; + for (int i = 0; i < 3; i++) + { + builder.InsertCell(); + builder.Write($"Row {i + 1}, Column 1"); + builder.InsertCell(); + builder.Write($"Row {i + 1}, Column 2"); - chart.Series.Clear(); - chart.Series.Add("Series 1", - new string[] { "Category 1", "Category 2", "Category 3" }, - new double[] { 2.7, 3.2, 0.8 }); + Row row = builder.EndRow(); - doc.Save(ArtifactsDir + "ProcessorXlsxFilesPlugin.CreateChartXlsxFiles.xlsx"); - //ExEnd:CreateChartXlsxFiles + builder.CellFormat.Shading.ClearFormatting(); + + BorderCollection borders = row.RowFormat.Borders; + // Adjust the appearance of borders that will appear between rows. + borders.Horizontal.Color = Color.Red; + borders.Horizontal.LineStyle = LineStyle.Dot; + borders.Horizontal.LineWidth = 2.0d; + // Adjust the appearance of borders that will appear between cells. + borders.Vertical.Color = Color.Blue; + borders.Vertical.LineStyle = LineStyle.Dot; + borders.Vertical.LineWidth = 2.0d; + } + + doc.Save(ArtifactsDir + "ProcessorXlsxFilesPlugin.CreateTableXlsxFiles.xlsx"); + //ExEnd:CreateTableXlsxFiles } } }