且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将多个数据集导出到单个Excel工作表?

更新时间:2023-01-23 13:54:50





1.使用A Div标签。(可见错误)

2.在您放置网格视图的内部根据您的数据集计数。

3.绑定网格视图并使用Gridview标题标题。

4.现在将Div导出到Excel。它会工作。


参考此

Hi,
I am having two datasets in which first dataset has 6 rows and second dataset has 'N' Number of rows , second dataset row count keeps on changing , What I need is I need to export both the dataset to a single excelsheet . Both dataset has headers , So i need to export both dataset with header to a single excelsheet using c#. Can Anyone help me with sample code in c#

Hi,

1. Use A Div Tag.(Visible False)
2. Inside that you Place Gridviews According to your Dataset Count.
3. Bind Grid View and Use Gridview Caption for Headers.
4. Now Export Div to Excel. it will work.


Refer this