首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

请问上那位爷有用过VB+FastReport

2012-06-30 
请教下那位爷有用过VB+FastReport看过用D的用FastReport.但不知道VB能不能也像D那样使用它.那位有用过的介

请教下那位爷有用过VB+FastReport
看过用D的用FastReport.但不知道VB能不能也像D那样使用它.
那位有用过的介绍下好吗.先谢谢了.

[解决办法]
看网上的意思好像vb能用,真的很好吗?
[解决办法]
安装完后在
C:\Program Files\FastReports\FastReport Studio Trial\Examples\VisualBasic\VB6_Demo
里有很多例子

前段时间用了一下,很不错的的报表,但找不到破解版本,只有试用版,你找到的话分享一下,哈哈。

先贴一段ADOQuery里面的代码
Dim WithEvents frx As FastReport.TfrxReport

' This type requird for FileOpenDialog
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type

' Show report
Private Sub Command1_Click()
Rem frx.PreviewOptions.Buttons = pb_Export + pb_Zoom
frx.ShowReport
End Sub

' Load report dialog
Private Sub Command2_Click()
Dim OFName As OPENFILENAME
OFName.lStructSize = Len(OFName)
OFName.lpstrFilter = "FR3 files (*.fr3)" + Chr$(0) + "*.fr3" + Chr$(0) + "All Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)
OFName.lpstrFile = Space$(254)
OFName.nMaxFile = 255
OFName.lpstrFileTitle = Space$(254)
OFName.nMaxFileTitle = 255
'OFName.lpstrInitialDir = "C:\"
OFName.lpstrTitle = "Open report file"
OFName.flags = 0
If GetOpenFileName(OFName) Then
'MsgBox "File to Open: " + Trim$(OFName.lpstrFile)
frx.LoadReportFromFile (Trim$(OFName.lpstrFile))
Else
'MsgBox "Cancel was pressed"
End If
End Sub

' Run report designer
Private Sub Command3_Click()
frx.DesignReport
End Sub

' Modify SQL query
Private Sub Command4_Click()
Dim query_obj As TfrxADOQuery
Dim database_obj As TfrxADODatabase

' Find database object
Set database_obj = frx.FindObject("ADODatabase1")
If database_obj Is Nothing Then
MsgBox "ADO connection object 'ADODatabase1' not found"
Else
Rem MsgBox "ADO connection string: " + Trim$(database_obj.ConnectionString)
' You can set connection string insted of showing it.
End If

' Find query object
Set query_obj = frx.FindObject("ADOQuery1")

If query_obj Is Nothing Then
MsgBox "ADO query object 'ADOQuery1' not found"
Else
Rem MsgBox "Current query: " + Trim$(query_obj.query)
query_obj.Query = "select * from currency_quoting order by EUR;"
End If

Set query_obj = Nothing
Set database_obj = Nothing
End Sub

' Startup code - initialize FR server
Private Sub Form_Load()
Set frx = CreateObject("FastReport.TfrxReport")
frx.EngineOptions.SilentMode = simMessageBoxes
End Sub

' Clean resources
Private Sub Form_Unload(Cancel As Integer)
Set frx = Nothing
End Sub

热点排行