If I have a gridview and want to export it to excel it does export all values correct.
But if I have a column that is a lookup I get the ID and not the displayed value of the lookuptable value.
Where do I set that settings for my export?
My exportfunction from your VB examples
But if I have a column that is a lookup I get the ID and not the displayed value of the lookuptable value.
Where do I set that settings for my export?
My exportfunction from your VB examples
| Private Sub ExportToExcel(ByVal ExportAsML As Boolean, ByVal Exportfor2007 As Boolean, Optional ByVal exportVisual As Boolean = True) | |
| If ExportAsML = False AndAlso saveFileDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then | |
| 'Export To Excel | |
| If (Not saveFileDialog.FileName.Equals(String.Empty)) Then | |
| Dim file As New FileInfo(saveFileDialog.FileName) | |
| If file.Extension.Equals(".xls") Then | |
| 'Här skall det bli ändring till gamla Excel | |
| ' Export(saveFileDialog.FileName) | |
| Else | |
| MessageBox.Show("Felaktig filtyp") | |
| End If | |
| Else | |
| MessageBox.Show("Välj ett filnamn.") | |
| End If | |
| ElseIf ExportAsML = True AndAlso saveFileDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then | |
| 'Export To ExcelML | |
| If (Not saveFileDialog.FileName.Equals(String.Empty)) Then | |
| Dim fileName As String = Me.saveFileDialog.FileName | |
| Dim exporter As New ExportToExcelML() | |
| If Exportfor2007 Then | |
| exporter.RunExport(Me.RadGridView1, fileName, ExportToExcelML.ExcelMaxRows._1048576, exportVisual) | |
| Else | |
| exporter.RunExport(Me.RadGridView1, fileName, ExportToExcelML.ExcelMaxRows._65536, exportVisual) | |
| End If | |
| MessageBox.Show("Export klar.") | |
| Else | |
| MessageBox.Show("Välj ett filnamn.") | |
| End If | |
| End If | |
| End Sub | |