小弟初学active report,急需教程文档!请诸位大虾帮助,谢了!
解决方案 »
- 大家好,我是新手。能够给我写个读取ACESS数据库的实例吗?
- 单选的菜单项目怎样做?
- 问一下这个查询错误是怎么出来的,如果解决?
- 如何连接网页自动输入用户名,密码
- gdi.dll函数ExtTextOutA如何替换啊,VB钩子能实现么?
- 请教如何在一堆的WPS\WORD\EXEL\TXT文件中找出几个特定的文字?!!!
- 如何更改caption里面的字体?或者颜色之类的属性?
- 高分请教如何在OLE控件中操作Word文档
- 怎样才能在程序里面知道当前使用者的默认邮件程序?急!!
- 有哪位高人知道True DBGrid Pro 5.0 的注册号
- 水晶报表,如何让内容垂直居中显示?急急!!1我好郁闷!!!
- 我想用vb做一个mp3的播放器 具体有那些函数 控件什么的 麻烦高手指教一二
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type'BROWSEINFO.ulFlags values:
Private Const BIF_EDITBOX = &H10
Private Const BIF_RETURNONLYFSDIRS = &H1
Private Const BIF_USENEWUI = &H40' notification messages
Private Const BFFM_INITIALIZED = &H1' control messages
Private Const BFFM_SETSELECTION = &H466' constants for nFolder parm of SHGetSpecialFolderLocation
Private Const CSIDL_DESKTOP = &H0Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As Long
Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hWndOwner As Long, ByVal nFolder As Long, ppidl As Long) As Long
Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal pv As Long)Private gmStrPath As String ' global ;( to pass path to callback funcPrivate Function HRSUCCEEDED(hr As Long) As Boolean
HRSUCCEEDED = (hr >= 0)
End FunctionPrivate Function HRFAILED(hr As Long) As Boolean
HRFAILED = (hr < 0)
End Function' simply returns parameter given
Private Function DummyFunc(ByVal param As Long) As Long
DummyFunc = param
End FunctionPrivate Function BrowseCallbackProc(ByVal hwnd As Long, ByVal uMsg As Long, ByVal lParam As Long, ByVal lpData As Long) As Long
On Error Resume Next
Dim pathstring As String ' default path
If uMsg = BFFM_INITIALIZED Then
pathstring = gmStrPath ' assign default path
' Send a message to the dialog box telling it to select this path.
' Note the use of ByVal and the CLng function here.
SendMessage hwnd, BFFM_SETSELECTION, ByVal CLng(1), ByVal pathstring
End If BrowseCallbackProc = 0 ' the function should always return 0
End Function
Public Function hlpBrowseForFolder(hWndOwner As Long, sTitle As String, ByRef sPath As String) As Boolean
Dim bInf As BROWSEINFO
Dim hr As Long
Dim pidl As Long
Dim sRetPath As String hlpBrowseForFolder = False
bInf.hOwner = hWndOwner
hr = SHGetSpecialFolderLocation(hWndOwner, CSIDL_DESKTOP, bInf.pidlRoot)
If HRFAILED(hr) Then Exit Function
bInf.pszDisplayName = Space$(260)
bInf.lpszTitle = sTitle
bInf.ulFlags = BIF_EDITBOX + BIF_USENEWUI + BIF_RETURNONLYFSDIRS
bInf.lpfnCallback = DummyFunc(AddressOf BrowseCallbackProc)
bInf.lParam = 0
bInf.iImage = 0
gmStrPath = sPath
' open browse dialog
pidl = SHBrowseForFolder(bInf)
If pidl <> 0 Then
sRetPath = Space$(260)
hr = SHGetPathFromIDList(pidl, sRetPath)
If HRSUCCEEDED(hr) Then
sRetPath = Left$(sRetPath, InStr(sRetPath, vbNullChar) - 1)
CoTaskMemFree pidl
sPath = sRetPath
hlpBrowseForFolder = True
End If
End If
CoTaskMemFree bInf.pidlRoot
End Function
Option ExplicitPublic Pages As PagesPrivate Sub btnAuxFolder_Click()
Dim sFOlder As String
On Error GoTo ehHTMLFolder
If Not hlpBrowseForFolder(Me.hwnd, "Select the HTML images folder", sFOlder) Then Exit Sub
txtAuxFolder = sFOlder
Exit Sub
ehHTMLFolder:
MsgBox Str(Err.Number) & " - " & Err.Description, vbOKOnly, "Images Folder Select Error"
End SubPrivate Sub btnBrowse_Click(Index As Integer)
On Error GoTo ehBrowse
Select Case Index
Case 0 ' RTF
dlg.Filter = "Rich Text Format (*.RTF)|*.rtf"
Case 1 ' PDF
dlg.Filter = "Portable Document Format (*.pdf)|*.pdf"
Case 2 ' HTML
' No file name
Case 3 ' Excel
dlg.Filter = "Microsoft Excel Document (*.xls)|*.xls"
Case 4 ' TIF
dlg.Filter = "Tagged Image Format (*.tif)|*.tif"
Case 5 ' Text
dlg.Filter = "Text Document (*.txt)|*.txt"
End Select dlg.ShowSave If dlg.FileName <> "" Then txtFilename(Index).Text = dlg.FileName
Exit Sub
ehBrowse:
MsgBox Str(Err.Number) & " - " & Err.Description, vbOKOnly, "Error browsing for filename"
End SubPrivate Sub btnCancel_Click()
Unload Me
End SubPrivate Sub btnHTMLFolder_Click()
Dim sFOlder As String
On Error GoTo ehHTMLFolder
If Not hlpBrowseForFolder(Me.hwnd, "Select the HTML pages folder", sFOlder) Then Exit Sub
txtHTMLFolder.Text = sFOlder
Exit Sub
ehHTMLFolder:
MsgBox Str(Err.Number) & " - " & Err.Description, vbOKOnly, "HTML Folder Select Error"
End Sub
On Error GoTo ehExport If Pages Is Nothing Then Exit Sub
If cboExportFormat.ListIndex < 0 Then Exit Sub
If txtFilename(cboExportFormat.ListIndex) = "" Then Exit Sub
Select Case cboExportFormat.ListIndex
Case 0 ' RTF
Dim rtf As ARExportRTF
Set rtf = New ARExportRTF
rtf.FileName = txtFilename(cboExportFormat.ListIndex).Text
rtf.Export Pages
Set rtf = Nothing
Case 1 ' PDF
Dim lFont As Long
Dim sFonts As String
sFonts = ""
Dim pdf As ARExportPDF
Set pdf = New ARExportPDF
pdf.FileName = txtFilename(cboExportFormat.ListIndex).Text
pdf.AcrobatVersion = cboAcrobatVersion.ListIndex
Select Case cboPDFJPGQuality.ListIndex
Case 0: pdf.JPGQuality = 25
Case 1: pdf.JPGQuality = 50
Case 2: pdf.JPGQuality = 75
Case 3: pdf.JPGQuality = 100 ' No Compression
End Select
' Create a semi-color delimited string of the fonts
' that shouldn't be embedded in the PDF file
For lFont = 0 To lstPDFFonts.ListCount - 1
If lstPDFFonts.Selected(lFont) Then
sFonts = sFonts & lstPDFFonts.List(lFont) & ";"
End If
Next
pdf.SemiDelimitedNeverEmbedFonts = sFonts
pdf.Export Pages
Set pdf = Nothing
Case 2 ' HTML
Dim html As HTMLexport
Set html = New HTMLexport
html.FileNamePrefix = txtFilename(cboExportFormat.ListIndex).Text
If txtHTMLFolder.Text = "" Then
html.HTMLOutputPath = App.Path
Else
html.HTMLOutputPath = txtHTMLFolder.Text
End If
If txtAuxFolder.Text = "" Then
html.AuxOutputPath = App.Path
Else
html.AuxOutputPath = txtAuxFolder.Text
End If
If txtHTMLCharset.Text = "" Then
' Set default value
Else
html.CharacterSet = txtHTMLCharset.Text
End If
html.Title = txtHTMLTitle.Text
html.HTMLVersion = cboHTMLVersion.ListIndex
html.TableOfContents = cboTOCFormat.ListIndex
html.CreateCSSFile = (chkCreateCSS.Value = 1)
html.CreateFramesetPage = (chkCreateFrameset.Value = 1)
html.MHTOutput = (chkMHTArchive.Value = 1)
html.MultiPageOutput = (chkSinglePage.Value = 0)
html.Export Pages
Set html = Nothing
Case 3 ' XLS
Dim xls As ARExportExcel
Set xls = New ARExportExcel
xls.FileName = txtFilename(3).Text
Select Case cboXLSVersion.ListIndex
Case 0: xls.Version = 2
Case 1: xls.Version = 3
Case 2: xls.Version = 4
Case 3: xls.Version = 5
Case 4: xls.Version = 7
Case 5: xls.Version = 8
End Select
xls.AutoRowHeight = (chkXLSAutoRowHeight.Value = 1)
xls.BorderSpace = Val(txtXLSBorderSpace.Text)
xls.DoubleBoundaries = (chkXLSDoubleBoundaries.Value = 1)
xls.GenPagebreaks = (chkXLSGenPageBreaks.Value = 1)
xls.MinColumnWidth = Val(txtXLSMinColWidth.Text)
xls.MinRowHeight = Val(txtXLSMinRowHeight.Text)
xls.MultiSheet = (chkXLSMultisheet.Value = 1)
xls.ShowMarginSpace = (chkXLSShowMarginSpace.Value = 1)
xls.TrimEmptySpace = (chkXLSTrimEmptySpace.Value = 1)
xls.Export Pages
Set xls = Nothing
Case 4 ' TIF
Dim tif As TIFFExport
Set tif = New TIFFExport
tif.FileName = txtFilename(4).Text
tif.Export Pages
Set tif = Nothing
Case 5 ' TXT
Dim txt As ARExportText
Set txt = New ARExportText
txt.FileName = txtFilename(5).Text
txt.TextDelimiter = txtTXTTextDelimiter.Text
txt.SuppressEmptyLines = (chkTXTSupressEmptyLines.Value = 1)
txt.Unicode = (chkTXTUnicode.Value = 1)
txt.Export Pages
Set txt = Nothing
End Select
Unload Me
Exit Sub
ehExport:
MsgBox Str(Err.Number) & " - " & Err.Description, vbOKOnly, "Error Exporting Document"
End SubPrivate Sub cboExportFormat_Click()
On Error GoTo ehExportFormatClick
If cboExportFormat.ListIndex < 0 Then Exit Sub
Dim i As Integer
For i = 0 To 5
picOptions(i).Left = -10000
picOptions(i).Visible = False
Next
picOptions(cboExportFormat.ListIndex).Visible = True
picOptions(cboExportFormat.ListIndex).Left = 1560
Exit Sub
ehExportFormatClick:
MsgBox Str(Err.Number) & " - " & Err.Description, vbOKOnly, "Error ExportFormat_Click"
End SubPrivate Sub Form_Load()
Dim lFont As Long
' Load PDF Fonts
' This routine can be optimized by using API functions to
' enumerate fonts
For lFont = 1 To Screen.FontCount
lstPDFFonts.AddItem Screen.Fonts(lFont)
Next
cboAcrobatVersion.ListIndex = 1 ' 3.x
cboHTMLVersion.ListIndex = 1 ' DHTML
cboPDFJPGQuality.ListIndex = 2 ' 75%
cboTOCFormat.ListIndex = 0 ' None
cboXLSVersion.ListIndex = 5 ' 8.x
End Sub
里面的教程里面有我上传的active report2.0专业版手册
(仔细找)
给我发一份吧
[email protected]
[email protected]