您的位置:首页 > 编程语言 > C#

C# 动态生成RDLC报表文件

2015-12-16 20:06 656 查看
");
cqw.Append("");
cqw.Append("");//表
cqw.Append(""); //表体
//列定义
cqw.Append("");
foreach (DataRow row in ds.Tables[2].Rows)
{
cqw.AppendFormat("{0}cm", row["w"]);
fieldstr.AppendFormat("{0}", row["field"]);
colomugroup.Append("");
}
cqw.Append("");
//行定义
cqw.Append("");
foreach (DataRow row in ds.Tables[1].Rows)
{
cqw.AppendFormat("{0}cm", row["h"]);
string filter = string.Format("rid={0}", row["id"]);
//列单元格定义
foreach (DataRow r in ds.Tables[3].Select(filter))
{
cqw.Append("");
cqw.Append(get_text("t", r));
cqw.Append("");
}
cqw.Append("");
}
cqw.Append("");
cqw.Append("");
//列组定义
cqw.AppendFormat("{0}", colomugroup);
//行组定义
cqw.Append("");
foreach (DataRow row in ds.Tables[1].Rows)
{
if ((bool)row["isgroup"])
cqw.Append("true");
else
{
cqw.Append("");
if ((bool)row["isheader"])
cqw.Append("Aftertrue");
cqw.Append("");
}
}
cqw.Append("");

//表位置参数
cqw.AppendFormat("{0}cm{1}cm", rt["tt"], rt["tl"]);
cqw.Append("");
//尾注定义
if ((decimal)rt["rf"] > 0)
foreach (DataRow r1 in ds.Tables[5].Select("isph=2"))
{
cqw.Append(get_text("h", r1));
}
cqw.Append("");
cqw.AppendFormat("{0}cm", this.tableheight + (decimal)rt["rf"]); //报表高度
cqw.Append("
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: