Subject |
Printing in the "Old" Days using Crystal VBX (Visual dBase 5.7) and How to Do it today |
From |
Louis James <l.james@lcsnet.net> |
Date |
Fri, 14 Feb 2025 11:53:46 -0500 |
Newsgroups |
dbase.getting-started |
Good Morning:
I'm going to date myself as well as display a bit of ignorance here. But I need help printing using Crystal. (Yes, I know that dBase 2019 has printing but frankly I have not gotten the hang of it and I have so many reports already designed in Crystal. Any guidance would be most appreciated. Here's the question:
Used to be that I could put the following statements in my WFM:
I installed the Crystal Runtime on the client machine
------------------------------------------------------------------------------------------------------------------------------------
*. This would load the Crystal VBX
*
load dll C:\WINDOWS\SYSTEM\CRYSTAL.VBX
DEFINE CRYSTALREPORT CRYSTALREPORT1 OF THIS;
PROPERTY;
VBStream "SENDRPT.BFM 56",;
Left 77.1641,;
Top 0.1758,;
Height 1.7637,;
Width 5
*
* Then I would have a button to click that would run the Procedure SendRpt
*
Procedure SendRpt
*****************************************************************************
LOCAL RptFile,RptTitle
*
* Let's get the file to run
*
USE CONTROL
RptFile = TRIM(LTRIM(RPTFILE)) + ".RPT"
RptTitle = RPTTITLE
USE
*
* Let's Print this thing
*
Form.CrystalReport1.WindowState = 2 //Maximizes the Screen
Form.CrystalReport1.ReportFilename = RptFile //The Crystal RPT
Form.CrystalReport1.WindowTitle = RptTitle // The Title
Result = Form.CrystalReport1.PrintReport (This actually runs the report)
RETURN
Of course, VBX is a thing of the past and this no longer works. For the moment, the workaround has been:
!cmd /C "C:\Program Files\Crystal Decisions\Crystal Reports 10\crw32.exe" &RptFile
While this works, it's not elegant and let's the user have the opportunity of clobbering the RPT file. They want to use the RPT's because it has the formatting they like.
Any thoughts would be appreciated. Thanks.
|
|