- 热门文章:
- · .net中的事务处理(二)
- · .net中的事务处理(转自msdn)
- · Windows Forms简介(转)
- · 使用 Microsoft.NET Frameworks 创建基于 Windows 的应用程序(转)
- · 用VB.net做一个Windows Explore式的窗口。(TreeView、Splitter、ListView结合的应用)
- · 在 Windows 应用程序中使用 Windows XP 的外观风格和 PrintWindow(转)
- · 使用vb.net等待外部程序运行完毕才继续
- · 一个画任意形状的窗体的例子
- · 关于任务栏式的托盘图标及其右键菜单的实现!
- · 用Visual C# 来删除注册表中的注册信息
- · 消息与事件
- · 使用VB.net调用WinAPI方法介绍
上一篇:手把手教你在Win2003下配置ASP.NET开发环境 >>
如何把crystalReport報表應用于Windows應用程序.
以下是一些VB代碼.請大家參考.
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
@#Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private WithEvents btnSelectReport As System.Windows.Forms.Button
Private WithEvents crystalReportViewer As CrystalDecisions.Windows.Forms.CrystalReportViewer
Private components As System.ComponentModel.Container
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.btnSelectReport = New System.Windows.Forms.Button()
Me.crystalReportViewer = New CrystalDecisions.Windows.Forms.CrystalReportViewer()
Me.btnSelectReport.Location = New System.Drawing.Point(8, 8)
Me.btnSelectReport.Size = New System.Drawing.Size(112, 32)
Me.btnSelectReport.TabIndex = 0
Me.btnSelectReport.Text = "Select Report"
Me.crystalReportViewer.ActiveViewIndex = -1
Me.crystalReportViewer.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right)
Me.crystalReportViewer.Location = New System.Drawing.Point(8, 48)
Me.crystalReportViewer.ReportSource = Nothing
Me.crystalReportViewer.Size = New System.Drawing.Size(640, 416)
Me.crystalReportViewer.TabIndex = 1
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(659, 472)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.crystalReportViewer, Me.btnSelectReport})
Me.Text = "View a Crystal Report"
End Sub
#End Region
Private Sub btnSelectReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectReport.Click
Dim dlg As New OpenFileDialog()
dlg.Title = "Select Crystal Reports file"
dlg.Filter = "Crystal Reports (*.rpt)|*.rpt|All Files (*.*)|*.*"
dlg.InitialDirectory = "C:\Program Files\Microsoft Visual Studio.NET\Crystal Reports\Samples\Reports"
If (dlg.ShowDialog() = DialogResult().OK) Then
Me.Cursor = Cursors.WaitCursor
crystalReportViewer().ReportSource = dlg.FileName
Me.Cursor = Cursors.Default
End If
End Sub
End Class
下一篇:.net中的事务处理(二) >>
相关文章:
- · 使用OpenFilleDailog打开文件。
- · VB.net进程处理应用:使用进程运行其他的文件(等同vb的shell)。
- · Delegate的实际应用。
- · 关于在DataGrid里添加ComboBox(二)
- · 关于在DataGrid里添加ComboBox(三)
- · 获得鼠标位置的办法
- · 鸿雪、SohoLife,关于在WinForm中引用Web变量的问题
- · 手把手教你在Win2003下配置ASP.NET开发环境
- · 前面加这个
- · 昨天在WINFORM里已经讨论过这个问题了
- · .NET Remoting编程简介(转)
- · .NET 世界中的远程脚本 (转)
- · 虽然不是.NET的,但对我们理解回调有帮助:如何控制其他程序窗体上的窗口控件:上
- · 在vs3下调试无误的pop3收信程序
- · C#下实现动态系统托盘图标
- · About LinkLabel
- · 当然可以,给你个例子
- · michael_wp原创:用.net实现zip----1
- · michael_wp原创:用.net实现zip----3
- · michael_wp原创:用.net实现zip----4-2
- · michael_wp原创:用.net实现zip----4
- · michael_wp原创:用.net实现zip----5
- · michael_wp原创:用.net实现zip----6
- · vb中使用Windows Forms(转)
- · Windows Forms类层次(转)
- · 提供一个DataGrid的打印类
- · 续
- · 手把手教你在Win2003下配置ASP.NET开发环境
- · 提供一个测试用的“平面按纽”控件代码!如想看结果,请自行编译
- · 转载:用Visual C#动态生成组件,请看!(三)
- · 转载:用Visual C#动态生成组件,请看!(一)
- · 转载:用Visual C#动态生成组件,请看!(二)
- · 可以用API playsound来播放wav
- · 用Api函数播放wav文件
- · 用Visual C#动态生成组件(转自中国在线)
- · Performance Tips and Tricks in .NET Applications(五)
- · Performance Tips and Tricks in .NET Applications(四)
- · Performance Tips and Tricks in .NET Applications(三)
