-
Re: PHIL WEBER...BEGINNER IN NEED OF HELP PLEASE?
Dear Phil Weber <pweber@teleport.com> wrote:
Ok, so there is no way of doing this at all, that doesn't seem to be a very
good system for VB 6.0 to have created in the first place.
Can you please tell me where I can go to place a request for an article in
VISUAL BASIC Programmers Journal? I would like them to write an article
about Advanced features using Data Reports/ Data Enviorment/Data Designer
within VB 6.o ?
Tell me Phil, is it a better idea to use MS-Access to create a data Report
then access that report through visual basic hence enabling the user to be
able to go back to the main forms within my App.?
As you can see I am a beginner at the creation of Data Reports and I have
spoent several weeks reading books on Reports in VB 6, now I have finally
created my report I find out that I cannot enable my user to disable the
report screen and return to my main App. screen.
bummer....8-(..
Is there a better way of doing a Report?
Please help me,
Thanks in advance,
Brad Isaacs
bradhouse@sprint.ca
> > Is there a way to place an Exit menu or say a command
> > button that will enable the user to go back to the main
> > menu or exit the program?
>
>Brad: No, I don't think there's any easy way to add menu items or command
>buttons to a DataReport window. What you get is what you get. ;-)
>---
>Phil Weber
>
>
-
Re: PHIL WEBER...BEGINNER IN NEED OF HELP PLEASE?
> Can you please tell me where I can go to place a request
> for an article in VBPJ? I would like them to write an article
> about advanced features using Data Reports/Data Environ-
> ment Designer within VB6?
Brad: VBPJ has already published several articles about the Data Environment
and Data Report Designers:
Automate Database and Design Chores, October 1998
( http://www.devx.com/premier/mgznarch...t98/dd1098.pdf )
DED Simplifies Coding Databases, November 1998
( http://www.devx.com/premier/mgznarch...v98/rj1198.pdf )
Build a Database App With VB6, November 1998
( http://www.devx.com/premier/mgznarch...v98/sf1198.pdf )
Tame the Data Environment, July 1999
( http://www.devx.com/premier/mgznarch...l99/sd0799.pdf )
If these articles don't provide the information you're looking for, you can
suggest additional articles by sending e-mail to vbpjedit@fawcette.com .
> Is it a better idea to use MS Access to create a data report
> then access that report through Visual Basic, hence enabling
> the user to be able to go back to the main forms within my
> app?
Users can go back to your app's main form from a VB6 DataReport by closing
the report (clicking on the window's close button (x) in the upper-right
corner, or right-clicking on the window's title bar or clicking on the icon
in the upper-left corner and selecting Close from the window's system menu,
or pressing Alt-F4), or my moving/sizing/minimizing the DataReport window
and clicking on your app's main form to bring it to the foreground, or by
clicking on the main form's icon in the Windows taskbar. So no, the ability
to get back to your main form is not by itself a good reason to use Access
to create reports.
> Is there a better way of doing a report?
VB6's DataReport Designer does have limitations (primarily its ability to
print only to the system default printer and its inability to modify that
printer's settings). If those limitations make it unacceptable for your app,
I recommend a good third-party reporting tool, such as ActiveReports from
Data Dynamics
( http://www.datadynamics.com/products...ts/arinfo.html ), or
Crystal Reports 8 from Seagate Software ( http://www.seagatesoftware.com ).
If you're on a tight budget and your reporting needs are modest, you can
also use VB's Printer object to create reports, or create reports as HTML
files and display them in the user's Web browser.
---
Phil Weber
-
Re: PHIL WEBER...BEGINNER IN NEED OF HELP PLEASE?
Brad Isaacs <bradhouse@sprint.ca> wrote in message
news:3908c2b4$1@news.devx.com...
>
> Dear Phil Weber <pweber@teleport.com> wrote:
>
> Ok, so there is no way of doing this at all, that doesn't seem to be a
very
> good system for VB 6.0 to have created in the first place.
>
Hello Brad!
Phil didn't said there's no way. He said there's no EASY way.
You could add a menu item to the DataReport window thru API and subclassing.
That's no beginner stuff. Anyway, it is very important to remember to save
often, never NEVER close a subclassed program with the IDE's Stop button,
and never try to debug step into the subclassed project code unless you know
how to do it.
Use this code at your own risk... 
Regards,
Sixto
'Paste into code module
'---------------------------------------------------------------------------
--------------
' API Functions
Private Declare Function CreateMenu Lib "user32" () As Long
Private Declare Function SetMenu Lib "user32" (ByVal hWnd As Long, ByVal
hMenu As Long) As Long
Private Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal
hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal
lpNewItem As Any) As Long
Private Declare Function DestroyMenu Lib "user32" (ByVal hMenu As Long) As
Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA"
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA"
(ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal
wParam As Long, ByVal lParam As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal
lParam As Any) As Long
' API Constants
Private Const GWL_WNDPROC = (-4)
Private Const WM_MENUSELECT = &H11F
Private Const WM_SYSCOMMAND = &H112
Private Const SC_CLOSE = &HF060
' Local Vars
Private hMenu As Long
Private OldWinProc As Long
Public Sub HookMenu(ByVal hWnd As Long)
'Create and add new menu
hMenu = CreateMenu()
Call AppendMenu(hMenu, 0&, 0&, "Close")
Call SetMenu(hWnd, hMenu)
' Hook window message handler
OldWinProc = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf NewWinProc)
End Sub
Public Sub UnHookMenu(ByVal hWnd As Long)
Call DestroyMenu(hMenu)
Call SetWindowLong(hWnd, GWL_WNDPROC, OldWinProc)
End Sub
Private Function NewWinProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal
wParam As Long, ByVal lParam As Long) As Long
' Call normal handler
NewWinProc = CallWindowProc(OldWinProc, hWnd, uMsg, wParam, lParam)
' Check if menu clicked
If uMsg = WM_MENUSELECT Then
If lParam = hMenu Then
' Send close message to window
Call SendMessage(hWnd, WM_SYSCOMMAND, SC_CLOSE, 0&)
End If
End If
End Function
'-------------------------------------------------
'Insert code in DataReport Code module
'-------------------------------------------------
Private Sub DataReport_Initialize()
HookMenu Me.hWnd
End Sub
Private Sub DataReport_Terminate()
UnHookMenu Me.hWnd
End Sub
-
Datareport hook
Dear Brad, i implement the DataReport Hook and nothing happends. The DataReport is a MDI child because program requirements, i couldnt test it in SDI interface 'cause im in a hurry, but if you know what could happend i ll appreciate it.
Thanks,
Felipe.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|