newsgroups-index (beta)

Current group: dbase.third-party-tools

Rep32.prg

Rep32.prg  
Steve
 Re: Rep32.prg  
David Stone
From:Steve
Subject:Rep32.prg
Date:Thu, 6 Jan 2005 18:05:23 -0500
Pardon my ignorance, but I am having problems finding rep32.prg. I can't
locate dbasetalk.com/codelib newsgroup.

Thanks for your help.

Steve
From:David Stone
Subject:Re: Rep32.prg
Date:Thu, 06 Jan 2005 23:20:30 -0800
Steve wrote:

> Pardon my ignorance, but I am having problems finding rep32.prg. I can't
> locate dbasetalk.com/codelib newsgroup.
>
> Thanks for your help.

Hi Steve,

You have to specify the news.dbasetalk.com server as you did this server
(news.dbase.com) and then the various newsgroups should show up in a list so
you can subscribe to the ones you want. Meanwhile, the code from Jim's post
is pasted below.

David




*-- Last updated on: 11/27/02
*-- By: Eric @ Borland way back in the early days --*

*-- Revised By: Greg Hill to make useable with
*-- 32 bit CRPE32.DLL and dBASE 32 BIT
*-- Added extra parameter (cRtable)
*--
// Further revised by Jim Sare (Nov/04/2004) to (hopefully)
// fix incorrect EXTERN prototypes.
*--
* Old notes...
*---this was posted several years ago on the old Compuserve forum
*---it has worked well for me in 5.6 without loss of resources

*---example call from within a program as follows:

*---do rep2 with "myreportname.rpt","c:\fullpath\fullname.dbf"
*---The .dbf extention is required

*---substituting the name of your report and table

*---Note the table name can be changed at run time but the
*---Structure must remain identical to the original.
*---This program uses Crystal 32 bit and was intended
*---for single table use. All relationships and calculations
*---should be done in dBASE and exported to a flat file which
*---is then passed on as a parameter to this program.

// Dependencies: CRPE32.DLL (in the path)
//


Parameters cReport, cRtable

#define WS_CLIPSIBLINGS HTOI('04000000')
#define WS_CLIPCHILDREN HTOI('02000000')
#define WS_VISIBLE HTOI('10000000')
#define WS_DISABLED HTOI('08000000')
#define WS_MINIMIZE HTOI('20000000')
#define WS_MAXIMIZE HTOI('01000000')
#define WS_CAPTION HTOI('00C00000')
#define WS_BORDER HTOI('00800000')
#define WS_DLGFRAME HTOI('00400000')
#define WS_VSCROLL HTOI('00200000')
#define WS_HSCROLL HTOI('00100000')
#define WS_SYSMENU HTOI('00080000')
#define WS_THICKFRAME HTOI('00040000')
#define WS_MINIMIZEBOX HTOI('00020000')
#define WS_MAXIMIZEBOX HTOI('00010000')

///extern CLOGICAL PEOpenEngine(CVOID) crpe32.dll
///extern CUINT PEOpenPrintJob(CSTRING) crpe32.dll
///extern CUINT PEGetNthTableLocation(CUINT, CUINT, CSTRING) crpe32.dll
///extern CUINT PESetNthTableLocation(CUINT, CUINT, CSTRING) crpe32.dll
///extern CLOGICAL PEOutputToPrinter(CUINT, CUINT) crpe32.dll
///extern CLOGICAL PEStartPrintJob(CUINT, CLOGICAL) crpe32.dll
///extern CLOGICAL PEClosePrintJob(CUINT) crpe32.dll
///extern CVOID PECloseEngine(CVOID) crpe32.dll
///EXTERN CLOGICAL PEStartPrintJob(CWORD, CLOGICAL) crpe32.dll
///EXTERN CLOGICAL
PEOutputToWindow(CHANDLE,CSTRING,CINT,CINT,CINT,CINT,CLONG,CHANDLE)
CRPE32.DLL
///EXTERN CLOGICAL PEShowPrintControls(CWORD, CLOGICAL) crpe32.dll
///EXTERN CLOGICAL PESetRefreshData(CWORD, CLOGICAL) crpe32.dll
///EXTERN CLOGICAL PEDiscardSavedData(CWORD) CRPE32.DLL

#define CRYSTALENGINEFILE "crpe32.dll"

