home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "ocx45"
- Option Explicit
- Global ReportSection As String
- Global GroupCondition As String
- Global PrnFileName As String
- ' Function Parameters
- ' MsgBox parameters
- Global Const MB_OK = 0 ' OK button only
- Global Const MB_ICONSTOP = 16 ' Critical message
- Global Const MB_APPLMODAL = 0 ' Application Modal Message Box
- Global Const MB_DEFBUTTON1 = 0 ' First button is default
- Global Const MB_DEFBUTTON2 = 256 ' Second button is default
- Global Const MB_DEFBUTTON3 = 512 ' Third button is default
- Global Const MB_SYSTEMMODAL = 4096 'System Modal
-
- ' MsgBox return values
- Global Const IDOK = 1 ' OK button pressed
- Global Const IDCANCEL = 2 ' Cancel button pressed
- Global Const IDABORT = 3 ' Abort button pressed
- Global Const IDRETRY = 4 ' Retry button pressed
- Global Const IDIGNORE = 5 ' Ignore button pressed
- Global Const IDYES = 6 ' Yes button pressed
- Global Const IDNO = 7 ' No button pressed
-
-
- Sub PrintError(iPrintErrorNum As Integer)
-
- ' This procedure is designed to trap Crystal Report error codes and present
- ' the user with a choice of how they wish to proceed once recieving the error.
- ' This is to avoid Visual Basic from exiting the application when one of these
- ' errors are encountered.
-
-
- Const Title = "OCXDEMO Error"
- Dim sMsg As String
- Dim iResponse, sMsgDesc As Integer
-
- sMsgDesc = MB_OK + MB_ICONSTOP + MB_DEFBUTTON1 + MB_APPLMODAL
- Select Case iPrintErrorNum
-
- Case 500 'PE_ERR_NOTENOUGHMEMORY
- sMsg = "There is not enough memory available to complete the call."
- sMsg = sMsg & "Please Close other Applications down and try again."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 501 'PE_ERR_INVALIDJOBNO
- sMsg = "You have specified a job number that does not exist."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 502 'PE_ERR_INVALIDHANDLE
- sMsg = "You have specified a handle that does not exist."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 503 'PE_ERR_STRINGTOOLONG
- sMsg = "The string you are calling with PEGetHandleString is too long for the buffer "
- sMsg = sMsg & "allocated. If returned by other routines, it means that the string doesn't end "
- sMsg = sMsg & "with a null byte."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 504 'PE_ERR_NOSUCHREPORT
- sMsg = "You have specified a report that does not exist in the path."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 505 'PE_ERR_NODESTINATION
- sMsg = "You have made the PEStartPrintJob call without "
- sMsg = sMsg & "first specifying a print destination."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 506 'PE_ERR_BADFILENUMBER
- sMsg = "You have tried to set an Nth file name and the file number you specified is "
- sMsg = "out of the existing range. 0<= fileN < N files."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 507 'PE_ERR_BADFILENAME
- sMsg = "There is an error in the file name you specified. Pease make sure that the "
- sMsg = sMsg & "path and report filename are correct"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 508 'PE_ERR_BADFIELDNUMBER
- sMsg = "The field number you specified is out of the existing range."
- sMsg = sMsg & "0 <= fieldN <= N fields."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 509 'PE_ERR_BADFIELDNAME
- sMsg = "The program can't add the field name you specified."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 510 'PE_ERR_BADFORMULANAME
- sMsg = "The program can't add the formula name you specified."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 511 'PE_ERR_BADSORTDIRECTION
- sMsg = "Sort direction must be either Descending or Ascending. You have "
- sMsg = sMsg & "specified a sort direction other than those allowed."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 512 'PE_ERR_ENGINENOTOPEN
- sMsg = "The print engine must be open in order for the call to be successful. Your "
- sMsg = sMsg & "code is lacking a PEOpenEngine call."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 513 'PE_ERR_INVALIDPRINTER
- sMsg = "The printer driver for the printer you specified is missing."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 514 'PE_ERR_PRINTFILEEXISTS
- sMsg = "The name you have specified for the export file already exists. You must delete "
- sMsg = sMsg & "the file and export again or specify a different file."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 515 'PE_ERR_BADFORMULATEXT
- sMsg = "There seems to be a syntax error in a formula being passed to the "
- sMsg = sMsg & "report. Please return to the formula and check the syntax."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 516 'PE_ERR_BADGROUPSECTION
- sMsg = "The group section you specified is now invalid in the report, i.e., a group is "
- sMsg = sMsg & "based on a formula field and the formula has changed so it's no longer suitable "
- sMsg = sMsg & "for basing a group on."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 517 'PE_ERR_ENGINEBUSY
- sMsg = "Only one application can access the print engine at one time. There is "
- sMsg = sMsg & "currently another app using the engine."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 518 'PE_ERR_BADSECTION
- sMsg = "You've given a bad value as the section code for some function like "
- sMsg = sMsg & "PESetGroupCondition."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 519 'PE_ERR_NOPRINTWINDOW
- sMsg = "There is no print window available to make your call successful (for any call "
- sMsg = sMsg & "that depends on a print window already existing: PEGetWindowHandle, "
- sMsg = sMsg & "PECloseWindow, PEPrintWindow)."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 520 'PE_ERR_JOBALREADYSTARTED
- sMsg = "You are trying to start a print job that has already been started. This can "
- sMsg = sMsg & "happen if the user starts a print job and then tries to start printing again "
- sMsg = sMsg & "before the previous printing has finished."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 521 'PE_ERR_BADSUMMARYFIELD
- sMsg = "The summary field specified as a group sort field is invalid or non-existent."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 522 'PE_ERR_NOTENOUGHSYSRES
- sMsg = "There are not enough Windows system resources to process the function."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 523 'PE_ERR_BADGROUPCONDITION
- sMsg = "You have specified an invalid group condition."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 524 'PE_ERR_JOBBUSY
- sMsg = "You tried to initiate printing while Crystal Reports is already printing a job."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 525 'PE_ERR_BADREPORTFILE
- sMsg = "There is something wrong with the report you are trying to open."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 526 'PE_ERR_NODEFAULTPRINTER
- sMsg = "You haven't specified a default printer. Specify a default printer "
- sMsg = sMsg & "via the Windows Control Panel."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 527 'PE_ERR_SQLSQLSERVERERROR
- sMsg = "Unable to connect to the Server. Some of the most common reasons for the error to occur are: "
- sMsg = sMsg & "Database Driver DLLs cannot be found. "
- sMsg = sMsg & "LogonInfo Parameters are not NULL terminated. "
- sMsg = sMsg & "Incorrect Logon Parameters. Ensure that the ServerName, DatabaseName and UserId and Password "
- sMsg = sMsg & "are all valid for the server that you are trying to logon to."
- sMsg = sMsg & "Incorrect StructSize given for LogonInfo Structure. If an incorrect value is given here, a "
- sMsg = sMsg & "SQL Server error may result. The correct value for the StructSize is 514. "
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 528 'PE_ERR_BADLINENUMBER
- sMsg = "You have specified an invalid line number."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 529 'PE_ERR_DISKFULL
- sMsg = "When printing to file or when sorting, the program requires more room than is "
- sMsg = sMsg & "available on the disk."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 530 'PE_ERR_FILEERROR
- sMsg = "In trying to print to file, the program is encountering another file "
- sMsg = sMsg & "problem besides disk full."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 531 'PE_ERR_INCORRECTPASSWORD
- sMsg = "You have specified an incorrect password."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 532 'PE_ERR_BADDATABASEDLL
- sMsg = "The database DLL is corrupt.Add DeBugMode=Yes to the CRW.INI file "
- sMsg = sMsg & "found in the \Windows\ directory so that a better error message "
- sMsg = sMsg & "will be returned."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 533 'PE_ERR_BADDATABASEFILE
- sMsg = "Something is wrong with the database you have specified. You may need to verify "
- sMsg = sMsg & "using the Database|Verify Database command."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 534 'PE_ERR_ERRORINDATABASEDLL
- sMsg = "The database DLL is corrupt. Add DeBugMode=Yes to the CRW.INI file "
- sMsg = sMsg & "found in the \Windows\ directory so that a better error message "
- sMsg = sMsg & "will be returned."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 535 'PE_ERR_DATABASESESSION
- sMsg = "You have attempted to log on using incomplete or incorrect session parameters."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 536 'PE_ERR_DATABASELOGON
- sMsg = "You have attempted to log on using incomplete or incorrect log on parameters."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 537 'PE_ERR_DATABASELOCATION
- sMsg = "The table you have specified can not be found."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 538 'PE_ERR_BADSTRUCTSIZE
- sMsg = "Internal error."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 539 'PE_ERR_BADDATE
- sMsg = "You have specified an Invalid date using the PESetPrintDate command."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 540 'PE_ERR_BADEXPORTDLL
- sMsg = "The DLL required by your export call is either missing or out-of-date."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 541 'PE_ERR_ERRORINEXPORTDLL
- sMsg = "An export DLL has reported an error."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 542 'PE_ERR_PREVATFIRSTPAGE
- sMsg = "You're using the previous page control in the Preview window when "
- sMsg = sMsg & "You are already at the first page of the report."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 543 'PE_ERR_NEXTATLASTPAGE
- sMsg = "You are using the next page control in the Preview window when you're "
- sMsg = sMsg & "already at the last page of the report."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 544 'PE_ERR_CANNOTACCESSREPORT
- sMsg = "Access to report file denied. Another program or user may be using it. "
- sMsg = sMsg & "If an OLE-based reportis already open in CRW and you're trying to "
- sMsg = sMsg & "open it via CRPE, the call will fail."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 546 'PE_ERR_OLE2NOTLOADED
- sMsg = "The program can't open the report (which includes an OLE 2.0 object) because "
- sMsg = sMsg & "OLE 2.0 cannot be loaded."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 547 'PE_ERR_BADCROSSTABGROUP
- sMsg = "You have specified an invalid row or column field in your cross-tab report."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 548 'PE_ERR_NOCTSUMMARIZEDFIELD
- sMsg = "You are trying to run a cross-tab report without specifying a summarized field."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 550 'PE_ERR_INVALIDPAGENUMBER
- sMsg = "You have used an invalid page number with PEShowNthPage."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 552 'PE_ERR_NOTSTOREDPROCEDURE
- sMsg = "Returned by PESetNthParam when there is no table in the current report "
- sMsg = sMsg & "that is based on a stored procedure."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 553 'PE_ERR_INVALIDPARAMETER
- sMsg = "The parameter you have specified does not exist in the stored procedure, "
- sMsg = sMsg & "or the value you have entered is not valid for the specified parameter."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 554 'PE_ERR_GRAPHNOTFOUND
- sMsg = "The graph specified for the section does not exist."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 555 'PE_ERR_INVALIDGRAPHTYPE
- sMsg = "The graph type you have indicated with PESetGraphType is not valid."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
-
- Case 556 'PE_ERR_INVALIDGRAPHDATA
- sMsg = "Returned by PESetGraphData if: "
- sMsg = sMsg & "the report is a crosstab, and colGroupN or rowGroupN is > 1, or "
- sMsg = sMsg & "the report is not a crosstab, and rowGroupN is something other than "
- sMsg = sMsg & "PE_GRAPH_DATA_NULL_SELECTION or colGroupN+1."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 557 'PE_ERR_CANNOTMOVEGRAPH
- sMsg = "Returned by PESetGraphData if the report is not a crosstab, and colGroupN "
- sMsg = sMsg & "differs from the graphs current value for colGroupN."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 577
- sMsg = "DOS error"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 578
- sMsg = "Invalid DOS version"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 579
- sMsg = "File already exists"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 580
- sMsg = "File not found"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 581
- sMsg = "Access denied"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 582
- sMsg = "Too many open files"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 583
- sMsg = "Invalid file handle"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 584
- sMsg = "End of file reached"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 585
- sMsg = "Invalid seek address"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 586
- sMsg = "Disk full"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 587
- sMsg = "Not enough memory"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 588
- sMsg = "Invalid TLV record"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 589
- sMsg = "No more files"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- Case 590
- sMsg = "OLE 2.0 cannot be loaded"
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
-
- Case 20999 'PE_ERR_NOTIMPLEMENTED
- sMsg = "Internal error. Make sure that you have not loaded an older control, or CRPE.DLL "
- sMsg = sMsg & "than is required for the version of Crystal Reports that the report was "
- sMsg = sMsg & "created in. This error message usually occurs when a Print Engine call or "
- sMsg = sMsg & "control property is set and the CRPE.DLL does not support this call."
- iResponse = MsgBox(sMsg, sMsgDesc, Title)
-
- End Select
-
- 'NOTE: DDE Error codes from Version 1.0 of the print engine are listed in the CRPE.H file.
-
-
- End Sub
-
-
- Public Sub Center(AnyForm As Form)
- AnyForm.Left = (Screen.Width - AnyForm.Width) / 2
- AnyForm.Top = (Screen.Height - AnyForm.Height) / 2
-
- End Sub
-
-
-
-
-
- Public Sub FileType(FormatNum As Integer)
-
- Dim iFileType As Integer
-
- iFileType = Demo.CboPrnFileType(FormatNum).ListIndex
-
- Select Case iFileType
-
- Case 0
- Demo.CrystalReport1.PrintFileType = 0 '
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".REC"
- Demo.ChkNumFormat(FormatNum).Enabled = True
- Demo.ChkDateFormat(FormatNum).Enabled = True
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 1
- Demo.CrystalReport1.PrintFileType = 1 '
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".TSV"
- Demo.ChkNumFormat(FormatNum).Enabled = True
- Demo.ChkDateFormat(FormatNum).Enabled = True
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 2
- Demo.CrystalReport1.PrintFileType = 2
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".TXT"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 3
- Demo.CrystalReport1.PrintFileType = 3
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".DIF"
- Demo.ChkNumFormat(FormatNum).Enabled = True
- Demo.ChkDateFormat(FormatNum).Enabled = True
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 4
- Demo.CrystalReport1.PrintFileType = 4 '
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".CSV"
- Demo.ChkNumFormat(FormatNum).Enabled = True
- Demo.ChkDateFormat(FormatNum).Enabled = True
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 5
- Demo.CrystalReport1.PrintFileType = 5 '
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".CHR"
- Demo.ChkNumFormat(FormatNum).Enabled = True
- Demo.ChkDateFormat(FormatNum).Enabled = True
- Demo.LblSep(FormatNum).Enabled = True
- Demo.LblQuote(FormatNum).Enabled = True
- Demo.TxtSep(FormatNum).Enabled = True
- Demo.TxtQuote(FormatNum).Enabled = True
-
- Case 6
- Demo.CrystalReport1.PrintFileType = 6
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".TTX"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 7
- Demo.CrystalReport1.PrintFileType = 7
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".RPT"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 8
- Demo.CrystalReport1.PrintFileType = 8
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".XLS"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 9
- Demo.CrystalReport1.PrintFileType = 9
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".XLS"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 10
- Demo.CrystalReport1.PrintFileType = 10
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".XLS"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 11
- Demo.CrystalReport1.PrintFileType = 19
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".XLS"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 12
- Demo.CrystalReport1.PrintFileType = 11
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".WK1"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 13
- Demo.CrystalReport1.PrintFileType = 12
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".WK3"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 14
- Demo.CrystalReport1.PrintFileType = 13
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".WKS"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 15
- Demo.CrystalReport1.PrintFileType = 14
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".WB1"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 16
- Demo.CrystalReport1.PrintFileType = 15
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".RTF"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 17
- Demo.CrystalReport1.PrintFileType = 16
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".DOC"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 18
- Demo.CrystalReport1.PrintFileType = 17
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".DOC"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
- Case 19
- Demo.CrystalReport1.PrintFileType = 18
- Demo.TxtPrnFileName.Text = UCase(PrnFileName) & ".WPD"
- Demo.ChkNumFormat(FormatNum).Enabled = False
- Demo.ChkDateFormat(FormatNum).Enabled = False
- Demo.LblSep(FormatNum).Enabled = False
- Demo.LblQuote(FormatNum).Enabled = False
- Demo.TxtSep(FormatNum).Enabled = False
- Demo.TxtQuote(FormatNum).Enabled = False
-
-
- End Select
-
- End Sub
-
- Public Sub RptSection(SecNum As Integer)
- Dim Section As String
-
- Section = Demo.CboSecList(SecNum).ListIndex
-
- Select Case Section
-
- Case 0
- ReportSection = "TITLE"
-
- Case 1
- ReportSection = "HEADER"
-
- Case 2
- ReportSection = "GH1"
-
- Case 3
- ReportSection = "GH2"
-
- Case 4
- ReportSection = "GH3"
-
- Case 5
- ReportSection = "GH4"
-
- Case 6
- ReportSection = "GH5"
-
- Case 7
- ReportSection = "GH6"
-
- Case 8
- ReportSection = "GH7"
-
- Case 9
- ReportSection = "GH8"
-
- Case 10
- ReportSection = "GH9"
-
- Case 11
- ReportSection = "DETAIL"
-
- Case 12
- ReportSection = "GF9"
-
- Case 13
- ReportSection = "GF8"
-
- Case 14
- ReportSection = "GF7"
-
- Case 15
- ReportSection = "GF6"
-
- Case 16
- ReportSection = "GF5"
-
- Case 17
- ReportSection = "GF4"
-
- Case 18
- ReportSection = "GF3"
-
- Case 19
- ReportSection = "GF2"
-
- Case 20
- ReportSection = "GF1"
-
- Case 21
- ReportSection = "FOOTER"
-
- Case 22
- ReportSection = "GRNDTTL"
-
- Case 23
- ReportSection = "SUMMARY"
-
- Case 24
- ReportSection = "ALL"
-
- End Select
-
- 'All sections ALL Group Footer 1 section GF1
- 'Title section TITLE Group Footer 2 section GF2
- 'Page Header section HEADER Group Footer 3 section GF3
- 'Group Header 1 section GH1 Group Footer 4 section GF4
- 'Group Header 2 section GH2 Group Footer 5 section GF5
- 'Group Header 3 section GH3 Group Footer 6 section GF6
- 'Group Header 4 section GH4 Group Footer 7 section GF7
- 'Group Header 5 section GH5 Group Footer 8 section GF8
- 'Group Header 6 section GH6 Group Footer 9 section GF9
- 'Group Header 7 section GH7 Grand Total section GRNDTTL
- 'Group Header 8 section GH8 Page Footer section FOOTER
- 'Group Header 9 section GH9 Summary section SUMMARY
- 'Details section DETAIL
-
- End Sub
-
- Public Sub ChooseRpt()
- ' Sets a variable for the report filename, which requires both the path
- ' and file name to qualify
- Dim sReportFile, RptName As String
- Dim NameCnt, FileNameNum As Integer
-
- ' Get the path from the FileList Control and the filename from the FileList Control and then
- ' assign this to a variable to be used with CrystalReport1.ReportFileName.
- sReportFile = Demo.FileList.Path & "\" & Demo.FileList.filename
- Demo.CrystalReport1.ReportFileName = sReportFile
-
- Demo.ResetIndexes 'Reset all of the array indexes used in application
-
-
- Demo.Timer1.Interval = 2000 ' wait 2 seconds before enabaling all other tabs,
- With Demo.MainTab ' and then automatically go to the next tab.
- .TabEnabled(1) = True ' activate all of the tabs so that they can be used.
- .TabEnabled(2) = True ' They are greyed out before a report is chosen.
- .TabEnabled(3) = True
- .TabEnabled(4) = True
- End With
-
- Demo.CmdNext.Enabled = True ' Enable the buttons on the bottom of the form to be
- Demo.CmdBack.Enabled = True ' used once a report is chosen.
- Demo.CmdAccept.Enabled = True
- Demo.CmdCancel.Caption = "Close"
- Demo.MainTab.Tab = 1 ' Set focus to the destination tab.
-
- With Demo.DestTab
- .TabEnabled(1) = False
- .TabEnabled(2) = False
- .TabEnabled(3) = False
- .TabEnabled(4) = False
- End With
-
-
-
- FileNameNum = 1
- NameCnt = 1
-
- Do While RptName <> "."
- PrnFileName = Left(Demo.FileList.filename, FileNameNum)
- NameCnt = NameCnt + 1
- RptName = Mid(Demo.FileList.filename, NameCnt, 1)
- FileNameNum = FileNameNum + 1
- Loop
-
-
- Demo.LoadFileTypes
- Demo.LoadSections
- Demo.LoadCond
- Demo.LoadDataDir
-
- End Sub
-
- Public Sub GrpCondition()
- Dim Cond As String
-
- Cond = Demo.CboCond.ListIndex
-
- Select Case Cond
-
- Case 0
- GroupCondition = "ANYCHANGE"
-
- Case 1
- GroupCondition = "ANYCHANGE"
-
- Case 2
- GroupCondition = "DAILY"
-
- Case 3
- GroupCondition = "WEEKLY"
-
- Case 4
- GroupCondition = "BIWEEKLY"
-
- Case 5
- GroupCondition = "SEMIMONTHLY"
-
- Case 6
- GroupCondition = "MONTHLY"
-
- Case 7
- GroupCondition = "QUARTERLY"
-
- Case 8
- GroupCondition = "SEMIANNUALLY"
-
- Case 9
- GroupCondition = "ANNUALLY"
-
- Case 10
- GroupCondition = "ANYCHANGE"
-
- Case 11
- GroupCondition = "TOYES"
-
- Case 12
- GroupCondition = "TONO"
-
- Case 13
- GroupCondition = "EVERYYES"
-
- Case 14
- GroupCondition = "EVERYNO"
-
- Case 15
- GroupCondition = "NEXTISYES"
-
- Case 16
- GroupCondition = "NEXTISNO"
-
- End Select
-
-
-
-
- End Sub
-