如何在同一张excel usnig C#中导入超过65000条记录 [英] How to import morethan 65000 records in same sheet of excel usnig C#

查看:124
本文介绍了如何在同一张excel usnig C#中导入超过65000条记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在数据表中有一个数据。

我在datatable.Im中有10万条记录,将该数据表导出为ex​​cel。

正确导入。

但是我在第一张纸上记录了65000条记录,在第二张纸上记录了剩余的35000条记录。

我的问题是我在同一张纸上输入了所有1万条记录而没有和两张excel ..有人请给我这个懒散的。



我正在使用这个C#代码..



 rvexam.Reset(); 
rvexam.Visible = true ;
rvexam.LocalReport.ReportPath = Server.MapPath( 〜/ PortalGUI / University / Reports / DFormReport.rdlc );
rvexam.Visible = true ;
rvexam.LocalReport.DataSources.Clear();
Microsoft.Reporting.WebForms.ReportDataSource ordSub = new Microsoft.Reporting.WebForms.ReportDataSource( dsDform,dtDform);
Microsoft.Reporting.WebForms.ReportDataSource ordsUnivInfo = new Microsoft.Reporting.WebForms.ReportDataSource( dsUniv,dtUnivInfo);
rvexam.LocalReport.DataSources.Add(ordSub);
rvexam.LocalReport.DataSources.Add(ordsUnivInfo);
rvexam.LocalReport.Refresh();
mpereportViwer1.Show();
byte [] bytes = rvexam.LocalReport.Render( EXCEL); // ,null,out mimeType,out encoding,out extension,out streamIds,out warnings);
Response.Buffer = true ;
Response.Clear();
Response.ContentType = application / CSV;
Response.AddHeader( content-disposition attachment; filename = Dfrom.CSV);
Response.BinaryWrite(bytes); // 创建文件
Response.Flush();





请给我任何替代解决方案...

解决方案

哪个版本(Excel)是你用的?

Microsoft Excel 2003 - 工作表大小65,536行乘256列



查看此帖子了解更多详情

< a href =http://office.microsoft.com/en-001/excel-help/excel-specifications-and-limits-HP005199291.aspx> Excel规范和限制 [ ^ ]

可能您使用的是错误版本的Excel:Excel 2003在任何工作表中限制为65,536行: http://office.microsoft.com/en-gb/excel-help/excel-specifications-and-limits-HP005199291.aspx [ ^ ]

试用Excel 2007或更高版本 - 它允许超过1,000,000行。

http://msdn.microsoft.com/en-us/library/ff700514.aspx#Office2007excelPerf_BigGridIncreasedLimitsExcel [ ^ ]

In having a data in a datatable.
im having 1 lakh record in the datatable.Im exporting that datatable to excel.
Its correctly importing.
But im geetiing 65000 records in first sheet and remaining 35000 records in second sheet.
my issue is that i have import all the 1 lakh records in same sheet and not and two sheets of the excel..can someone please give me sloution for this.

Im using this C# code..

rvexam.Reset();
                            rvexam.Visible = true;
                            rvexam.LocalReport.ReportPath = Server.MapPath("~/PortalGUI/University/Reports/DFormReport.rdlc");
                            rvexam.Visible = true;
                            rvexam.LocalReport.DataSources.Clear();
                            Microsoft.Reporting.WebForms.ReportDataSource ordSub = new Microsoft.Reporting.WebForms.ReportDataSource("dsDform", dtDform);
                            Microsoft.Reporting.WebForms.ReportDataSource ordsUnivInfo = new Microsoft.Reporting.WebForms.ReportDataSource("dsUniv", dtUnivInfo);
                            rvexam.LocalReport.DataSources.Add(ordSub);
                            rvexam.LocalReport.DataSources.Add(ordsUnivInfo);
                            rvexam.LocalReport.Refresh();
                            mpereportViwer1.Show();
                            byte[] bytes = rvexam.LocalReport.Render("EXCEL"); // , null, out mimeType, out encoding, out extension, out streamIds, out warnings);
                            Response.Buffer = true;
                            Response.Clear();
                            Response.ContentType = "application/CSV";
                            Response.AddHeader("content-disposition", "attachment; filename=Dfrom.CSV");
                            Response.BinaryWrite(bytes); // create the file   
                            Response.Flush();



pls give me any alternate solution for this...

解决方案

Which version(Excel) are you using?
Microsoft Excel 2003 - Worksheet size 65,536 rows by 256 columns

Check this post for more details
Excel specifications and limits[^]


Probably, you are using the wrong version of Excel: Excel 2003 was limited to 65,536 rows in any sheet: http://office.microsoft.com/en-gb/excel-help/excel-specifications-and-limits-HP005199291.aspx[^]
Try Excel 2007 or above - it allows more than 1,000,000 rows.
http://msdn.microsoft.com/en-us/library/ff700514.aspx#Office2007excelPerf_BigGridIncreasedLimitsExcel[^]


这篇关于如何在同一张excel usnig C#中导入超过65000条记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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