Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- default badges list -->
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/128598055/12.2.8%2B)
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/E4631)
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
<!-- default badges end -->
Expand Down
5 changes: 5 additions & 0 deletions VB/MinimalisticReportPreviewDemo/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Application x:Class="MinimalisticReportPreviewDemo.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
12 changes: 12 additions & 0 deletions VB/MinimalisticReportPreviewDemo/App.xaml.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Imports System.Windows

Namespace MinimalisticReportPreviewDemo

''' <summary>
''' Interaction logic for App.xaml
''' </summary>
Public Partial Class App
Inherits Application

End Class
End Namespace
2 changes: 1 addition & 1 deletion VB/MinimalisticReportPreviewDemo/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Window x:Class="MinimalisticReportPreviewDemo.MainWindow"
<Window x:Class="MinimalisticReportPreviewDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="98" Width="292">
Expand Down
39 changes: 20 additions & 19 deletions VB/MinimalisticReportPreviewDemo/MainWindow.xaml.vb
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
Imports Microsoft.VisualBasic
Imports System.Windows
Imports DevExpress.Xpf.Core
Imports DevExpress.Xpf.Printing
' ...

' ...
Namespace MinimalisticReportPreviewDemo
''' <summary>
''' Interaction logic for MainWindow.xaml
''' </summary>
Partial Public Class MainWindow
Inherits Window
Public Sub New()
ThemeManager.ApplicationThemeName = "Office2007Silver"
InitializeComponent()
End Sub

