Repeter中列相同数据合并
<asp:Repeater runat="server" ID="rptInfo" onitemdatabound="Repeater1_ItemDataBound"> <HeaderTemplate> <table cellpadding="" cellspacing="" border="" bordercolor="black" width="100%" style="border-collapse: collapse; border-style: solid;"> <tr style=" font-weight:bold; text-align:center;"> <%-- <td>序号</td>--%> <td width="15%">单位名称</td> <td>经营设施地址</td> <td>核准内容</td> <td>核准经营数量(吨/年)</td> <td>处置方式</td> <td>法定代表人</td> <td>联系电话</td> <td width="12%">有效期</td> </tr>
</HeaderTemplate> <ItemTemplate> <tr>
<%--<td runat="server" id="tdxuhao"></td>--%> <td runat="server" id="tdqiye_name" style="font-size:13px;"><%#Eval("qiye_name")%></td> <td runat="server" id="tdDWDZ" style="font-size:13px;"><%#Eval("DWDZ")%></td> <td runat="server" id="tdhzmc" style="font-size:13px; text-align:center;"><%#Eval("hzmc")%></td> <td runat="server" id="tdmaxhpy" style=" text-align:center;font-size:13px;"><%#Eval("max_handle_per_year")%></td> <td runat="server" id="tdczfs" style=" text-align:center;font-size:13px;"><%#Eval("czfs")%></td> <td runat="server" id="tdFRDB" style="font-size:13px; text-align:center;"><%#Eval("FRDB")%></td> <td runat="server" id="tdLXDH" style="font-size:13px; text-align:center;"><%#Eval("LXDH")%></td> <td id="tdyxqt" runat="server" style=" text-align:center; font-size:13px;" ><%#Eval("firstTime", "{0:yyyy-MM-dd}")%>~<%#Eval("edittime", "{0:yyyy-MM-dd}")%></td> </tr> </ItemTemplate> <FooterTemplate>
</table> </FooterTemplate> </asp:Repeater>
public void getAllJYXKZ()
{
TGfgsJyxkzxxgsBizLogic jyxkz = new TGfgsJyxkzxxgsBizLogic();
DataSet ds = jyxkz.GetALLSPSL();
this.rptInfo.DataSource = ds;
this.rptInfo.DataBind(); for (int i = rptInfo.Items.Count - ; i > ; i--)
{ // HtmlTableCell xuhao_previous = rptInfo.Items[i].FindControl("tdxuhao") as HtmlTableCell;
// HtmlTableCell xuhao = rptInfo.Items[i-1].FindControl("tdxuhao") as HtmlTableCell; HtmlTableCell oCell_previous = rptInfo.Items[i - ].FindControl("tdqiye_name") as HtmlTableCell;
HtmlTableCell oCell = rptInfo.Items[i].FindControl("tdqiye_name") as HtmlTableCell; oCell.RowSpan = (oCell.RowSpan == -) ? : oCell.RowSpan;
oCell_previous.RowSpan = (oCell_previous.RowSpan == -) ? : oCell_previous.RowSpan; if (oCell.InnerText == oCell_previous.InnerText)
{
oCell.Visible = false;
oCell_previous.RowSpan += oCell.RowSpan; } HtmlTableCell DWDZprecious = rptInfo.Items[i - ].FindControl("tdDWDZ") as HtmlTableCell;
HtmlTableCell DWDZ = rptInfo.Items[i].FindControl("tdDWDZ") as HtmlTableCell;
DWDZ.RowSpan = (DWDZ.RowSpan == -) ? : DWDZ.RowSpan;
DWDZprecious.RowSpan = (DWDZprecious.RowSpan == -) ? : DWDZprecious.RowSpan;
if (DWDZ.InnerText == DWDZprecious.InnerText)
{
DWDZ.Visible = false;
DWDZprecious.RowSpan += DWDZ.RowSpan;
} HtmlTableCell hzmcprecious = rptInfo.Items[i - ].FindControl("tdhzmc") as HtmlTableCell;
HtmlTableCell hzmc = rptInfo.Items[i].FindControl("tdhzmc") as HtmlTableCell;
hzmc.RowSpan = (hzmc.RowSpan == -) ? : hzmc.RowSpan;
hzmcprecious.RowSpan = (hzmcprecious.RowSpan == -) ? : hzmcprecious.RowSpan;
if (hzmc.InnerText == hzmcprecious.InnerText)
{
hzmc.Visible = false;
hzmcprecious.RowSpan += hzmc.RowSpan;
} HtmlTableCell FRDBrecious = rptInfo.Items[i - ].FindControl("tdFRDB") as HtmlTableCell;
HtmlTableCell FRDB = rptInfo.Items[i].FindControl("tdFRDB") as HtmlTableCell;
FRDB.RowSpan = (FRDB.RowSpan == -) ? : FRDB.RowSpan;
FRDBrecious.RowSpan = (FRDBrecious.RowSpan == -) ? : FRDBrecious.RowSpan; if (FRDB.InnerText == FRDBrecious.InnerText)
{
FRDB.Visible = false;
FRDBrecious.RowSpan += FRDB.RowSpan;
} HtmlTableCell LXDHrecious = rptInfo.Items[i - ].FindControl("tdLXDH") as HtmlTableCell;
HtmlTableCell LXDH = rptInfo.Items[i].FindControl("tdLXDH") as HtmlTableCell;
LXDH.RowSpan = (LXDH.RowSpan == -) ? : LXDH.RowSpan;
LXDHrecious.RowSpan = (LXDHrecious.RowSpan == -) ? : LXDHrecious.RowSpan; if (LXDH.InnerText == LXDHrecious.InnerText)
{
LXDH.Visible = false;
LXDHrecious.RowSpan += LXDH.RowSpan;
} HtmlTableCell maxhpyrecious = rptInfo.Items[i - ].FindControl("tdmaxhpy") as HtmlTableCell;
HtmlTableCell maxhpy = rptInfo.Items[i].FindControl("tdmaxhpy") as HtmlTableCell;
maxhpy.RowSpan = (maxhpy.RowSpan == -) ? : maxhpy.RowSpan;
maxhpyrecious.RowSpan = (maxhpyrecious.RowSpan == -) ? : maxhpyrecious.RowSpan; if (maxhpy.InnerText == maxhpyrecious.InnerText)
{
if (oCell.InnerText == oCell_previous.InnerText)
{
maxhpy.Visible = false;
maxhpyrecious.RowSpan += maxhpy.RowSpan;
}
} HtmlTableCell czfsrecious = rptInfo.Items[i - ].FindControl("tdczfs") as HtmlTableCell;
HtmlTableCell czfs = rptInfo.Items[i].FindControl("tdczfs") as HtmlTableCell;
czfs.RowSpan = (czfs.RowSpan == -) ? : czfs.RowSpan;
czfsrecious.RowSpan = (czfsrecious.RowSpan == -) ? : czfsrecious.RowSpan; if (czfs.InnerText == czfsrecious.InnerText)
{
if (oCell.InnerText == oCell_previous.InnerText)
{
czfs.Visible = false;
czfsrecious.RowSpan += czfs.RowSpan;
}
} HtmlTableCell yxqtrecious = rptInfo.Items[i - ].FindControl("tdyxqt") as HtmlTableCell;
HtmlTableCell yxqt = rptInfo.Items[i].FindControl("tdyxqt") as HtmlTableCell;
yxqt.RowSpan = (yxqt.RowSpan == -) ? : yxqt.RowSpan;
yxqtrecious.RowSpan = (yxqtrecious.RowSpan == -) ? : yxqtrecious.RowSpan; if (yxqt.InnerText == yxqtrecious.InnerText)
{
yxqt.Visible = false;
yxqtrecious.RowSpan += yxqt.RowSpan;
} }
}
Repeter中列相同数据合并的更多相关文章
- R语言中的横向数据合并merge及纵向数据合并rbind的使用
R语言中的横向数据合并merge及纵向数据合并rbind的使用 我们经常会遇到两个数据框拥有相同的时间或观测值,但这些列却不尽相同.处理的办法就是使用merge(x, y ,by.x = ,by.y ...
- SQLServer 中多行数据合并成一行数据(一个字段)
需求:有四行数据,如下: 1.苹果 2.橘子 3.桃子 4.波罗 合并成一个字段:苹果,橘子,桃子,波罗: 需求明确之后,先弄点测试数据,上代码: --创建一个临时表 Create table #te ...
- sqlserver中 多条数据合并成一条数据 (stuff 与 for xml path 连用)
SQL 列转行,即多行合并成一条 需求:按照分组,将多条记录内容合并成一条,效果如下: 数据库示例: CREATE TABLE [t2]([NID] [bigint] NULL,[district ...
- java List中相同的数据合并到一起
值好最后一天岗,写个小程序 List<Map<Object,Object>> mapList = new ArrayList<Map<Object,Object&g ...
- SQL实用技巧:如何将表中某一列的部分数据合并到一行中
select *,stuff(select ‘,’ + fieldname from table1 for xml path(”)),1,1,”) as field from table2 for ...
- R语言数据合并使用merge数据追加使用rbind和cbind
R语言中的横向数据合并merge及纵向数据合并rbind的使用 我们经常会遇到两个数据框拥有相同的时间或观测值,但这些列却不尽相同.处理的办法就是使用merge(x, y ,by.x = ,by.y ...
- Expression构建DataTable to Entity 映射委托 sqlserver 数据库里面金额类型为什么不建议用float,实例告诉你为什么不能。 sql server 多行数据合并成一列 C# 字符串大写转小写,小写转大写,数字保留,其他除外 从0开始用U盘制作启动盘装Windows10系统(联想R720笔记本)并永久激活方法 纯CSS打造淘宝导航菜单栏 C# Winform
Expression构建DataTable to Entity 映射委托 1 namespace Echofool.Utility.Common { 2 using System; 3 using ...
- python中pandas数据分析基础3(数据索引、数据分组与分组运算、数据离散化、数据合并)
//2019.07.19/20 python中pandas数据分析基础(数据重塑与轴向转化.数据分组与分组运算.离散化处理.多数据文件合并操作) 3.1 数据重塑与轴向转换1.层次化索引使得一个轴上拥 ...
- 如何用perl将表格中不同列的数据进行拼凑,然后将拼凑后的数据用“|”连接在一起
最近写了一个perl脚本,实现的功能是将表格中其中两列的数据进行拼凑,然后将拼凑后的数据用“|”连接在一起. 表格内容如下: 员工号码 员工姓名 职位 入职日期 1001 张三 销售 1980/12/ ...
随机推荐
- Problem4-Project Euler
Largest palindrome product A palindromic number reads the same both ways. The largest palindrome m ...
- gulp学习。
安装gulp 安装gulp之前必须先安装node.js,然后在命令行里输入 $ npm install gulp-cli -g (-g 表示全局安装)然后在输入$ gulp -v ,验证,安装完成后再 ...
- FTP上传下载类
public class FtpOperation { public static void UploadFile(FileInfo fileinfo, string targetDir, strin ...
- jmeter函数简介
1._char:把一组数字转化成Unicode字符. 2._counter:记录线程的迭代次数. 3._CSVRead:可以从文件中指定列的值. 4.${_CSVRead(D:\test.txt,0, ...
- 迁移MSSQL实例的所有login(包含密码)
迁移数据库的时候肯定会涉及到login的迁移(包含数据库除外). 而一般我们迁移login的时候,可能会使用在某个login上右键生成脚本这样的做法.但是这样生成的脚本不能把密码也生成出来. 而且你只 ...
- NewEmployeesLearnNotes——新人程序员学习计划V1.1
百度云链接:https://pan.baidu.com/s/1BzoT79tV1QGwIQTjkGA4CQ 密码:k78i 修改中...
- malloc,calloc,realloc函数用法,原理及不同解析
https://blog.csdn.net/lixungogogo/article/details/50887028 一.malloc malloc在MSDN中原型为: void *malloc( s ...
- You are not late! You are not early!
Do you think you are going No Where in Life? STOP! Take a deep breathe THINK! New York is three hour ...
- 项目管理心经——正确的使用Microsoft Project
第一步:填写task items 第二步:定义个性化日历(Tools-->Change working time) 第二步:填写task duration 第三步:填写前置任务 第四步:自动生成 ...
- Hash Tables
哈希表 红黑树实现的符号表可以保证对数级别的性能,但我们可以做得更好.哈希表实现的符号表提供了新的数据访问方式,插入和搜索操作可以在常数时间内完成(不支持和顺序有关的操作).所以,在很多情况下的简单符 ...