This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Form1.vb
34 lines (32 loc) · 1.52 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports DevExpress.XtraPrinting.Localization
Imports DevExpress.XtraPrinting.Preview
Imports DevExpress.XtraReports.UI
Namespace WindowsFormsApplication3
Partial Public Class Form1
Inherits DevExpress.XtraEditors.XtraForm
Public Sub New()
InitializeComponent()
End Sub
Private Sub simpleButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles simpleButton1.Click
Dim report As New XtraReport1()
Dim tool As New ReportPrintTool(report)
AddHandler tool.PreviewRibbonForm.Shown, AddressOf PreviewForm_Shown
tool.ShowRibbonPreview()
End Sub
Private Sub PreviewForm_Shown(ByVal sender As Object, ByVal e As EventArgs)
SetParametersPanelWidth(sender)
End Sub
Private Sub SetParametersPanelWidth(ByVal sender As Object)
Dim previewForm As PrintPreviewRibbonFormEx = TryCast(sender, PrintPreviewRibbonFormEx)
CType(previewForm.PrintControl.DocumentSource, XtraReport).CreateDocument()
Dim parametersPanel As DevExpress.XtraBars.Docking.DockPanel = GetParametersPanel(previewForm)
parametersPanel.Width = 700
End Sub
Private Function GetParametersPanel(ByVal previewForm As IPrintPreviewForm) As DevExpress.XtraBars.Docking.DockPanel
Return previewForm.PrintControl.GetDockPanel(PreviewDockPanelKind.Parameters)
End Function
End Class
End Namespace