Private Sub ShowPreview(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim report As New Report()
Dim model As New MyXtraReportPreviewModel(report)
Dim window As New DocumentPreviewWindow() With {.Model = model}
report.CreateDocument(True)
window.ShowDialog()
End Sub
End Class
''' <summary>
''' Interaction logic for MainWindow.xaml
''' </summary>
Public Partial Class MainWindow
Inherits System.Windows.Window

Public Sub New()
ThemeManager.ApplicationThemeName = "Office2007Silver"
Me.InitializeComponent()
End Sub

Private Sub ShowPreview(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
Dim report As MinimalisticReportPreviewDemo.Report = New MinimalisticReportPreviewDemo.Report()
Dim model As MinimalisticReportPreviewDemo.MyXtraReportPreviewModel = New MinimalisticReportPreviewDemo.MyXtraReportPreviewModel(report)
Dim window As DocumentPreviewWindow = New DocumentPreviewWindow() With {.Model = model}
report.CreateDocument(True)
window.ShowDialog()
End Sub
End Class
End Namespace
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OptionInfer>On</OptionInfer>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{03842F9F-5A5D-4B93-9165-A9B9D325709C}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace></RootNamespace>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>
</RootNamespace>
<AssemblyName>MinimalisticReportPreviewDemo</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<OptionExplicit>On</OptionExplicit>
<OptionCompare>Binary</OptionCompare>
<OptionStrict>Off</OptionStrict>
<OptionInfer>On</OptionInfer>
<TargetFrameworkProfile></TargetFrameworkProfile>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<DefineConstants>DEBUG,TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Charts.v12.2.Core, Version=12.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
Expand Down Expand Up @@ -93,7 +94,7 @@
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="Application.xaml">
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
Expand All @@ -110,8 +111,8 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="Application.xaml.vb">
<DependentUpon>Application.xaml</DependentUpon>
<Compile Include="App.xaml.vb">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.vb">
Expand All @@ -120,22 +121,23 @@
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="My Project\AssemblyInfo.vb">
<Compile Include="Properties\AssemblyInfo.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<Compile Include="Properties\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<Compile Include="Properties\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="My Project\Resources.resx">
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>MinimalisticReportPreviewDemo.Properties</CustomToolNamespace>
</EmbeddedResource>
<EmbeddedResource Include="Report.resx">
<DependentUpon>Report.vb</DependentUpon>
Expand All @@ -152,19 +154,19 @@
<None Include="nwindDataSet.xss">
<DependentUpon>nwindDataSet.xsd</DependentUpon>
</None>
<None Include="My Project\Settings.settings">
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<AppDesigner Include="My Project\" />
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Content Include="nwind.mdb">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
Expand Down
78 changes: 40 additions & 38 deletions VB/MinimalisticReportPreviewDemo/MyXtraReportPreviewModel.vb
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
Imports Microsoft.VisualBasic
Imports System
Imports DevExpress.Xpf.Printing
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraPrinting

Namespace MinimalisticReportPreviewDemo
Public Class MyXtraReportPreviewModel
Inherits XtraReportPreviewModel
Public Sub New(ByVal report As XtraReport)
MyBase.New(report)
End Sub
Protected Overrides Sub Print(ByVal parameter As Object)
Dim pt As New PrintTool(Me.Report.PrintingSystemBase)
AddHandler pt.PrintingSystem.StartPrint, AddressOf PrintingSystem_StartPrint
AddHandler pt.PrintingSystem.PrintProgress, AddressOf PrintingSystem_PrintProgress
pt.PrintDialog()
End Sub

Private Sub PrintingSystem_PrintProgress(ByVal sender As Object, ByVal e As PrintProgressEventArgs)

End Sub
Private Sub PrintingSystem_StartPrint(ByVal sender As Object, ByVal e As PrintDocumentEventArgs)

End Sub
Protected Overrides Sub PrintDirect(ByVal parameter As Object)
Dim pt As New PrintTool(Me.Report.PrintingSystemBase)
AddHandler pt.PrintingSystem.StartPrint, AddressOf PrintingSystem_StartPrint
AddHandler pt.PrintingSystem.PrintProgress, AddressOf PrintingSystem_PrintProgress
pt.Print()
End Sub
Protected Overrides Sub Export(ByVal parameter As Object)
If parameter IsNot Nothing Then
If parameter.ToString() = "Xls" Then
PrintingSystem.ExportToXls("test.xls")
System.Windows.MessageBox.Show("!")
System.Diagnostics.Process.Start("test.xls")
Else
MyBase.Export(parameter)
End If
End If
End Sub
End Class

Public Class MyXtraReportPreviewModel
Inherits XtraReportPreviewModel

Public Sub New(ByVal report As XtraReport)
MyBase.New(report)
End Sub

Protected Overrides Sub Print(ByVal parameter As Object)
Dim pt As PrintTool = New PrintTool(Me.Report.PrintingSystemBase)
pt.PrintingSystem.StartPrint += New PrintDocumentEventHandler(AddressOf PrintingSystem_StartPrint)
pt.PrintingSystem.PrintProgress += New PrintProgressEventHandler(AddressOf PrintingSystem_PrintProgress)
pt.PrintDialog()
End Sub

Private Sub PrintingSystem_PrintProgress(ByVal sender As Object, ByVal e As PrintProgressEventArgs)
End Sub

Private Sub PrintingSystem_StartPrint(ByVal sender As Object, ByVal e As PrintDocumentEventArgs)
End Sub

Protected Overrides Sub PrintDirect(ByVal parameter As Object)
Dim pt As PrintTool = New PrintTool(Me.Report.PrintingSystemBase)
pt.PrintingSystem.StartPrint += New PrintDocumentEventHandler(AddressOf PrintingSystem_StartPrint)
pt.PrintingSystem.PrintProgress += New PrintProgressEventHandler(AddressOf PrintingSystem_PrintProgress)
pt.Print()
End Sub

Protected Overrides Sub Export(ByVal parameter As Object)
If parameter IsNot Nothing Then
If Equals(parameter.ToString(), "Xls") Then
PrintingSystem.ExportToXls("test.xls")
System.Windows.MessageBox.Show("!")
System.Diagnostics.Process.Start("test.xls")
Else
MyBase.Export(parameter)
End If
End If
End Sub
End Class
End Namespace
44 changes: 44 additions & 0 deletions VB/MinimalisticReportPreviewDemo/Properties/AssemblyInfo.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Windows

' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
<Assembly:AssemblyTitle("MinimalisticReportPreviewDemo")>
<Assembly:AssemblyDescription("")>
<Assembly:AssemblyConfiguration("")>
<Assembly:AssemblyCompany("")>
<Assembly:AssemblyProduct("MinimalisticReportPreviewDemo")>
<Assembly:AssemblyCopyright("Copyright © 2010")>
<Assembly:AssemblyTrademark("")>
<Assembly:AssemblyCulture("")>
' Setting ComVisible to false makes the types in this assembly not visible
' to COM components. If you need to access a type in this assembly from
' COM, set the ComVisible attribute to true on that type.
<Assembly:ComVisible(False)>
'In order to begin building localizable applications, set
'<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
'inside a <PropertyGroup>. For example, if you are using US english
'in your source files, set the <UICulture> to en-US. Then uncomment
'the NeutralResourceLanguage attribute below. Update the "en-US" in
'the line below to match the UICulture setting in the project file.
'[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
'(used if a resource is not found in the page,
' or application resource dictionaries)
'(used if a resource is not found in the page,
' app, or any theme specific resource dictionaries)
<Assembly:ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)> 'where theme specific resource dictionaries are located
'where the generic resource dictionary is located
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' [assembly: AssemblyVersion("1.0.*")]
<Assembly:AssemblyVersion("1.0.0.0")>
<Assembly:AssemblyFileVersion("1.0.0.0")>
64 changes: 64 additions & 0 deletions VB/MinimalisticReportPreviewDemo/Properties/Resources.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading