Skip to content

Commit

Permalink
rdlcreator, support border styles
Browse files Browse the repository at this point in the history
  • Loading branch information
majorsilence committed Feb 8, 2025
1 parent 5722218 commit 2bcd1da
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 8 deletions.
89 changes: 82 additions & 7 deletions RdlCreator.Tests/ManualReportDefinitionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,21 +223,96 @@ private RdlCreator.Report GenerateTestData()
Height = "35.91mm",
CustomProperties = new CustomProperties
{

CustomProperty = new CustomProperty()
{
Name = "QrCode",
Value = "=Fields!CategoryID.Value"
}
}
},
CanGrow="true",
Style = new Style
{
BorderStyle= new BorderStyle
{
Default="None",
Bottom="Solid"
},
BorderColor=new BorderColor
{
Bottom = "Gray"
},
BorderWidth= new BorderWidth
{
Bottom="1pt"
}

}
}
}
},
new TableCell { ReportItems = new TableCellReportItems(){ ReportItem = new Textbox { Name = "CategoryName",
Value = new Value { Text = "=Fields!CategoryName.Value" }, CanGrow = "true" } } },
new TableCell { ReportItems= new TableCellReportItems(){ ReportItem = new Textbox { Name = "Description",
Value = new Value { Text = "=Fields!Description.Value" }, CanGrow = "true" } } }

new TableCell
{
ReportItems = new TableCellReportItems()
{
ReportItem = new Textbox {
Name = "CategoryName",
Value = new Value
{
Text = "=Fields!CategoryName.Value"
},
CanGrow = "true",
Style = new Style
{
BorderStyle= new BorderStyle
{
Default="None",
Bottom="Solid"
},
BorderColor=new BorderColor
{
Bottom = "Gray"
},
BorderWidth= new BorderWidth
{
Bottom="1pt"
}

}
}
}
},
new TableCell
{
ReportItems= new TableCellReportItems()
{
ReportItem = new Textbox
{
Name = "Description",
Value = new Value
{
Text = "=Fields!Description.Value"
},
CanGrow = "true",
Style = new Style
{
BorderStyle= new BorderStyle
{
Default="None",
Bottom="Solid"
},
BorderColor=new BorderColor
{
Bottom = "Gray"
},
BorderWidth= new BorderWidth
{
Bottom="1pt"
}

}
}
}
}
}
}
}
Expand Down
19 changes: 19 additions & 0 deletions RdlCreator/BorderColor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Xml.Serialization;

namespace Majorsilence.Reporting.RdlCreator
{
public class BorderColor
{
[XmlElement(ElementName = "Bottom")]
public string Bottom { get; set; }

[XmlElement(ElementName = "Top")]
public string Top { get; set; }

[XmlElement(ElementName = "Left")]
public string Left { get; set; }

[XmlElement(ElementName = "Right")]
public string Right { get; set; }
}
}
29 changes: 29 additions & 0 deletions RdlCreator/BorderStyle.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Xml.Serialization;

namespace Majorsilence.Reporting.RdlCreator
{
public class BorderStyle
{
[XmlElement(ElementName = "Default")]
public string Default { get; set; }

[XmlElement(ElementName = "Left")]
public string Left { get; set; }

[XmlElement(ElementName = "Right")]
public string Right { get; set; }

[XmlElement(ElementName = "Top")]
public string Top { get; set; }

[XmlElement(ElementName = "Bottom")]
public string Bottom { get; set; }

public static class Values
{
public const string None = "None";
public const string Solid = "Solid";
public const string Dashed = "Dashed";
}
}
}
19 changes: 19 additions & 0 deletions RdlCreator/BorderWidth.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Xml.Serialization;

namespace Majorsilence.Reporting.RdlCreator
{
public class BorderWidth
{
[XmlElement(ElementName = "Top")]
public string Top { get; set; }

[XmlElement(ElementName = "Bottom")]
public string Bottom { get; set; }

[XmlElement(ElementName = "Left")]
public string Left { get; set; }

[XmlElement(ElementName = "Right")]
public string Right { get; set; }
}
}
4 changes: 4 additions & 0 deletions RdlCreator/CustomReportItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ public class CustomReportItems

[XmlElement(ElementName = "CustomProperties")]
public CustomProperties CustomProperties { get; set; }
[XmlElement(ElementName = "Style")]
public Style Style { get; set; }
[XmlElement(ElementName = "CanGrow")]
public string CanGrow { get; set; }
}
}
11 changes: 10 additions & 1 deletion RdlCreator/Style.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Xml.Serialization;


namespace Majorsilence.Reporting.RdlCreator
{
public class Style
Expand All @@ -13,5 +12,15 @@ public class Style

[XmlElement(ElementName = "TextAlign")]
public string TextAlign { get; set; }

[XmlElement(ElementName = "BorderStyle")]
public BorderStyle BorderStyle { get; set; }

[XmlElement(ElementName = "BorderColor")]
public BorderColor BorderColor { get; set; }

[XmlElement(ElementName = "BorderWidth")]
public BorderWidth BorderWidth { get; set; }

}
}

0 comments on commit 2bcd1da

Please sign in to comment.