home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 4 Unleashed
/
Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso
/
repease
/
dmo_vbx.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1995-07-19
|
17KB
|
370 lines
Demo - ReportEase Plus
Form15K
Picture1
ReportEasePlus
&Edit
&Exit
edit_Click
tempX
FormEdit<
Form_Load:
hBuffer!
DemoFile
iFile?
BufLen
FileString
ErrorCode4
ErrorHandlerW
FileName(
CurWnd
StrToHandle
DemoText|
FielLen
FormParam_
TypeFormB
width
height
DataSetName
ShowMenu
ShowHorBar
ShowVerBar
hParenWnd
Rep1_Click
Rep14
hInst
hPrevInst
hFrWnd
styleX
WS_OVERLAPPEDWINDOWU
FontTypeFaceu
RvbFormb
hParentWnd
screen
TwipsPerPixelX
TwipsPerPixelY
Rep1_SelectField
field
TypeField
RvbGetCurField
RvbSetCurField'
SortLevel
FormParmw
RepParm
SwapDir
DataFilec
MAX_FILES
ReadFields
FileNo
FieldName
TextLine
CharReturn<
CurLeno
CurFieldo
LineIdx
DataFiel
READ_LINE
DataField
ShortName]
FullName7
FieldType
DecPlaces
FieldNo
TYPE_TEXT1
TYPE_NUM
TYPE_DBL
TYPE_DATE
TYPE_LOGICALi
TotalFieldsG
OpenNo
iFileNo
Message
MessageBox
GetFormSelection@
TotalForms
GetFormFiles
EditingForm-
report
template]
wildcard
ATTR_NORMALy
FormHdr
TypeFormHdr4
ErrorGetFormFiles
FormSign
FORM_SIGNV
FormNameI
MAX_FORMSN
selection<
NewReportH
FormFile
DlgResult
FormaEdit
Sshow
FormEdit1
Rep1_Unload
CurFile
result
FormField
DlgRe
ParaChar
FileIdx
FieldId
FrmEdit
FrmFile
FrmField
Rep1_VerifyField
MaxFilesk
DiscardNull
Exit_Click
Run_Click
SubFormParm
RvbInit
device
RepP>
PrepareFile
PrintRecords
RvbExit
RvbGetFormFieldS
RvbSetFormField
SortFieldNo#
SalesFileUsed
SortCommand^
TempString
JoinCommand/
TotalSortFieldsf
RvbGetSortField
RvbGetDataField
break
RecoNo
PrintRecordHandler
PrintRecordsHandler
READ_RECORD;
TempValueL
value
RvbSetTextField
RvbSetNumFieldi
source
SRC_APPL,
DataValueH
RvbSetDblField
RvbRec
RvbSetDoubleField
RepParam
TYPE_PICT
Rep1_DrawPicture
hDCv
PictId
PictWidth
RectHeight
RectX
RextY
RvbGetPictureInfo
RectY
RectWidthj
context
Picture
rectangle
Picture1_Click
Picture1
RvbDrawBitmapU
image
PictX
PictInfo
TypePict
PictFieldId
PictY
PictHeight
FileSort
SortFields
SortFielNo
FileJoin
KeyFieldNo
KeyFielNo
edit_Click
check if ReportEase already active!
A Form Editor Window Already Open!
select a report template to edit
A form selected
specify the file name
Error calling the Form Editor!
Exit_Click
Form_Load
Initialize the form editor input structurei
form editor not yet openo
x position in pixel units
y position in pixel units
width and height in pixel units
no file name yet
CUSTOMER
data set name
show menu bar
show horizontal scroll baro
show vertical scroll bars
RvbForm function fills in the editor window handlet
Handle of the RE control window
editor window style
use default type face
Initialize the report input parameter structure
control window handle
window stylew
default swap directorye
set the demo data file names and read the field names
CUSTOMER
SALES
load the customer logo bitmap
LOGO.BMP
GetFormFiles
This function returns the form files found in the
current directory. It also reads each file to get
the report description from the file
file number
oprn and read the file header
add to the list
get the next file
get the next file
GetFormSelection
This routine displays the report template available in
the current directory and lets use select a file to
edit.u
initialize the file namee
total form filesz
accumulate the files with the .FP extension
add new report option to form selection
index of the new report optionn
New Report Form
PrepareFile
This routine sorts the CUSTOMER file. It also creates
a combined by joining the sorted CUSTOMER file and the
SALES file
sort the customer filee
Get the sort fields
get the sort field namee
KeyFieldNo(i) = field.FieldId + 1
The sorted records are stored in the CUSTOMER.SRT file
Check if the SALES file is used for this report
get the field information
do not need to join the sales filei
Join the SALES.DB file to the CUSTOMER.SRT file
These two files have the first common field (customer id)
The output records are stored in the CUSTOMER.SRT filei
PrintRecords
This routine reads each record from the sorted data file
(CUSTOMER.SRT) and fills the values for the report fields
and calls the RvbRec function pass the data to the
report executor.
open the sorted data file
Check if SALES data file is usedX
Initialize the field structuret
read fields values for the next record*
Pass this data field to the VBX
pass picture id
Print the record
user aborted the report
ReadFields
This routine reads the field definition file for the
specified file and extracts the individual field names
and field properties.t
open the field definition file
field definition filef
construct other fields
increment the field no=
Rep1_DrawPicture
This event is fired by the ReportExecutor when it needs
your application to draw a picture. This routine calls
the RvbGetPictureInfo function to get the report device
context, picture id, and rectangle locaton and size where
the picture is to be drawn. This function also returnse
the file and field id for the picture field (this demoe
program does not use these two fields).
This demo program draw different part of the same bitmap
for different picture id.
get the report device context and picture rectangle
specify part of the bitmap to print as a percentage of the width and height
starting X location*
always print only 10 percent of the bitmap
print the entire height
The following statment uses the RvbDrawBitmap functiont
to draw a part of the logo.bmp file. The logo.bmpt
bitmap file is loaded into the 'Picture1' control.t
The 'AutoSize' property of the picture control MUST
be TRUE so that the control does not clip the
bitmap.
temp = RvbDrawBitmap(Rep1.hWnd, Picture1.hWnd,Picture1.image, PictX, PictY, PictWidth, PictHeight)
Rep1_SelectField
This function responds to the field selection event.
This routine can be programmed by your application in
any way as long as it returns the data about the selected*
field using the RvbGetFormField/RvbSetFormField functions.
In this routine we will allow the user to first select a file and then
select a field from the chosen file. The required data about the selected
field is filled into the 'field' structure variable and passed over to
ReportEase using the RvbSetFormField function.
The 'SortLevel' parameter of the RvbGetFormField funtion
specified the sort level if this field will be used for
a section break. If your application will not sort on all
fields, you can restrict the fields that can be selected by the user.e
For a non-sort field, this parameter is set to 0. In this
demo program, we will allow only the fields from the primary
file (CUSTOMER) to be used as sort fields.
get the input field structure
select regular data field
select a data file
select a data field
select sort field
sort field from the CUSTOMER file onlyi
select a data field
return the result
pass the basic field informationn
NULL terminate a string
specify new paragraph indicator field. Use only
for a word-wrapped text type fields
Fill up these OPTIONAL fields also. This information
will be used by our report generator demo program
to identify the fields quickly.
Rep1_Unload
indicate the ReportEase as closed
Rep1_VerifyField
This event is fired by the VBX to validate a field. The
field data should be retrieved by using the g
RvbGetFormField function call. The field name in then
'field' structure contains the file prefix (if your
application allows it). The field name is always in
the upper case. This routine should fill the requirede
data about the field. Your program may also fill the
remaining 'field' structure variables.y
The RvbGetFormField function also returns the sort leveln
for the field, if the field is being used for sort break.
The value of 1 indicates the first sort field, 2 the second, ...a
The 0 value for SortLevel indicates that the field is
not used for sort break.
In this demo program, we will allow only the fields from
the primary file (CUSTOMER) to be used as sort fields.r
This routine returns a True value using the RvbSetFormField
if the field is valid. Otherwise it returns a FALSE value.
discard the NULL character from the field name*
test every file
test every field for a file
note that 'name' in the 'field' structure ise
terminated by a NULL characterc
specify new paragraph indicator field. Use only.
for a word-wrapped text type fields
Fill up these OPTIONAL fields also. This information
will be used by our report generator demo program
to identify the fields quickly.
Run_Click
check if ReportEase already active*
A Form Editor Window Already Open!
select a report template to edit
a form not selected
fill the report parameter structure
specify the file name
output device, A = Ask User
output window location
output window width
output window height
Initialize the report executor
initialize the report
prepare the datafile for output
Feed the records to the report executor
Close the report executor