if type("PECancelPrintJob") # "FP"
extern CVOID PECancelPrintJob(CSHORT) CRYSTALENGINEFILE
endIf
if type("PECanCloseEngine") # "FP"
extern CLOGICAL PECanCloseEngine() CRYSTALENGINEFILE
endIf
if type("PECloseEngine") # "FP"
extern CVOID PECloseEngine() CRYSTALENGINEFILE
endIf
if type("PEClosePrintJob") # "FP"
extern CLOGICAL PEClosePrintJob(CSHORT) CRYSTALENGINEFILE
endIf
if type("PEDiscardSavedData") # "FP"
extern CLOGICAL PEDiscardSavedData(CSHORT) CRYSTALENGINEFILE
endIf
if type("PEExportTo") # "FP"
extern CLOGICAL PEExportTo(CSHORT, CPTR) CRYSTALENGINEFILE
endIf
if type("PEGetErrorCode") # "FP"
extern CSHORT PEGetErrorCode(CSHORT) CRYSTALENGINEFILE
endIf
if type("PEGetExportOptions") # "FP"
extern CLOGICAL PEGetExportOptions(CSHORT, CPTR) CRYSTALENGINEFILE
endIf
if type("PEGetNthTableLocation") # "FP"
extern CLOGICAL PEGetNthTableLocation(CSHORT, CSHORT, CSTRING)
CRYSTALENGINEFILE
endIf
if type("PEOpenEngine") # "FP"
extern CLOGICAL PEOpenEngine() CRYSTALENGINEFILE
endIf
if type("PEOpenPrintJob") # "FP"
extern CSHORT PEOpenPrintJob(CSTRING) CRYSTALENGINEFILE
endIf
if type("PEOutputToPrinter") # "FP"
extern CLOGICAL PEOutputToPrinter(CSHORT, CSHORT) CRYSTALENGINEFILE
endIf
if type("PEOutputToWindow") # "FP"
extern CLOGICAL PEOutputToWindow(CSHORT, CSTRING, CINT, CINT,;
CINT, CINT, CULONG, CHANDLE)
CRYSTALENGINEFILE
endIf
if type("PESelectPrinter") # "FP"
extern CLOGICAL PESelectPrinter(CSHORT, CSTRING, CSTRING,;
CSTRING, CPTR) CRYSTALENGINEFILE
endIf
if type("PESetFormula") # "FP"
extern CLOGICAL PESetFormula(CSHORT, CSTRING, CSTRING)
CRYSTALENGINEFILE
endIf
if type("PESetNthTableLocation") # "FP"
extern CLOGICAL PESetNthTableLocation(CSHORT, CSHORT, CSTRING)
CRYSTALENGINEFILE
endIf
if type("PESetRefreshData") # "FP"

//////////////////////////////////////////////////////////////////////////
// ** NOTE: Could not find any information on PESetRefreshData. **
//
// ** Prototyped here using assumptions. **
//
// ** Use carefully! **
//

//////////////////////////////////////////////////////////////////////////
extern CLOGICAL PESetRefreshData(CSHORT, CLOGICAL) CRYSTALENGINEFILE
endIf
if type("PESetSelectionFormula") # "FP"
extern CLOGICAL PESetSelectionFormula(CSHORT, CSTRING)
CRYSTALENGINEFILE
endIf
if type("PEShowPrintControls") # "FP"
extern CLOGICAL PEShowPrintControls(CSHORT, CLOGICAL) CRYSTALENGINEFILE

endIf
if type("PEStartPrintJob") # "FP"
extern CLOGICAL PEStartPrintJob(CSHORT, CLOGICAL) CRYSTALENGINEFILE
endIf


public hRhandle

PEOpenEngine()

hRhandle = PEOpenPrintJob(cReport)

Location=space(258)
PEGetNthTableLocation (hRhandle, 0, Location)

Location=stuff(Location,3,len(Location)+2,cRtable)

PESetNthTableLocation (hRhandle, 0, Location)
PEDiscardSavedData(1)
PESetRefreshData(hRhandle,.T.)

*--

F1= NEW FORM()

*DEFINE TEXT TEXT1 OF F1 property ;
FontSize 7,;
FontBold .F.,;
FontName "Arial"

DEFINE PushButton Pu1 of F1

F1.TopMost = .f.
F1.Mdi = .f.
F1.Text = "QS-LIS 2004"
F1.Width = 150
F1.Height = 34
F1.Sizeable = .f.
F1.Maximize =.f.
F1.ScaleFontname = "Paddington"
F1.ScaleFontsize = 8
F1.Autocenter = .t.
* F1.Menufile = "Frm.mnu"

F1.OnClose = {;Destruct(hRhandle,FORM)}

F1.Pu1.Left = 68
f1.pu1.width = 14
F1.pu1.Height= .80
F1.Pu1.Top = 32
F1.Pu1.FontName = "Arial"
F1.Pu1.Height = 1.5
F1.Pu1.FontSize = 8
F1.Pu1.Text = "Κλείσιμο"
F1.Pu1.OnClick = {;Form.Close()}
F1.Pu1.UpBitmap = "RESOURCE #1005"
F1.Open()


PEOutputToWindow(hRhandle,'Report Object',1,1,900,535,;
WS_BORDER + WS_VISIBLE,F1.hwndclient)

PEShowPrintControls(hRhandle,.T.)
lStartPrnJob = PEStartPrintJob(hRhandle,.T.)
RETURN

*-- Clean up --*

PROCEDURE Destruct(hRhandle,MyForm)
PEClosePrintJob(hRhandle)
PECloseEngine()
RELEASE DLL CRPE32.DLL
MyForm.Release()
RETURN
   

Copyright © 2006 newsgroups-index   -   All rights reserved   -   Impressum