Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Crystal Reports from a Delphi-written application

Status
Not open for further replies.

TheDelphiBeginner

Programmer
Sep 29, 2003
5
0
0
US
We use Crystal Reports run-time component.
During the application run, when we open a report, it openes in a new window.
Can I control that window? Minimize it, for example.

Thank you.
 
If you are using the CRPE component you should look for the section including:
WindowZoom.Preview = pwPageWidth
WindowZoom.Magnification = -1
WindowStyle.Title = 'Salt Crystals Preview'
WindowState = wsMaximized
This last one could be changed the the wsMinimized I think.
You should also pay attention to the
Export.FileType = RTF
Export.PromptForOptions = True
...various export options.

You may have better luck programmatically changing it. I can only be sooo specific as I am at home and don't have the CRPE component installed (nor enough info on my crystal dev edition to download a fresh one). I did have some code handy that calls it, albeit pretty specific to the ODBC database we use.

This BTW is the guts of the code I use on a report with two date params:

crpe1.OpenEngine;
crpe1.ParamFields.Retrieve;
crpe1.ParamFields[0].AsDate := MCal1.date;
crpe1.ParamFields[1].AsDate := MCal2.date;
crpe1.ParamFields.Send;
crpe1.Execute;

Enjoy
Scotto the Unwise
 
Aha.
The property I was straining to remember at home is
Export.destination = toFile (or toApplication etc etc)

Another note, the DesignControls are your friend. Load and test the report using them, use them to populate the parameters types well before you need them. In each of the parameters you can use a checkbox to tell it to offer the standard crystal parameter dialog or programmatically change it yourself.

Aside from Adobe PDF (which you can only get to if you have the latest greatest runtime, or have full Acrobat installed) the RTF format seems to keep the formatting intact best --for me anyway. Excel adds too many dead cells
(empties added for no reason).

Scotto the Unwise
 
Thank you,
it was crpe indeed and I ended up using the following:

TfrmReportParams(Screen.Forms).crpReports.CloseWindow;

where crpReports is Tcrpe component
and Screen.Forms) is the form it is on.

It worked, thank you.

Didn't find 'minimize' option though. But it is ok.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top