Results 1 to 4 of 4

Thread: More Crystal reports... How to maximize and feed them using code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 1999
    Location
    Itabirito,Minas Gerais, Brazil
    Posts
    79

    Post

    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.

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Oshkosh, WI
    Posts
    163

    Post

    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.

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Dec 1999
    Location
    Itabirito,Minas Gerais, Brazil
    Posts
    79

    Post 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width