Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sub Reports
Message
From
02/07/2003 01:53:33
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
 
To
01/07/2003 20:46:07
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00805491
Message ID:
00805962
Views:
19
About HTML reporting way, I have this code to show only the print preview window of IE, maybe is useful for you:
*Constants for ExecWB first parameter
#DEFINE OLECMDID_OPEN 1
#DEFINE OLECMDID_NEW 2
#DEFINE OLECMDID_SAVE 3
#DEFINE OLECMDID_SAVEAS 4
#DEFINE OLECMDID_SAVECOPYAS 5
#DEFINE OLECMDID_PRINT 6
#DEFINE OLECMDID_PRINTPREVIEW 7
#DEFINE OLECMDID_PAGESETUP 8
#DEFINE OLECMDID_SPELL 9
#DEFINE OLECMDID_PROPERTIES 10
#DEFINE OLECMDID_CUT 11
#DEFINE OLECMDID_COPY 12
#DEFINE OLECMDID_PASTE 13
#DEFINE OLECMDID_PASTESPECIAL 14
#DEFINE OLECMDID_UNDO 15
#DEFINE OLECMDID_REDO 16
#DEFINE OLECMDID_SELECTALL 17
#DEFINE OLECMDID_CLEARSELECTION 18
#DEFINE OLECMDID_ZOOM 19
#DEFINE OLECMDID_GETZOOMRANGE 20
#DEFINE OLECMDID_UPDATECOMMANDS 21
#DEFINE OLECMDID_REFRESH 22
#DEFINE OLECMDID_STOP 23
#DEFINE OLECMDID_HIDETOOLBARS 24
#DEFINE OLECMDID_SETPROGRESSMAX 25
#DEFINE OLECMDID_SETPROGRESSPOS 26
#DEFINE OLECMDID_SETPROGRESSTEXT 27
#DEFINE OLECMDID_SETTITLE 28
#DEFINE OLECMDID_SETDOWNLOADSTATE 29
#DEFINE OLECMDID_STOPDOWNLOAD 30
*Constants for ExecWB second parameter
#DEFINE OLECMDEXECOPT_DODEFAULT 0 
#DEFINE OLECMDEXECOPT_PROMPTUSER 1
#DEFINE LECMDEXECOPT_DONTPROMPTUSER 2
#DEFINE OLECMDEXECOPT_SHOWHELP 3 
*Constants for QueryStatusWB return values
#DEFINE OLECMDF_SUPPORTED 1 &&Command is supported by this object.
#DEFINE OLECMDF_ENABLED 2 &&Command is available and enabled.
#DEFINE OLECMDF_LATCHED 4 &&Command is an on-off toggle and is currently on.
#DEFINE OLECMDF_NINCHED 8 &&Reserved for future use.
*Constants for ShowWindow second paramter
#DEFINE SW_NORMAL 1
#DEFINE SW_MAXIMIZE 3
#DEFINE SW_MINIMIZE 6
*Constants for SendMessage second parameter
#DEFINE WM_GETICON 0x7F
#DEFINE WM_SETICON 0x80
*Constants for SendMessage third parameter
#DEFINE ICON_SMALL 0
#DEFINE ICON_BIG 1
DECLARE Long FindWindow in Win32API String, String
DECLARE Long BringWindowToTop in Win32API Long
DECLARE Long ShowWindow IN WIN32API Long, Long
DECLARE INTEGER SetWindowText IN user32 INTEGER hWnd, STRING lpString 
DECLARE INTEGER ExtractIcon IN shell32 INTEGER hInst, STRING lpszExeFileName, INTEGER lpiIcon 
DECLARE INTEGER SendMessage IN user32 INTEGER hWnd, INTEGER Msg, INTEGER wParam, INTEGER lParam 
Public oBrowser
Local sTempPath, lnHWND, lcTitle, lnIcon
PUSH Key
ON KEY LABEL ALT+X Cancel && Just in case we get stuck in Do Loop
CREATE CURSOR myCursor (name c(20),address c(20))
INSERT INTO myCursor (name, address) VALUES ("Mike","123")
INSERT INTO myCursor (name, address) VALUES ("Paul","321")
INSERT INTO myCursor (name, address) VALUES ("John","345")
INSERT INTO myCursor (name, address) VALUES ("Ringo","567")
INSERT INTO myCursor (name, address) VALUES ("Georges","987")
GO top
sTempPath = ADDBS(SYS(2023))
IF !FILE(sTempPath + "someSheet.htm")
    SET TEXTMERGE TO memvar lcHTML noshow
    SET TEXTMERGE on
    \\<HTML><BODY><TABLE>
    SCAN
     \<tr>
      FOr lnField = 1 to AFIELDS(laFields)
         \\<td><<EVALUATE(FIELD(m.lnField))>><td>
      ENDFOR
      \</tr>
    ENDSCAN
    \</table></body></html>
    SET TEXTMERGE OFF
    SET TEXTMERGE TO
    STRTOFILE(lcHTML,sTempPath + "someSheet.htm") 
ENDIF
oBrowser=CREATEOBJECT("internetexplorer.application")
oBrowser.navigate(sTempPath + "someSheet.htm")
DO WHILE oBrowser.QueryStatusWB(OLECMDID_PRINTPREVIEW) != (OLECMDF_SUPPORTED + OLECMDF_ENABLED)
    DOEVENTS
ENDDO
oBrowser.ExecWB(OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_PROMPTUSER)
lcTitle = "Print Preview"
lnHWND = 0
DO WHILE lnHWND = 0 &&Seems to take ExecWB a second to create the window so we wait
    DOEVENTS
    lnHWND = FindWindow(null,lcTitle)
enddo
lnIcon= ExtractIcon (0,HOME()+"GRAPHICS\ICONS\WRITING\NOTE11.ICO",0)  && I am assuming this icon exists on your system
SetWindowText(lnHWND, "FISCAL STATISTICS REPORT")
SendMessage(lnHWND, WM_SETICON, ICON_SMALL, lnIcon)
*!* SendMessage(lnHWND, WM_SETICON, ICON_BIG, lnIcon)
BringWindowToTop(lnHWND)
ShowWindow(lnHWND,SW_MAXIMIZE)
CLEAR DLLS "FindWindow", "BringWindowToTop", "ShowWindow", "SetWindowText", "ExtractIcon", "SendMessage"
POP KEY All
Dorin
>Dennis,
>
>I spent a couple of months researching this, and my findings weren't too encouraging. Eventually, I ended up "rolling my own" using HTML, and with a few caveats, it works extremely well. The biggest caveat is the severe limitations of Internet Explorer and both handling large quantities of HTML (say 50 pages or more), and in correctly translating CSS settings (yes they are WC3 standards, and yes IE does not follow them).
>
>The way around it is to use Word to import your HTML, then use Automation to print. You need to do some slight-of-hand, but once you have it working, it works pretty well. Word does a better job of "obeying" certain CSS settings.
>
>I did investigate Crystal, but was warned against it for many reasons, including the size of my reports (up to tens of thousands of pages). The people warning me are very well respected in the VFP world, so I heeded their warning. I think Crystal would have been great if my reports weren't so industrial strength.
>
>Good luck.
>
>David
>>Is there a way of having 'sub reports' similar to the capability that MS Access has?
>>
>>Tks...
Previous
Reply
Map
View

Click here to load this message in the networking platform