A
Amirallia
Hello
Here is nmy code to export a datagrid to csv file :
For lLigne = 0 To Me.dg1.Items.Count - 1
For lColonne = 0 To Me.dg1.Items(lLigne).Cells.Count - 2
If Me.dg1.Items(lLigne).Cells(lColonne).Text = " " Then
strValeur = ""
Else
strValeur = Me.dg1.Items(lLigne).Cells(lColonne).Text
End If
sbrHTML.Append(strValeur & Separator)
Next
sbrHTML.Append(ControlChars.NewLine)
Next
lTextCSV = sbrHTML.ToString
myByteArray = System.Text.Encoding.Default.GetBytes(lTextCSV)
Response.ClearHeaders()
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" &
"xxxx.csv")
Response.ContentType = "text/csv"
Response.BinaryWrite(myByteArray)
Response.End()
When I click on a button, it displays the download dialog box and all
is ok on my computer, but on my Laptop, it doesn't display the download
dialog box!!!!
Any idea ?
There is something in my Laptop's browser(IE) to change ?
Here is nmy code to export a datagrid to csv file :
For lLigne = 0 To Me.dg1.Items.Count - 1
For lColonne = 0 To Me.dg1.Items(lLigne).Cells.Count - 2
If Me.dg1.Items(lLigne).Cells(lColonne).Text = " " Then
strValeur = ""
Else
strValeur = Me.dg1.Items(lLigne).Cells(lColonne).Text
End If
sbrHTML.Append(strValeur & Separator)
Next
sbrHTML.Append(ControlChars.NewLine)
Next
lTextCSV = sbrHTML.ToString
myByteArray = System.Text.Encoding.Default.GetBytes(lTextCSV)
Response.ClearHeaders()
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" &
"xxxx.csv")
Response.ContentType = "text/csv"
Response.BinaryWrite(myByteArray)
Response.End()
When I click on a button, it displays the download dialog box and all
is ok on my computer, but on my Laptop, it doesn't display the download
dialog box!!!!
Any idea ?
There is something in my Laptop's browser(IE) to change ?