Push 462
This commit is contained in:
17
Controls.DocumentViewer/DocumentViewer.Designer.vb
generated
17
Controls.DocumentViewer/DocumentViewer.Designer.vb
generated
@@ -64,6 +64,7 @@ Partial Class DocumentViewer
|
||||
Me.PrintDocument1 = New System.Drawing.Printing.PrintDocument()
|
||||
Me.lbFileNotLoaded = New DevExpress.XtraEditors.LabelControl()
|
||||
Me.RichEditControl1 = New DevExpress.XtraRichEdit.RichEditControl()
|
||||
Me.lblInfo = New System.Windows.Forms.Label()
|
||||
CType(Me.BarManager1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.RepositoryItemTextEdit2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.RepositoryItemTextEdit3, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
@@ -422,7 +423,7 @@ Partial Class DocumentViewer
|
||||
'
|
||||
'SpreadsheetControl1
|
||||
'
|
||||
Me.SpreadsheetControl1.Location = New System.Drawing.Point(147, 190)
|
||||
Me.SpreadsheetControl1.Location = New System.Drawing.Point(83, 177)
|
||||
Me.SpreadsheetControl1.MenuManager = Me.BarManager1
|
||||
Me.SpreadsheetControl1.Name = "SpreadsheetControl1"
|
||||
Me.SpreadsheetControl1.ReadOnly = True
|
||||
@@ -453,17 +454,28 @@ Partial Class DocumentViewer
|
||||
'
|
||||
'RichEditControl1
|
||||
'
|
||||
Me.RichEditControl1.Location = New System.Drawing.Point(571, 238)
|
||||
Me.RichEditControl1.Location = New System.Drawing.Point(447, 271)
|
||||
Me.RichEditControl1.MenuManager = Me.BarManager1
|
||||
Me.RichEditControl1.Name = "RichEditControl1"
|
||||
Me.RichEditControl1.Size = New System.Drawing.Size(400, 200)
|
||||
Me.RichEditControl1.TabIndex = 5
|
||||
Me.RichEditControl1.Visible = False
|
||||
'
|
||||
'lblInfo
|
||||
'
|
||||
Me.lblInfo.AutoSize = True
|
||||
Me.lblInfo.ForeColor = System.Drawing.Color.Red
|
||||
Me.lblInfo.Location = New System.Drawing.Point(18, 558)
|
||||
Me.lblInfo.Name = "lblInfo"
|
||||
Me.lblInfo.Size = New System.Drawing.Size(39, 13)
|
||||
Me.lblInfo.TabIndex = 10
|
||||
Me.lblInfo.Text = "Label1"
|
||||
'
|
||||
'DocumentViewer
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.Controls.Add(Me.lblInfo)
|
||||
Me.Controls.Add(Me.RichEditControl1)
|
||||
Me.Controls.Add(Me.lbFileNotLoaded)
|
||||
Me.Controls.Add(Me.SpreadsheetControl1)
|
||||
@@ -526,4 +538,5 @@ Partial Class DocumentViewer
|
||||
Friend WithEvents btnSearch As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents btnSearch2 As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents RichEditControl1 As DevExpress.XtraRichEdit.RichEditControl
|
||||
Friend WithEvents lblInfo As Label
|
||||
End Class
|
||||
|
||||
@@ -161,6 +161,26 @@
|
||||
NC42LTAuOCw2LjUtMi4xbDcuOSw3LjljMC4zLDAuMywwLjksMC4zLDEuMiwwbDEuMi0xLjJDMzAuMSwy
|
||||
OC4yLDMwLjEsMjcuNiwyOS43LDI3LjN6IE00LDEzYzAtNSw0LTksOS05YzUsMCw5LDQsOSw5ICAgcy00
|
||||
LDktOSw5QzgsMjIsNCwxOCw0LDEzeiIgY2xhc3M9IkJsYWNrIiAvPg0KICA8L2c+DQo8L3N2Zz4L
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnSearch2.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40
|
||||
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
|
||||
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAANoCAAAC77u/
|
||||
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
|
||||
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
|
||||
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
|
||||
Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
|
||||
MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KCS5Z
|
||||
ZWxsb3d7ZmlsbDojRkZCMTE1O30KCS5CbGFja3tmaWxsOiM3MjcyNzI7fQoJLkdyZWVue2ZpbGw6IzAz
|
||||
OUMyMzt9CgkuUmVke2ZpbGw6I0QxMUMxQzt9Cgkuc3Qwe29wYWNpdHk6MC43NTt9Cgkuc3Qxe29wYWNp
|
||||
dHk6MC41O30KPC9zdHlsZT4NCiAgPGcgaWQ9Ilpvb20iPg0KICAgIDxwYXRoIGQ9Ik0yNy43LDI1LjNM
|
||||
MjAuNSwxOGMxLTEuNCwxLjUtMy4yLDEuNS01YzAtNS00LTktOS05cy05LDQtOSw5YzAsNSw0LDksOSw5
|
||||
YzEuOSwwLDMuNi0wLjYsNS0xLjVsNy4zLDcuMyAgIGMwLjMsMC4zLDAuOSwwLjMsMS4yLDBsMS4yLTEu
|
||||
MkMyOC4xLDI2LjIsMjguMSwyNS42LDI3LjcsMjUuM3ogTTYsMTNjMC0zLjksMy4xLTcsNy03czcsMy4x
|
||||
LDcsN2MwLDMuOS0zLjEsNy03LDdTNiwxNi45LDYsMTN6IiBjbGFzcz0iQmxhY2siIC8+DQogIDwvZz4N
|
||||
Cjwvc3ZnPgs=
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnPrevHighlight.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
@@ -223,26 +243,6 @@
|
||||
ICAgYzAuOS0zLDMuNy01LDctNXM2LjEsMiw3LDVDMjkuMSwyNiwyNi4zLDI4LDIzLDI4eiBNMjMsMjZj
|
||||
LTEuNywwLTMtMS4zLTMtM3MxLjMtMywzLTNzMywxLjMsMywzUzI0LjcsMjYsMjMsMjZ6IiBjbGFzcz0i
|
||||
QmxhY2siIC8+DQogIDwvZz4NCjwvc3ZnPgs=
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnSearch2.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40
|
||||
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
|
||||
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAANoCAAAC77u/
|
||||
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
|
||||
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
|
||||
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
|
||||
Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
|
||||
MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KCS5Z
|
||||
ZWxsb3d7ZmlsbDojRkZCMTE1O30KCS5CbGFja3tmaWxsOiM3MjcyNzI7fQoJLkdyZWVue2ZpbGw6IzAz
|
||||
OUMyMzt9CgkuUmVke2ZpbGw6I0QxMUMxQzt9Cgkuc3Qwe29wYWNpdHk6MC43NTt9Cgkuc3Qxe29wYWNp
|
||||
dHk6MC41O30KPC9zdHlsZT4NCiAgPGcgaWQ9Ilpvb20iPg0KICAgIDxwYXRoIGQ9Ik0yNy43LDI1LjNM
|
||||
MjAuNSwxOGMxLTEuNCwxLjUtMy4yLDEuNS01YzAtNS00LTktOS05cy05LDQtOSw5YzAsNSw0LDksOSw5
|
||||
YzEuOSwwLDMuNi0wLjYsNS0xLjVsNy4zLDcuMyAgIGMwLjMsMC4zLDAuOSwwLjMsMS4yLDBsMS4yLTEu
|
||||
MkMyOC4xLDI2LjIsMjguMSwyNS42LDI3LjcsMjUuM3ogTTYsMTNjMC0zLjksMy4xLTcsNy03czcsMy4x
|
||||
LDcsN2MwLDMuOS0zLjEsNy03LDdTNiwxNi45LDYsMTN6IiBjbGFzcz0iQmxhY2siIC8+DQogIDwvZz4N
|
||||
Cjwvc3ZnPgs=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="PrintDocument1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
|
||||
@@ -59,6 +59,7 @@ Public Class DocumentViewer
|
||||
Private _FilePath As String
|
||||
Private _FileInfo As FileInfo
|
||||
Private _FileLoadMode As FileLoadMode = FileLoadMode.File
|
||||
Private _ViewOverride As String = ""
|
||||
|
||||
' List of all created temp files when converting msg files
|
||||
Private _TempFiles As New List(Of String)
|
||||
@@ -79,6 +80,7 @@ Public Class DocumentViewer
|
||||
End Class
|
||||
|
||||
Public Property FileLoaded As Boolean = False
|
||||
Public Property Viewer_ForceTemporaryMode As Boolean = False
|
||||
Public ReadOnly Property AnnotationsSaved As Boolean
|
||||
Get
|
||||
Return Not _AnnotationsPending
|
||||
@@ -464,8 +466,9 @@ Public Class DocumentViewer
|
||||
_logger.Warn($"Unexpected error in FreeFile: {ex.Message}")
|
||||
End Try
|
||||
End Sub
|
||||
Private Function DoLoadFile(FilePath As String) As Boolean
|
||||
Private Function DoLoadFile(FilePath As String, Optional ViewOverride As String = "") As Boolean
|
||||
Try
|
||||
lblInfo.Visible = False
|
||||
Dim oFileInfo = New FileInfo(FilePath)
|
||||
Dim oExtension As String = oFileInfo.Extension.ToUpper
|
||||
|
||||
@@ -477,42 +480,177 @@ Public Class DocumentViewer
|
||||
SpreadsheetControl1.Dock = DockStyle.None
|
||||
RichEditControl1.Dock = DockStyle.None
|
||||
|
||||
Select Case oExtension.ToUpper
|
||||
Case ".CSV"
|
||||
Dim oFormat = GetSpreadsheetFormat(oExtension)
|
||||
SpreadsheetControl1.LoadDocument(FilePath, oFormat)
|
||||
Dim override_Spreadsheet As Boolean = False
|
||||
If oExtension.ToLower = ".xlsx" Then
|
||||
If oFileInfo.Length > 15000 Then
|
||||
_logger.Info("Override")
|
||||
override_Spreadsheet = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange()
|
||||
oRange.AutoFitColumns()
|
||||
If ViewOverride = "Richtext" Then
|
||||
RichEditControl1.LoadDocument(FilePath, GetDocumentFormat(oExtension))
|
||||
RichEditControl1.Visible = True
|
||||
GdViewer.Visible = False
|
||||
RichEditControl1.Dock = DockStyle.Fill
|
||||
_ViewOverride = "Richtext"
|
||||
_ViewerMode = ViewerMode.Richtext
|
||||
lblInfo.Visible = True
|
||||
lblInfo.Text = "This docx-file contains a generic error and will be displayed in a reduced viewer. Please try to open the file in WORD"
|
||||
ElseIf override_Spreadsheet = True Then
|
||||
Dim oFormat = GetSpreadsheetFormat(oExtension)
|
||||
SpreadsheetControl1.LoadDocument(FilePath, oFormat)
|
||||
|
||||
SpreadsheetControl1.Visible = True
|
||||
GdViewer.Visible = False
|
||||
SpreadsheetControl1.Dock = DockStyle.Fill
|
||||
Case ".EML", ".DOC", ".DOCX", ".ODT", ".RTF", ".TXT"
|
||||
RichEditControl1.LoadDocument(FilePath, GetDocumentFormat(oExtension))
|
||||
Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange()
|
||||
oRange.AutoFitColumns()
|
||||
|
||||
RichEditControl1.Visible = True
|
||||
GdViewer.Visible = False
|
||||
RichEditControl1.Dock = DockStyle.Fill
|
||||
Case Else
|
||||
GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer
|
||||
GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter
|
||||
GdViewer.ForceTemporaryMode = True
|
||||
GdViewer.AnnotationDropShadow = True
|
||||
GdViewer.BackColor = Color.White
|
||||
SpreadsheetControl1.Visible = True
|
||||
GdViewer.Visible = False
|
||||
SpreadsheetControl1.Dock = DockStyle.Fill
|
||||
Else
|
||||
_ViewOverride = ""
|
||||
Select Case oExtension.ToUpper
|
||||
Case ".CSV"
|
||||
Dim oFormat = GetSpreadsheetFormat(oExtension)
|
||||
SpreadsheetControl1.LoadDocument(FilePath, oFormat)
|
||||
|
||||
If GdViewer.DisplayFromFile(FilePath) <> GdPictureStatus.OK Then
|
||||
Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange()
|
||||
oRange.AutoFitColumns()
|
||||
|
||||
Dim oFileName = IO.Path.GetFileName(FilePath)
|
||||
lbFileNotLoaded.Text = String.Format("Datei konnte nicht geladen werden:{0}{1}", vbCrLf, oFileName)
|
||||
lbFileNotLoaded.Visible = True
|
||||
Else
|
||||
If GdViewer.Visible = False Then
|
||||
GdViewer.Visible = True
|
||||
SpreadsheetControl1.Visible = True
|
||||
GdViewer.Visible = False
|
||||
SpreadsheetControl1.Dock = DockStyle.Fill
|
||||
|
||||
'Case ".EML", ".DOC", ".DOCX", ".ODT", ".RTF", ".TXT"
|
||||
' RichEditControl1.LoadDocument(FilePath, GetDocumentFormat(oExtension))
|
||||
|
||||
' RichEditControl1.Visible = True
|
||||
' GdViewer.Visible = False
|
||||
' RichEditControl1.Dock = DockStyle.Fill
|
||||
Case Else
|
||||
Select Case oExtension.ToUpper
|
||||
Case ".EML", ".DOC", ".DOCX", ".XLS", ".XLSX", ".ODT", ".RTF", ".TXT"
|
||||
GdViewer.ForceTemporaryMode = False
|
||||
End Select
|
||||
|
||||
GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer
|
||||
GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter
|
||||
If Viewer_ForceTemporaryMode = True Then
|
||||
GdViewer.ForceTemporaryMode = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End Select
|
||||
GdViewer.AnnotationDropShadow = True
|
||||
GdViewer.BackColor = Color.White
|
||||
|
||||
Dim oGDPState As GdPicture14.GdPictureStatus = GdViewer.DisplayFromFile(FilePath)
|
||||
If oGDPState <> GdPictureStatus.OK Then
|
||||
_logger.Warn($"GdPictureStatus is [{oGDPState}]")
|
||||
If oExtension.ToUpper = ".DOCX" And oGDPState = GdPictureStatus.GenericError Then
|
||||
DoLoadFile(FilePath, "Richtext")
|
||||
Else
|
||||
Dim oFileName = IO.Path.GetFileName(FilePath)
|
||||
lbFileNotLoaded.Text = String.Format("Datei konnte nicht geladen werden:{0}{1}", vbCrLf, oFileName)
|
||||
lbFileNotLoaded.Visible = True
|
||||
End If
|
||||
|
||||
Else
|
||||
If GdViewer.Visible = False Then
|
||||
GdViewer.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End Select
|
||||
End If
|
||||
If _ViewOverride = "Richtext" Then
|
||||
_ViewerMode = ViewerMode.Richtext
|
||||
End If
|
||||
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Function DoLoadFile(FilePath As String) As Boolean
|
||||
Try
|
||||
lblInfo.Visible = False
|
||||
Dim oFileInfo = New FileInfo(FilePath)
|
||||
Dim oExtension As String = oFileInfo.Extension.ToUpper
|
||||
|
||||
lbFileNotLoaded.Visible = False
|
||||
|
||||
SpreadsheetControl1.Visible = False
|
||||
RichEditControl1.Visible = False
|
||||
|
||||
SpreadsheetControl1.Dock = DockStyle.None
|
||||
RichEditControl1.Dock = DockStyle.None
|
||||
Dim Override_SSheet_Filesize As Boolean = False
|
||||
If oExtension.ToLower = ".xlsx" Then
|
||||
If oFileInfo.Length > 100000 Then
|
||||
_logger.Info("Override Spreadsheet as xlsx is too big")
|
||||
Override_SSheet_Filesize = True
|
||||
End If
|
||||
End If
|
||||
If Override_SSheet_Filesize Then
|
||||
Dim oFormat = GetSpreadsheetFormat(oExtension)
|
||||
SpreadsheetControl1.LoadDocument(FilePath, oFormat)
|
||||
|
||||
Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange()
|
||||
oRange.AutoFitColumns()
|
||||
|
||||
SpreadsheetControl1.Visible = True
|
||||
GdViewer.Visible = False
|
||||
SpreadsheetControl1.Dock = DockStyle.Fill
|
||||
Else
|
||||
Select Case oExtension.ToUpper
|
||||
Case ".CSV"
|
||||
Dim oFormat = GetSpreadsheetFormat(oExtension)
|
||||
SpreadsheetControl1.LoadDocument(FilePath, oFormat)
|
||||
|
||||
Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange()
|
||||
oRange.AutoFitColumns()
|
||||
|
||||
SpreadsheetControl1.Visible = True
|
||||
GdViewer.Visible = False
|
||||
SpreadsheetControl1.Dock = DockStyle.Fill
|
||||
Case ".EML", ".DOC", ".DOCX", ".ODT", ".RTF", ".TXT"
|
||||
RichEditControl1.LoadDocument(FilePath, GetDocumentFormat(oExtension))
|
||||
|
||||
RichEditControl1.Visible = True
|
||||
GdViewer.Visible = False
|
||||
RichEditControl1.Dock = DockStyle.Fill
|
||||
Case Else
|
||||
|
||||
GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer
|
||||
GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter
|
||||
If Viewer_ForceTemporaryMode = True Then
|
||||
GdViewer.ForceTemporaryMode = True
|
||||
End If
|
||||
|
||||
GdViewer.AnnotationDropShadow = True
|
||||
GdViewer.BackColor = Color.White
|
||||
|
||||
Dim oGDPState As GdPicture14.GdPictureStatus = GdViewer.DisplayFromFile(FilePath)
|
||||
If oGDPState <> GdPictureStatus.OK Then
|
||||
_logger.Warn($"GdPictureStatus is [{oGDPState}]")
|
||||
If oExtension.ToUpper = ".DOCX" And oGDPState = GdPictureStatus.GenericError Then
|
||||
DoLoadFile(FilePath, "Richtext")
|
||||
Else
|
||||
Dim oFileName = IO.Path.GetFileName(FilePath)
|
||||
lbFileNotLoaded.Text = String.Format("Datei konnte nicht geladen werden:{0}{1}", vbCrLf, oFileName)
|
||||
lbFileNotLoaded.Visible = True
|
||||
End If
|
||||
|
||||
Else
|
||||
If GdViewer.Visible = False Then
|
||||
GdViewer.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End Select
|
||||
End If
|
||||
|
||||
|
||||
UpdateMainUi()
|
||||
|
||||
@@ -568,6 +706,41 @@ Public Class DocumentViewer
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Function StreamFile(Stream As Stream, Extension As String) As Boolean
|
||||
Try
|
||||
|
||||
SpreadsheetControl1.Visible = False
|
||||
SpreadsheetControl1.Dock = DockStyle.None
|
||||
|
||||
Select Case Extension.ToUpper
|
||||
|
||||
Case ".CSV"
|
||||
SpreadsheetControl1.LoadDocument(Stream, GetSpreadsheetFormat(Extension))
|
||||
|
||||
Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange()
|
||||
oRange.AutoFitColumns()
|
||||
|
||||
SpreadsheetControl1.Visible = True
|
||||
SpreadsheetControl1.Dock = DockStyle.Fill
|
||||
|
||||
Case Else
|
||||
GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer
|
||||
GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter
|
||||
GdViewer.ForceTemporaryMode = True
|
||||
GdViewer.AnnotationDropShadow = True
|
||||
|
||||
GdViewer.DisplayFromStream(Stream)
|
||||
|
||||
End Select
|
||||
|
||||
UpdateMainUi()
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetSpreadsheetFormat(Extension) As Spreadsheet.DocumentFormat
|
||||
Dim oFormat As Spreadsheet.DocumentFormat = Spreadsheet.DocumentFormat.Undefined
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.1.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.1.0.0")>
|
||||
<Assembly: AssemblyVersion("2.2.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.2.0.0")>
|
||||
|
||||
Reference in New Issue
Block a user