1&1. Typical Report with Header, Detail and Markup
Label3
$Word Processor Report Demonstrations
System
Label2
Word Processor :
System
Word Processor
Shape3
Label1
!Path for file 7INI.INI in Demo 7:
System
Shape2
Shape1
mnuFile
&File
munExit
E&xit
munAbout
&About...
munRTFDemo
RTFDemo
munPrompt
Prompt for RTF file....
munOneLine
One Line Processing at a time...
munOneLineDialog
%One Line at a time with Dialog Box...
mundirect
DirectDemo
munPrint
&Print
mnuFile_ClickH
Form_Loadb
GetProfileString
SPNGenerateReport
SName
KName
SPNCreateRtfReport
hWnd*
LPSTRrtf
LPSTRtxtH
LPSTRdoc-
LPSTRerrk
Booleani
frmMain
munPrompt_Click
SPNGenerateReportFiles
frm_Main|
frmMainfrm
Form1
SPNAddOneLine*
WORD[
LPSTRline
SPNGenerateLineReports5
LPWORD9
Number
FumctionA
SPNCloseLineReportsz
munHardcoded_Clickw
Demok
MessageBox
Response
DgDef
Titled
MB_OK
munOneLine_ClickC
hSPNRtfReportStruct
SalWaitCursor
strLinesS
nLinesToProcess
nCurrentLine%
berror
Breakr
PointerF
MousePointerR
EndSub
Declaration
SpinList
Reference
munExit_Click
munAbout_Click
SPNAboutBox
munRTFDemo_Click^
Picture1_Click
mundirect_Clicke
munPrint_Click
nLines
nLineNol
qpPrintInitb
nPageColCenter
lpncol
strqpLines
qpPrint
nNewLines
qpEndPage
qpDonew
LPSTR
LPINT
nLinesNo<
lpnrowb
Inter
SPNReportOpen
SPNPrintReportText0
NINTN
SPNReportEject
SPNSetWp
SPNReportClose
SPNPrintDocument<
SPNLineReportsWithDefaults
nDesiredPageWidthW
hSPNReportStruct
nRowsPerPage
nRow)
allow
margine
nPage
SalNumberToStr
sString
SPNReportPrintTexth
SPN_CenterText
SPN_LeftJustify
PrintDirectToPrinter
SPN_RightJustify
SPNRPrintReportTextQ
$SPNPrintReportTextSPNReportPrintText?
Label1_Click
Text2_Change
Frame1_DragDrop
Source<
Control
Option2_Click.
Option1_Click*
MB_OKCANCEL
MB_YESNOCANCEL
MB_YESNO6
MB_ICONSTOPj
MB_ICONQUESTION
MB_ICONEXCLAMATIONG
MB_ICONINFORMATION#
MB_DEFBUTTON2
IDYESR
Command2_Click
CmbDirect_Click_
Command1_Click
CmbDebugging_Clickw
CmbTypical_Click
setpointer
hourglass
sfilertf
sfiletxt)
sfiledoc
sfileerr"
mle_text
Text6
ReportFromFile
Description_Change
Descrip_text_Changel
Descrip_ChangeI
Screen
Create
report-
from=
file\
previously
created
these
demos
w_main0
rb_explain
checkedx
Handle
rb_printW
INFORMATIONG
sWpNamev
CmbMultiple_Click
OpExplain
OpPrint
Globalsfilertfu
CConstn
ReportFrom]
textbox<
Multiw
MultiLine
Descrip_G
Descrip
ddlb_1F
sle_path
Combo1_Change
Combo
Combo1
Text1_Change~
List1
Entry
Processer
Processor
OpPrint_Click
OpExplain_Click
OpView_Clicko
OpView
SPNAutoReportCapsule5
PrintDirectDemo
PrintDirectToS
SPNReportd
SPNAutoReport
SPNPrintReport
CmdGeneric_Click
CmbNested_Click"
ilertf
cmbDesktop_Click
CmbLong_Click
CmbSelf_Click
spath
rb_view1
Path_Change
printingg
directly
MsgOut
LPSTRtx<
Before
running
sureL
directory
changeb
program
Label3_Click
SPNAutoReportDialog+
SPNAutoReportFiles
SPNOpenReportDialog
SPNCloseReport
SPNAddToReport
SPNAbout{
SPNCloseReports
LPSTRTitle
lphSPNReportStructm
lpnRowsN
lpnColumns
SPNGenrateLineReports
SPNReports
SPNOpenReportQ
SPNOpenReports
bView
bValidateInput
LPReportStructB
LPTemplate
sfilerr
illustrates
Label2_Click
ThenExit
DoEnd
szReportTitle
LPSTRszReportTitle
lpnSPNReportStruct
SPNGenerateReportFile
SPNAutoReportDlg
SPNOpenReportDlg$
lphOsfRtfReportStruct
LPSTRinij
CurrDir
hSPNRtfReportStructRec<
lpSPNRtfReportStruct
LPRtfReportStruct
Printer
PrintDebug
oneline
munOneLineDialog_Click
lpOsfRtfReportStruct
RtfReportStruct
NewRtfReportStruct
LPHSPNRtfReportStruct
LPHRtfReportStruct
bShowFile
Declaration of Spinlist.dll
Please refer to Visual Basic docmentation on DLL for more information
on declaring DLL. u
RTF Printing Functions - Program
spinlist.dll
spinlist.dll
spinlist.dll
spinlist.dll
RTF Printing Functions - Reports from an ASCII FileV
spinlist.dll
Declare Function SPNGenerateReportFiles Lib "Spinlist.dll" (ByVal hWnd As Integer) As Integery
spinlist.dll
spinlist.dll
Other RTF Report Functions
spinlist.dll
spinlist.dll
NON-RTF Printing Functions
spinlist.dll
spinlist.dll
spinlist.dll
spinlist.dll
Miscellaneous Functionso
spinlist.dll
spinlist.dll
Define buttons.
Define Icons.
Define other.
WINWORD.EXE
CmbDebugging_Click
Calls an interface to prompt for input file name
If Not SPNGenerateReportFiles(hWnd) Then
MsgBox ("SPNGenerateReportFile Error")
End If
cmbDesktop_Click
5news.rtf
5news.txt
0demo.doc
0demo.err
Demo 5. One unexpected application of nested repeating groups is in the desktop publishing area.
In this example, article headings are in boldface, and text in the article is not.
The newsletter example may have any number of articles, and each article may have any number of paragraphs.
Text wraps automatically into three columns as defined in the template.
CmbDirect_Click
CmbLong_Click
Screen.MousePointer = 11
sfilertf = "6ptslong.rtf"
sfiletxt = "6ptslong.txt"
sfiledoc = "0demo.doc"
sfileerr = "0demo.err"
Demo 6. This demo is too long to run with the demonstration version of SpinList, which limits reports to 500 variables.
Descrip = "Demo 6. This demo illustrates SpinList's performance in producing a complex report over 80 pages long." & NL & NL & "It also shows the advantages of a word processor which never truncates text, and adds new lines to table cells automatically to adjust the cell size to the required size." & NL & NL & "With SpinList, you do not have to reserve ten lines for every occurrence of a text block in which normally only one or two lines are filled in.""
ReportFromFile
CmbMultiple_Click
3multi.rtf
3multi.txt
0demo.doc
0demo.err
Demo 3. This report illustrates how easily SpinList can create a report that contains more than one repeating group.
None of the major Windows report writers can duplicate this feature easily.
Support for multiple repeating groups is one of the major features in SpinList.
CmbNested_Click
4order.rtf
4order.txt
0demo.doc
0demo.err
Demo 4. This complex invoice form was produced for a client, as were all the sample reports in this demo.
The yellow background produced the grayscale on the laser printer that the customer liked best.
CmbSelf_Click
Demo 7. File 7INI.INI contains [Data], [Template], [Output] and [Word Processor] sections, so only the name of the INI file is needed to build the report. This allows a report's data to be sent and/or stored independently of the format template.
In order for this demo to run, the files 1DEMO.RTF and 1DEMO.TXT must be in your path.
7ini.ini
INFORMATION
This report file is not set up for printing. If you wish to print directly directly using the SPNCreateReportFromIni function, do the following: (a) remove the [Word Processor] section from the INI file. This prevents the word processor from loading the report for viewing. (b) After the report file has been created, print it using the SPNPrintDocument function. You may need to retrieve the report file name from the INI file yourself before calling the print function.
INFORMATION
CmbTypical_Click
1demo.rtf
1demo.txt
0demo.doc
0demo.err
Demo 1. The report layout contains a page header with six variables, one repeating line with eight variables plus a fairly complex layout. The output file contains 2 of the reports, with page numbers restarting for the second one. The second report uses RTF markup to change the font size of one of the variables in the new page header.
CmdGeneric_Click
2oneline.rtf
2oneline.txt
0demo.doc
0demo.err
Demo 2. This most basic of report templates contains a single line with one variable as its definition.
This template can be used for form letters with graphic markup, or for a variety of other reports.
Embedded RTF commands may be used as a text markup language wherever appropriate. Embedded RTF is used in this example to add tab stops and to change a few words to boldface.
Description_Change
Form_Load
AmiPro
Ventura Publisher
WordPerfect for Windows
munAbout_Click
munExit_Click
munHardcoded_Click
Call to SPNAutoReport()
SPNAutoReport is used to create a report in which theo
Text file has been previously createde
Const MB_OK = 0.
Dim Response As Integer
1demo.rtf
1demo.txt
1demo.doc
1demo.err
munOneLine_Click
Creates a report by porting data one line at a time.
1demo.rtf
1demo.doc
error.err
Intialization - Get RFT file name and document name to save
If Not SPNLineReportsWithDefaults(frmMain.hWnd, LPRtfReportStruct, "1demo.rtf") Then
Parameters before DLL Call!
hWnd =
LPHRtfReportStruct =
sfilertf =
sfiledoc =
sfileerr =
bview =
Parameters after SPNOpenReport Failed!
hWnd =
LPHRtfReportStruct =
sfilertf =
sfiledoc =
sfileerr =
bview =
SPNOpenReport Failed and bview =
Parameters after SPNOpenReport Succeded!
hWnd =
LPHRtfReportStruct =
sfilertf =
sfiledoc =
sfileerr =
bview =
SPNOpenReport Succeded! and bview =
Open Report Worked
Area=ATHENS
TravelAcct=0-9900-570-903-0-00069-00
WONum=00069
Issued=1993-01-20
Add each line to the RTF document until end.
Close Reportso
Msgbox
munOneLineDialog_Click
It Worked
It Didn't Work
munPrint_Click
nLines = 1
nLineNo = 7
strqpLines(1) = "Maintenance Center: ATHENS"S
strqpLines(2) = "Substation Name: Tokennnee"
strqpLines(3) = "Location Number: 332145""
strqpLines(4) = "W.O. Number: 44232523"5
strqpLines(5) = "Due Date: 1993-01-31"
strqpLines(6) = "Date Issued: 1993-01-20"
Ans = qpPrintInit("winlist.txt", lpnrow, lpncol)
nPageColCenter = lpncol / 2t
Ans = qpPrint(1, nPageColCenter, "Cornfield Power Company")Y
Ans = qpPrint(2, nPageColCenter, "Substation Maintenance")
Ans = qpPrint(3, nPageColCenter, "Work Order")
If nLines <= 3 Then
Ans = qpPrint(nLineNo, 5, strqpLines(nLines))
nLines = nLines + 1
nLineNo = nLineNo + 1
Elsee
Exit Do
End Ifo
nNewLines = 1n
nLineNo = 7
Second Loop
If nNewLines <= 3 Then
Ans = qpPrint(nLineNo, lpncol / 2 + 15, strqpLines(nLines))
nLines = nLines + 1
nNewLines = nNewLines + 1
nLineNo = nLineNo + 1
Elsee
Exit Do
End Ifo
Ans = qpEndPage()e
Ans = qpDone()
munPrompt_Click
Calls an interface to prompt for input file name
OpPrint_Click
OpView_Click
PrintDirectDemo
nDesiredPageWidth = 80
SPINDEMO
Cannot Open Report
SpinList Error
This is the first line in a 4 line report.
The intent is to demonstrate using
SPINLIST to access the printer
directly.
allow for margin
SPINLIST DEMONSTRATION
ReportFromFile
Create report from text file and rtf file.
Text file has been previously created for these demosO
MessageBox "SpinList User Error", M001, INFORMATION!, OK!
MessageBox "SpinList User Error", M001, INFORMATION!, OK!,