Subject |
Re: Printing in the "Old" Days using Crystal VBX (Visual dBase 5.7) |
From |
Akshat Kapoor <akshat.kapoor@kapoorsons.in> |
Date |
Sat, 15 Feb 2025 13:29:17 +0530 |
Newsgroups |
dbase.getting-started |
Good Afternoon Louis,
>
> 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:
I cannot help in the above code but the following can be run using
runhidden() of miscapi.prg in duflp.
> !cmd /C "C:\Program Files\Crystal Decisions\Crystal Reports 10\crw32.exe" &RptFile
The command will get executed without the dos window being displayed.
>
> 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.
>
Regards
Akshat
|
|