Free Support Forum - aspose.com

ImportDataView column not showing due to formatting

Hi.

I am using ImportDataView to populate a spreadsheet and it works great, but a number field and date field does not show in the spreedsheet (the rest do show up) when formatting is applied to the template spreadsheet that is used to receive the data. If I direct the output to a blank unformatted sheet in the same workbook, all the data fields show.

The template sheet was working, but once I applied formating so the date shows as a date, then it stopped.

Have you heard of this happening before and how can I fix?

Jeff

I guess I should also add one more question. Is using ImportDataView the fast method to insert a row and field data into an existing spreadsheet?

Speed is the need and row count will likely be 1000 to 5000.

Jeff

We don't find this problem before.

Could you please post your template file and sample code here? I will check this issue.

If you don't push down rows in your template file, ImportDataView, ImportDataTable or PutValue don't have much difference on performance.

Thanks for your reply and sorry for the delay in my response.

Here is code and the template file is attached.

Function CreateExcelFileWithAspose(ByVal ds As DataSet) As String

Dim license As License = New License

license.SetLicense(context.Server.MapPath("~\DesktopModules\ToolBoxControls\Aspose.Cells.lic"))

Dim sView As String = rblView.SelectedItem.Value

Dim wb As Workbook = New Workbook

Dim sFile As String = context.Server.MapPath("~\DesktopModules\ToolBoxControls\JEFormatFile.xls")

wb.Open(sFile)

Dim ws As Worksheet

If sView = "Query" Then

ws = wb.Worksheets(1)

Else

ws = wb.Worksheets(2)

End If

ws.Cells.ImportDataView(ds.Tables("JEQuery").DefaultView, 13, 0, 50000, 32, True)

wb.Worksheets.RemoveAt("JE Lookup")

wb.Save("result22.xls", SaveType.OpenInExcel, FileFormatType.Default, Response)

End Function

Thanks for your help.

Jeff

Hi Jeff,

Thank you for these information. Please try this attached fix.