当前位置:网站首页>动态RDLC报表(五)
动态RDLC报表(五)
2022-08-09 16:51:00 【xgh815】
动态RDLC报表类DynamicReport:数据表节点数据填充
数据表部分是最麻烦的,可以添加多个数据表,可以设置多维表头,可以设置多字段的统计行,不同的列可以采用不同的样式。在传入数据表前需要先传入列样式、多维表头,数据表和统计列是同一时间传入的,页眉和页脚则需要在数据表后传入。
在这里最多可以设置三行表头,从上到下依次是hearderTop、hearderMerge和数据表中的列。表头的样式包含如下几部分:
public string ColoumName { get; set; } //列名
public float ColoumWidth { get; set; } //列宽
public TextAlign TextAlign { get; set; } //对齐
public ConsoleColor ConsoleColor { get; set; } //颜色
public Boolean IsShortDate { get; set; } //显示短日期格式
多维表头的数据表结构是:
DataTable hearderMerge = new DataTable();
hearderMerge.Columns.Add("CellNumber", Type.GetType("System.Int32"));
hearderMerge.Columns.Add("CellValue", Type.GetType("System.String"));
CellNumber代表占用多少列宽度,1为一列,2为合并二列,总列数不能超过或少过数据表的列数;CellValue就是显示的名称。
统计行可以是单列或多列,以string方式传入,不同列用逗号分隔,如“列名1,列名3”,可以是任意列,可以相邻或间隔,但必须是数据表中存在的列并且值可以相加。当只有一列统计时在此列的前面显示“统计:”,如果是第一列则不显示。
数据表会生成DataSets节点和Tablix节点。
private List<ReportColoumStyle> _coloumStyle = new List<ReportColoumStyle>();
internal const float ColoumWidth = 1.6F; //列宽
private float tabelTopPosition = 0.0F;
private DataTable hearderName = new DataTable();
private DataTable hearderMerge = new DataTable();
private DataTable hearderTop = new DataTable();
public void SetColoumStyle(List<ReportColoumStyle> coloumStyle)
{
this._coloumStyle = coloumStyle;
}
public void AddData(DataTable dataTable, string totalColumn)
{
if (dataTable != null && dataTable.Rows.Count > 0)
{
var coloumNames = new List<string>();
foreach (DataColumn dataColumn in dataTable.Columns)
{
var protertyName = dataColumn.ColumnName;
coloumNames.Add(protertyName);
}
AddReportItemPattern(coloumNames.ToArray(), dataTable, totalColumn);
}
}
protected void AddReportItemPattern(string[] coloumNames, dynamic data, string totalColumn = "")
{
StringBuilder fields = new StringBuilder();
StringBuilder coloums = new StringBuilder();
StringBuilder tablixHearders = new StringBuilder();
StringBuilder tablixCells = new StringBuilder();
StringBuilder tablixMembers = new StringBuilder();
float currentNamePrefix = _reportItemPatterns.Count + _reportHeadPatterns.Count + 1;
float tableWidth = 0F;
float dataRows = ((DataTable)data).Rows.Count; //数据行数
int totalNumber = 0;
string totalWidth = "";
string totalCellPattern = "";
string totalMemberPattern = "";
string mergeMemberPattern = "";
Boolean isHearderMerge = true;
float hearderHeight = 0.0F;
foreach (var coloumName in coloumNames)
{
var coloumWidth = ColoumWidth;
var textAlign = TextAlign.Right;
var consoleColor = ConsoleColor.Black;
var isShortDate = false;
var reportColoumStyle = _coloumStyle.FirstOrDefault(r => r.ColoumName == coloumName);
if (reportColoumStyle != null)
{
textAlign = reportColoumStyle.TextAlign;
coloumWidth = reportColoumStyle.ColoumWidth;
consoleColor = reportColoumStyle.ConsoleColor;
isShortDate = reportColoumStyle.IsShortDate;
}
tableWidth += coloumWidth;
if (totalColumn != "")
{
if (totalColumn.Split(',').Length > 1)
{
for (int i = 0; i < totalColumn.Split(',').Length; i++)
{
if (totalColumn.Split(',')[i] == coloumName)
{
if (totalWidth == "")
{
totalWidth = totalNumber.ToString();
}
else
{
totalWidth += "," + totalNumber.ToString();
}
}
}
}
else
{
if (totalColumn == coloumName)
{
totalWidth = totalNumber.ToString();
}
}
}
totalNumber += 1;
var bottomBorder = string.Empty; //每个单元格底部border
if (dataRows == 0)
{
bottomBorder = "<BottomBorder><Style>None</Style></BottomBorder>";
}
var coloumValue = coloumName;
if (hearderName.Rows.Count > 0)
{
foreach (DataColumn dc in hearderName.Columns)
{
if (dc.ColumnName == coloumName)
{
if (hearderName.Rows[0][coloumName].ToString().Trim() != "") coloumValue = hearderName.Rows[0][coloumName].ToString();
}
}
}
//例外,如果coloumName包含Coloum之类的字段,则将value设成空
if (coloumName.IndexOf("Column", System.StringComparison.Ordinal) > -1)
{
coloumValue = " ";
}
fields.AppendFormat(
"<Field Name=\"{0}\"><DataField>{0}</DataField><rd:TypeName>System.String</rd:TypeName></Field>",
coloumName);
coloums.AppendFormat("<TablixColumn><Width>{0}cm</Width></TablixColumn>", coloumWidth);
if (hearderMerge.Rows.Count > 0)
{
if (isHearderMerge)
{
hearderHeight += 0.5F;
mergeMemberPattern = "<TablixMember><KeepWithGroup>After</KeepWithGroup><RepeatOnNewPage>true</RepeatOnNewPage></TablixMember>";
if (hearderTop.Rows.Count > 0)
{
hearderHeight += 0.5F;
mergeMemberPattern += "<TablixMember><KeepWithGroup>After</KeepWithGroup><RepeatOnNewPage>true</RepeatOnNewPage></TablixMember>";
}
isHearderMerge = false;
GetHearderMerge(tablixHearders, currentNamePrefix);
}
tablixHearders.AppendFormat("<TablixCell><CellContents>" +
"<Textbox Name=\"Textbox{0}{1}\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether><Paragraphs><Paragraph>" +
"<TextRuns><TextRun><Value>{2}</Value><Style><FontWeight>Bold</FontWeight><FontFamily>" + fontString + "</FontFamily><FontSize>" + fontSize + "pt</FontSize></Style></TextRun></TextRuns><Style><TextAlign>Center</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>Textbox{0}{1}</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>Solid</Style></Border><TopBorder><Style>None</Style></TopBorder><VerticalAlign>Middle</VerticalAlign>" +
"<PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>1pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>",
coloumName, currentNamePrefix, coloumValue, bottomBorder);
}
else
{
tablixHearders.AppendFormat("<TablixCell><CellContents>" +
"<Textbox Name=\"Textbox{0}{1}\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether><Paragraphs><Paragraph>" +
"<TextRuns><TextRun><Value>{2}</Value><Style><FontWeight>Bold</FontWeight><FontFamily>" + fontString + "</FontFamily><FontSize>" + fontSize + "pt</FontSize></Style></TextRun></TextRuns><Style><TextAlign>Center</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>Textbox{0}{1}</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>Solid</Style></Border>{3}<VerticalAlign>Middle</VerticalAlign>" +
"<PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>1pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>",
coloumName, currentNamePrefix, coloumValue, bottomBorder);
}
//string valueString = "=IIf(IIf(Fields!{0}.Value=\"True\",\"√\", Fields!{0}.Value)=\"False\",\"\",IIf(Fields!{0}.Value=\"True\",\"√\", Fields!{0}.Value))";
string valueString = "=Fields!{0}.Value";
if (isShortDate) valueString = "=FormatDateTime(Fields!{0}.Value,DateFormat.ShortDate)";
tablixCells.AppendFormat(
"<TablixCell><CellContents><Textbox Name=\"{0}{1}1\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether>" +
"<Paragraphs><Paragraph><TextRuns><TextRun><Value>" + valueString + "</Value><Style><Color>{3}</Color><FontFamily>" + fontString + "</FontFamily><FontSize>" + fontSize + "pt</FontSize></Style></TextRun></TextRuns><Style><TextAlign>{2}</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>{0}{1}1</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>Solid</Style></Border><VerticalAlign>Middle</VerticalAlign>" +
"<PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>1pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>",
coloumName, currentNamePrefix, textAlign, consoleColor);
tablixMembers.AppendFormat("<TablixMember />");
}
if (totalColumn != "")
{
totalCellPattern = "<TablixRow><Height>0.5cm</Height><TablixCells>\r\n\r\n";
if (totalColumn.Split(',').Length > 1)
{
for (int i = 0; i < totalColumn.Split(',').Length; i++)
{
if (i == 0)
{
for (int n = 0; n < Convert.ToInt32(totalWidth.Split(',')[i]); n++)
{
totalCellPattern += "<TablixCell><CellContents><Textbox Name=\"total" + _reportItemPatterns.Count.ToString() + i.ToString() + n + "\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether>" +
"<Paragraphs><Paragraph><TextRuns><TextRun><Value /><Style>None</Style></TextRun></TextRuns><Style><TextAlign>Left</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>total" + _reportItemPatterns.Count.ToString() + i.ToString() + n + "</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>None</Style></Border><VerticalAlign>Top</VerticalAlign>" +
"<PaddingLeft>0pt</PaddingLeft><PaddingRight>0pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>0pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>\r\n\r\n";
}
}
else
{
for (int n = 0; n < (Convert.ToInt32(totalWidth.Split(',')[i]) - Convert.ToInt32(totalWidth.Split(',')[i - 1]) - 1); n++)
{
totalCellPattern += "<TablixCell><CellContents><Textbox Name=\"total" + _reportItemPatterns.Count.ToString() + i.ToString() + n + "\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether>" +
"<Paragraphs><Paragraph><TextRuns><TextRun><Value /><Style>None</Style></TextRun></TextRuns><Style><TextAlign>Left</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>total" + _reportItemPatterns.Count.ToString() + i.ToString() + n + "</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>None</Style></Border><VerticalAlign>Top</VerticalAlign>" +
"<PaddingLeft>0pt</PaddingLeft><PaddingRight>0pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>0pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>\r\n\r\n";
}
}
totalCellPattern += "<TablixCell><CellContents><Textbox Name=\"totalValue" + _reportItemPatterns.Count.ToString() + i.ToString() + "\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether>" +
"<Paragraphs><Paragraph><TextRuns><TextRun><Value>=Sum(CDec(Fields!" + totalColumn.Split(',')[i] + ".Value))</Value><Style><FontFamily>" + fontString + "</FontFamily><FontSize>" + fontSize + "pt</FontSize><FontWeight>Bold</FontWeight></Style></TextRun></TextRuns><Style><TextAlign>Center</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>totalValue" + _reportItemPatterns.Count.ToString() + i.ToString() + "</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>None</Style></Border><VerticalAlign>Top</VerticalAlign>" +
"<PaddingLeft>0pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>1pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>\r\n\r\n";
}
for (int i = 1; i < (coloumNames.Length - Convert.ToInt32(totalWidth.Split(',')[totalWidth.Split(',').Length - 1])); i++)
{
totalCellPattern += "<TablixCell><CellContents><Textbox Name=\"totalall" + _reportItemPatterns.Count.ToString() + i.ToString() + "\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether>" +
"<Paragraphs><Paragraph><TextRuns><TextRun><Value /><Style>None</Style></TextRun></TextRuns><Style><TextAlign>Left</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>totalall" + _reportItemPatterns.Count.ToString() + i.ToString() + "</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>None</Style></Border><VerticalAlign>Top</VerticalAlign>" +
"<PaddingLeft>0pt</PaddingLeft><PaddingRight>0pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>0pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>\r\n\r\n";
}
}
else
{
if (Convert.ToInt32(totalWidth) > 0) totalCellPattern += "<TablixCell><CellContents><Textbox Name=\"totalname" + _reportItemPatterns.Count.ToString() + "\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether>" +
"<Paragraphs><Paragraph><TextRuns><TextRun><Value>" + totalString + "</Value><Style><FontFamily>" + fontString + "</FontFamily><FontSize>" + fontSize + "pt</FontSize><FontWeight>Bold</FontWeight></Style></TextRun></TextRuns><Style><TextAlign>Right</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>totalname" + _reportItemPatterns.Count.ToString() + "</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>None</Style></Border><VerticalAlign>Top</VerticalAlign>" +
"<PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>3pt</PaddingTop><PaddingBottom>1pt</PaddingBottom></Style></Textbox><ColSpan>" + totalWidth + "</ColSpan></CellContents></TablixCell>\r\n\r\n";
for (int i = 1; i < Convert.ToInt32(totalWidth); i++)
{
totalCellPattern += "<TablixCell />\r\n\r\n";
}
totalCellPattern += "<TablixCell><CellContents><Textbox Name=\"totalValue" + _reportItemPatterns.Count.ToString() + "\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether>" +
"<Paragraphs><Paragraph><TextRuns><TextRun><Value>=Sum(CDec(Fields!" + totalColumn + ".Value))</Value><Style><FontFamily>" + fontString + "</FontFamily><FontSize>" + fontSize + "pt</FontSize><FontWeight>Bold</FontWeight></Style></TextRun></TextRuns><Style><TextAlign>Right</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>totalValue" + _reportItemPatterns.Count.ToString() + "</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>None</Style></Border><VerticalAlign>Top</VerticalAlign>" +
"<PaddingLeft>0pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>1pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>\r\n\r\n";
for (int i = 1; i < (coloumNames.Length - Convert.ToInt32(totalWidth)); i++)
{
totalCellPattern += "<TablixCell><CellContents><Textbox Name=\"total" + _reportItemPatterns.Count.ToString() + i + "\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether>" +
"<Paragraphs><Paragraph><TextRuns><TextRun><Value /><Style>None</Style></TextRun></TextRuns><Style><TextAlign>Left</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>total" + _reportItemPatterns.Count.ToString() + i + " </rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>None</Style></Border><VerticalAlign>Top</VerticalAlign>" +
"<PaddingLeft>0pt</PaddingLeft><PaddingRight>0pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>0pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>\r\n\r\n";
}
}
totalCellPattern += "</TablixCells></TablixRow>";
totalMemberPattern = "<TablixMember><KeepWithGroup>Before</KeepWithGroup></TablixMember>";
}
//计算表格应该离左边多少距离
var leftPosition = (pageWidth - tableWidth) / 2;
if (leftPosition < leftMargin / 2) leftPosition = leftMargin / 2;
var dataSetName = string.Format("Data{0}", _reportItemPatterns.Count + _reportHeadPatterns.Count + 1);
var reportItemPattern = new ReportItemPattern();
reportItemPattern.Data = DynamicReportExtension.RemoveZeroData(data);
reportItemPattern.DataSetName = dataSetName;
reportItemPattern.DataSetString =
reportItemPattern.DataSetPattern
.Replace("@DataSetName", dataSetName)
.Replace("@Fields", fields.ToString());
reportItemPattern.TablixString =
reportItemPattern.TablixPattern
.Replace("@DataSetName", dataSetName)
.Replace("@TablixColumns", coloums.ToString())
.Replace("@TablixHeader", tablixHearders.ToString())
.Replace("@TablixCells", tablixCells.ToString())
.Replace("@TablixMember", tablixMembers.ToString())
.Replace("@TotalRow", totalCellPattern.ToString())
.Replace("@MergeMember", mergeMemberPattern.ToString())
.Replace("@TotalMember", totalMemberPattern.ToString())
.Replace("@TopPosition", CaculatePlacePostion().ToString())
.Replace("@LeftPostion", leftPosition.ToString());
//读取行数,如果是空行就加到新的
if (dataRows == 0)
{
_reportHeadPatterns.Add(reportItemPattern);
}
else
{
_reportItemPatterns.Add(reportItemPattern);
}
if (totalCellPattern != "")
{
tabelTopPosition = CaculatePlacePostion() + hearderHeight - 0.3F;
}
else
{
tabelTopPosition = CaculatePlacePostion() + hearderHeight - 0.5F;
}
}
protected float CaculatePlacePostion()
{
//每个数据表的高度
float itemCount = _reportItemPatterns.Count * 2f;
// 每个空表头的高度
float emptyItemCount = _reportHeadPatterns.Count * 0.5f;
return itemCount + emptyItemCount;
}
private void GetHearderMerge(StringBuilder tablixHearders, float currentNamePrefix)
{
string topBorder = "";
if (hearderTop.Rows.Count > 0)
{
topBorder = "<TopBorder><Style>None</Style></TopBorder>";
for (int i = 0; i < hearderTop.Rows.Count; i++)
{
if ((Int32)hearderTop.Rows[i]["CellNumber"] == 1)
{
tablixHearders.AppendFormat("<TablixCell><CellContents>" +
"<Textbox Name=\"TextboxTop{0}{1}\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether><Paragraphs><Paragraph>" +
"<TextRuns><TextRun><Value /><Style><FontWeight>Bold</FontWeight><FontFamily>" + fontString + "</FontFamily><FontSize>" + fontSize + "pt</FontSize></Style></TextRun></TextRuns><Style><TextAlign>Center</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>TextboxTop{0}{1}</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>Solid</Style></Border><BottomBorder><Style>None</Style></BottomBorder><VerticalAlign>Middle</VerticalAlign>" +
"<PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>1pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>",
i, currentNamePrefix);
}
else
{
string borderString = "";
if (hearderTop.Rows[i]["CellValue"].ToString().Trim() == "") borderString = "<BottomBorder><Style>None</Style></BottomBorder>";
tablixHearders.AppendFormat("<TablixCell><CellContents>" +
"<Textbox Name=\"TextboxTop{0}{1}\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether><Paragraphs><Paragraph>" +
"<TextRuns><TextRun><Value>" + hearderTop.Rows[i]["CellValue"].ToString() + "</Value><Style><FontWeight>Bold</FontWeight><FontFamily>" + fontString + "</FontFamily><FontSize>" + fontSize + "pt</FontSize></Style></TextRun></TextRuns><Style><TextAlign>Center</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>TextboxTop{0}{1}</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>Solid</Style></Border>" + borderString + "<VerticalAlign>Middle</VerticalAlign>" +
"<PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>1pt</PaddingBottom></Style></Textbox><ColSpan>" + hearderTop.Rows[i]["CellNumber"].ToString() + "</ColSpan></CellContents></TablixCell>",
i, currentNamePrefix);
for (int n = 1; n < Convert.ToInt32(hearderTop.Rows[i]["CellNumber"]); n++)
{
tablixHearders.AppendFormat("<TablixCell />");
}
}
}
tablixHearders.AppendFormat("</TablixCells>" +
" </TablixRow>" +
" <TablixRow>" +
" <Height>0.5cm</Height>" +
" <TablixCells>");
}
if (hearderMerge.Rows.Count > 0)
{
for (int i = 0; i < hearderMerge.Rows.Count; i++)
{
if ((Int32)hearderMerge.Rows[i]["CellNumber"] == 1)
{
tablixHearders.AppendFormat("<TablixCell><CellContents>" +
"<Textbox Name=\"TextboxMerge{0}{1}\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether><Paragraphs><Paragraph>" +
"<TextRuns><TextRun><Value /><Style><FontWeight>Bold</FontWeight><FontFamily>" + fontString + "</FontFamily><FontSize>" + fontSize + "pt</FontSize></Style></TextRun></TextRuns><Style><TextAlign>Center</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>TextboxMerge{0}{1}</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>Solid</Style></Border>" + topBorder + "<BottomBorder><Style>None</Style></BottomBorder><VerticalAlign>Middle</VerticalAlign>" +
"<PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>1pt</PaddingBottom></Style></Textbox></CellContents></TablixCell>",
i, currentNamePrefix);
}
else
{
tablixHearders.AppendFormat("<TablixCell><CellContents>" +
"<Textbox Name=\"TextboxMerge{0}{1}\"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether><Paragraphs><Paragraph>" +
"<TextRuns><TextRun><Value>" + hearderMerge.Rows[i]["CellValue"].ToString() + "</Value><Style><FontWeight>Bold</FontWeight><FontFamily>" + fontString + "</FontFamily><FontSize>" + fontSize + "pt</FontSize></Style></TextRun></TextRuns><Style><TextAlign>Center</TextAlign></Style></Paragraph></Paragraphs>" +
"<rd:DefaultName>TextboxMerge{0}{1}</rd:DefaultName><Style><Border><Color>DarkGray</Color><Style>Solid</Style></Border>" + topBorder + "<VerticalAlign>Middle</VerticalAlign>" +
"<PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>1pt</PaddingBottom></Style></Textbox><ColSpan>" + hearderMerge.Rows[i]["CellNumber"].ToString() + "</ColSpan></CellContents></TablixCell>",
i, currentNamePrefix);
for (int n = 1; n < Convert.ToInt32(hearderMerge.Rows[i]["CellNumber"]); n++)
{
tablixHearders.AppendFormat("<TablixCell />");
}
}
}
tablixHearders.AppendFormat("</TablixCells>" +
" </TablixRow>" +
" <TablixRow>" +
" <Height>0.5cm</Height>" +
" <TablixCells>");
}
}
边栏推荐
猜你喜欢
不安装运行时运行 .NET 程序
The principle implementation of handwritten flexible.js, I finally understand the multi-terminal adaptation of the mobile terminal
Redis的那些事:一文入门Redis的基础操作
重谈联想5G编码投票事件
Can't install the Vmware virtual machine on the Ark Kai server?
.NET 6 study notes (4) - Solve the Nullable warning in VS2022
WinForm(四)一种实现登录的方式
[ Kitex Source Code Interpretation ] Request to retry
The most complete architect knowledge map in history
进行知识管理的好处有哪些?
随机推荐
How tall is the B+ tree of the MySQL index?
字节也开始缩招了...
谭中意:你知道 “开源女王” 是谁吗?
我不写单元测试,被批了
What is hardware integrated development?What are the cores of hardware integrated development?
基于ABP和Magicodes实现Excel导出操作
什么是控制板定制开发?
mysql生成随机姓名、手机号、日期
Volatile:JVM 我警告你,我的人你别乱动
如何在 PC 机上测试移动端的网页?
SimpleDateFormat线程安全问题和解决方案
Can't install the Vmware virtual machine on the Ark Kai server?
【代码审计】——PHP项目类RCE及文件包含下载删除
What is test development and why is it so popular now?
Smart Tool Management System
原油等特殊期货开户要求和豁免
一文深入了解 Hybrid 的实现原理
微服务:事务管理
Lagrange插值公式matlab实现
The principle implementation of handwritten flexible.js, I finally understand the multi-terminal adaptation of the mobile terminal