execl模板:如何迭代Excel工作表单元格&列 [英] execl template:How to iterate excel sheet cell & columns

查看:142
本文介绍了execl模板:如何迭代Excel工作表单元格&列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用数据集从数据库中将数据转储到Excel工作表中.
因此,如果我一般具有多个数据表或数据集.然后如何分离它们.例如:ABC是标题行,在ABC标题中,我有来自数据集的各种列.再一次,我有一个XYZ标题,也有来自不同数据集的各种列.因此,如何在生成Excel工作表的同时以编程方式分离ABC和XYZ.
请允许我进一步澄清这个问题.
Thnx.

I want to dump data on excel sheet from data base,using dataset.
So, if i have multiple datatable or dataset in general. then how to seperate them. for eg: ABC is header Row and within ABC heading i have a various columns coming from dataset. and again i have a XYZ Title,with that also i have various columns coming from different dataset. So, How to separate ABC and XYZ programatically at same time while generating excel sheet.
Let me if can give some more clarification on the problem.
Thnx.

推荐答案

用于生成使Excel自动化的文件可能是最简单的选择.更好的选择可能是简单地编写Office XML文件.


但是有些澄清会很好.
For generating the file automating Excel is probably the easiest option. A better option might be to simply write an office XML file.


But some clarification would be nice.


好,让我澄清一下问题.
我想在Excel工作簿的同一张纸上放置两个或多个范围(行和列的组合).我希望通过来自数据集的数据填充这两个范围
Ok,Let clarify my problem.
I want two or more range(combination of rows and columns) on the same sheet of the excel workbook. I want the two range to be filled by data coming from dataset


通过XML编写是可用的选项之一,但我的要求是生成Excel,其中数据来自数据集.而且我想通过将数据保持在excel工作表的不同范围"中来分离数据.
让我知道一些示例代码是否可以帮助我们更好地理解问题.因为我已经开发出一种解决方案,它可以很好地处理一个数据集并将其写在excel上.但是我的要求是来自两个或更多SP的数据应在带有表头和全部的相同excel工作表分区上被复制.为此,我只想知道如何迭代excel单元格或任何更好的主意.
重新获得.
Writing through XML is one of option available but my requirement is generate Excel in which data are coming from dataset. And i want to separate data by keeping them in differnt "range" of excel worksheet.
Let me know if some sample code can help us in better understanding of problem. Because i have developed a soltution which alredy working fine with one dataset and writing it on excel. but wat my requirement is data from two or more SPs should be dumbped on same excel sheet partioning with header and all. For that i simply want to know that how to iterate the excel cell or any better idea.
Reagrds.


这篇关于execl模板:如何迭代Excel工作表单元格&列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