本文介绍了vb.net将庞大的数据集导出为ex​​cel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我必须将大约2万条记录的大型数据集导出到excel目前我正在执行以下代码,但它在服务器上花了超过20分钟是否有可能提高性能或任何其他方法导出到excel in快速的时间....请指导我



提前感谢







Dim valuesArray As Object = New Object(table.Rows.Count,table.Columns.Count){}

Dim k As Integer

for k = 0 to table.Rows.Count - 1 step k + 1

for m = 0 to table.Columns.Count - 1

valuesArray(k, m)= table.Rows(k)(m).ToString()

下一页m

下一页

昏暗范围作为Microsoft.Office。 Interop.Excel.Range

range = ExcelApp.Range(" A1:O1",String.Format(" A {0}:O {0}",table.Rows.Count + 1 ))

range.Value = valuesArray

ExcelApp.Columns.AutoFit()

hi i have to export huge datset about 2 lakhs of records to excel currently i am doing the below code but it is taking more than 20 mins in server is there a posibility to increase performance or any other approach to export to excel in quick time....pls guide me

thanks in Advance



Dim valuesArray As Object = New Object(table.Rows.Count, table.Columns.Count) {}
Dim k As Integer
For k = 0 To table.Rows.Count - 1 Step k + 1
For m = 0 To table.Columns.Count - 1
valuesArray(k, m) = table.Rows(k)(m).ToString()
Next m
Next
Dim range As Microsoft.Office.Interop.Excel.Range
range = ExcelApp.Range("A1:O1", String.Format("A{0}:O{0}", table.Rows.Count + 1))
range.Value = valuesArray
ExcelApp.Columns.AutoFit()

推荐答案


这篇关于vb.net将庞大的数据集导出为ex​​cel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 22:29