请问,c#导出excel报表,合并行怎么做
例如:
2007-1-1 qqq vv ccc
2007-1-1 fdfd dfd ggg
2007-1-1 www dddd fffe
2007-1-2 rrr dff dfd
导出excel
qqq vv ccc
2007-1-1 fdfd dfd ggg
www dddd fffe
2007-1-2 rrr dff dfd
这个怎么弄呢?数据源是动态的哦
------解决方案--------------------先把数据读入DATATABLE,合并完数据后再导出.
------解决方案--------------------//合并
if(Convert.ToInt32(rptID)!=2)
{
oRange = oWorksheet.get_Range( "A6 ", "A "+Convert.ToString(5+sDataCount));
oRange.Clear();
oRange.Merge(Missing.Value);
oRange.Value2 = "AAAAAA ";
oRange.HorizontalAlignment = 3;
oRange.VerticalAlignment = 2;
}