Help: Getting query info into Crystal Report 
Author Message
 Help: Getting query info into Crystal Report

Hi All,

I have a problem. (Don't we all.)

I have 3 tables Student, Classes and Class Roster.

Student contains Student Information keyed on the SSN field (text 9 chars.)

Classes contains class information and is keyed on the ClassID field
(counter - long)

Class Roster contains information on classes and students:
        RosterID (Counter - Long)
        ClassID (Long - Foreign key to the Classes table)
        SSN (Text 9 - foreign key to the Student table)

In Access  and VB4 I can get a class roster by using a SQL SELECT statement

(SELECT DISTINCTROW Classes.ClassID, Classes.CatalogID, Classes.Section,
Classes.ClassName, Classes.MaxStudents, Classes.CurrentEnrollment,
Classes.StartTime, Classes.EndTime, Student.LastName, Student.FirstNamer
FROM Student INNER JOIN (Classes INNER JOIN ClassRoster ON Classes.ClassID
= ClassRoster.ClassID) ON Student.SSN = ClassRoster.SSN
WHERE ((Classes.ClassID=[Enter a ClassID]));

The problem is how can I use this same query to get a specific class roster
(Classes.ClassID = ?) into a Crystal Report.  

The documentation for Crystal that comes with VB4 does an extremely
inadequate job at showing you how to use the .OCX.

An answer would be great, pointers to Crystal Reports programming resources
would also be greatly appreciated.

Please respond to the newsgroup so that anyone else out there having a
similar problem can be helped too.

Thanks,

Steve St.Jean
American Training Systems, Inc.



Mon, 19 Apr 1999 03:00:00 GMT  
 Help: Getting query info into Crystal Report

Yoe can use a selection formula of Crystal.

Here is an example procedure of printing with an selection formula in VB
(by the way I use Crystal Reports 4.5 prof.):

Dim PrintJob As Integer
Dim iStatus As Integer
Dim qdf As QueryDef

    Screen.MousePointer = 11
    PrintJob = PEOpenPrintJob(App.Path & "\feiten.rpt")
    If PrintJob = 0 Then
        MsgBox "Kan rapport " & App.Path & "\feiten.rpt" & " niet vinden.",
vbOKOnly + vbExclamation, "Fout..."
        Screen.MousePointer = 0
        Exit Sub
    End If
    If PESetSelectionFormula(PrintJob, "{Q20_Feitenregistratie.NUMMER}=" &
Val(txtHoofd(1))) <> 1 Then
        MsgBox "Kan het calculatienummer niet selecteren.", vbOKOnly +
vbExclamation, "Fout..."
        Screen.MousePointer = 0
        Exit Sub
    End If

    iStatus = PEOutputToPrinter(PrintJob, 1)

    If PEStartPrintJob(PrintJob, True) <> 1 Then
        PEClosePrintJob PrintJob
        MsgBox "Kan de printopdracht niet uitvoeren.", vbOKOnly +
vbExclamation, "Fout..."
        Screen.MousePointer = 0
        Exit Sub
    End If
    PEClosePrintJob PrintJob
    Screen.MousePointer = 0

Sorry for the dutch language, but it's a part of a Dutch program of mine. I
hope it will help you !

Greetings,

Marc



Quote:
> Hi All,

> I have a problem. (Don't we all.)

> I have 3 tables Student, Classes and Class Roster.

> Student contains Student Information keyed on the SSN field (text 9
chars.)

> Classes contains class information and is keyed on the ClassID field
> (counter - long)

> Class Roster contains information on classes and students:
>    RosterID (Counter - Long)
>    ClassID (Long - Foreign key to the Classes table)
>    SSN (Text 9 - foreign key to the Student table)

> In Access  and VB4 I can get a class roster by using a SQL SELECT
statement

> (SELECT DISTINCTROW Classes.ClassID, Classes.CatalogID, Classes.Section,
> Classes.ClassName, Classes.MaxStudents, Classes.CurrentEnrollment,
> Classes.StartTime, Classes.EndTime, Student.LastName, Student.FirstNamer
> FROM Student INNER JOIN (Classes INNER JOIN ClassRoster ON
Classes.ClassID
> = ClassRoster.ClassID) ON Student.SSN = ClassRoster.SSN
> WHERE ((Classes.ClassID=[Enter a ClassID]));

> The problem is how can I use this same query to get a specific class
roster
> (Classes.ClassID = ?) into a Crystal Report.  

> The documentation for Crystal that comes with VB4 does an extremely
> inadequate job at showing you how to use the .OCX.

> An answer would be great, pointers to Crystal Reports programming
resources
> would also be greatly appreciated.

> Please respond to the newsgroup so that anyone else out there having a
> similar problem can be helped too.

> Thanks,

> Steve St.Jean
> American Training Systems, Inc.




Mon, 19 Apr 1999 03:00:00 GMT  
 Help: Getting query info into Crystal Report

Quote:

> Hi All,

> I have a problem. (Don't we all.)

> I have 3 tables Student, Classes and Class Roster.

> Student contains Student Information keyed on the SSN field (text 9 chars.)

> Classes contains class information and is keyed on the ClassID field
> (counter - long)

> Class Roster contains information on classes and students:
>         RosterID (Counter - Long)
>         ClassID (Long - Foreign key to the Classes table)
>         SSN (Text 9 - foreign key to the Student table)

> In Access  and VB4 I can get a class roster by using a SQL SELECT statement

> (SELECT DISTINCTROW Classes.ClassID, Classes.CatalogID, Classes.Section,
> Classes.ClassName, Classes.MaxStudents, Classes.CurrentEnrollment,
> Classes.StartTime, Classes.EndTime, Student.LastName, Student.FirstNamer
> FROM Student INNER JOIN (Classes INNER JOIN ClassRoster ON Classes.ClassID
> = ClassRoster.ClassID) ON Student.SSN = ClassRoster.SSN
> WHERE ((Classes.ClassID=[Enter a ClassID]));

> The problem is how can I use this same query to get a specific class roster
> (Classes.ClassID = ?) into a Crystal Report.

> The documentation for Crystal that comes with VB4 does an extremely
> inadequate job at showing you how to use the .OCX.

> An answer would be great, pointers to Crystal Reports programming resources
> would also be greatly appreciated.

> Please respond to the newsgroup so that anyone else out there having a
> similar problem can be helped too.

> Thanks,

> Steve St.Jean
> American Training Systems, Inc.


  Put your query results in a tempory relation.


Mon, 19 Apr 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting Table. Field info from Crystal Reports

2. Help with a join query into Crystal Reports 6 Exception Report

3. Crystal Reports and Crystal Info

4. Crystal Reports and Crystal Info

5. Southern CA, Crystal Reports/Crystal Info expert needed, consultant

6. Crystal Reports Info - Please help

7. Crystal Reports and Crystal Info

8. Southern CA, Crystal Reports/Crystal Info expert needed, consultant

9. Crystal Reports/Crystal Info

10. Crystal Reports 4.5 to Seagate Crystal Info 6.0 API

11. Crystal Reports and Crystal Info newgroups

12. crystal info v.s. crystal reports

 

 
Powered by phpBB® Forum Software