-
Hi, everybody!
I'm using the command:
MyCrystalReportsControl.PrintReport
to display my report to the user. The problem is that the report appears too small. How can I get it to appear using all the screen, since there isn't a command like
MyCrystalReportscontrol.Maximize ?
Another question:
I have connected my CrystalReports Control to a Data object. In the form load event, I set the Data Control Recordsource like this:
MyData.RecordSource = "SELECT Distinctrow last([TAG]), Last(Equipment.Description) AS LastDescription, Max(Calibration.RealDate) AS MaxRealDate, and so on,
and this line doesn't cause any error message, but my report isn't displaying the result of the aggregate function, it's displaying all the lines...
So, I have added the same SQL statment as the SQLQuery Property of my CrystalReport Control. Again, no error messages but again, all the lines in the report.
I can't access the option - Show SQL Query - in the Crystal report itself (after choosing Add-in , Report designer, opening my .rtf file and choosing the –Show SQL Query- option in the Database Menu), so I don't know why it's not displaying the result of my SQL statment.
Any ideas or suggestion?
Thanks very much in advance,
Roselene
P.s. Sorry I didn’t make myself clear this time. In case you think I should give more details, please ask. :)
-
What version of Crystal Reports are you using ?
One option for your screen size problem it to provide your own form (instead of using the one provdided by Crystal). You then use set the WindowParentHandle property to the hwnd of your form.
Regarding the select statement, make sure the report was not saved "with data" in the Crystal Report designer. Aloso you might want to try removing your selection criteria from the report itself.
-
Before you print the report, use WindowState property to specify the state of the window.
Code:
Private Sub Command1_Click()
With CrystalReport1
.WindowState = crptMaximized
.PrintReport
End With
End Sub
-
Thanks a lot!
Glen and Serge,
Thanks a lot for helping me.
Glen, I was saving data with the report, now I can see the result of my SQL Statment.
P.s. I'm using CRW32 4.6.1.116
Is this version very old?
Serge, I'm using your suggestion and it's working pretty well.
Thanks again, people!
Roselene :)