Results 1 to 18 of 18

Thread: How to setup a crosstab crystal report?

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2007
    Posts
    98

    How to setup a crosstab crystal report?

    Hi there..

    I have a problem here while setting up a crosstab report using crystal report. I'm currently using: VB6, ADO, MSSQL 2000, Crystal Reports v8.5 with TTX file as data source. I had using this method recently (this was quote from RobDog888's post )

    VB Code:
    1. Option Explicit
    2. 'Add reference to Crystal Reports x.x ActiveX Designer RunTime Library
    3. 'Add reference to Crystal Reports Viewer Control
    4. 'Add reference to Microsoft ActiveX Data Objects 2.x Library
    5. 'oCnn = current open ADO connection object
    6. Private Sub Command1_Click()
    7.  
    8.     Dim oApp As CRAXDRT.Application
    9.     Dim oReport As CRAXDRT.Report
    10.     Dim oRs As ADODB.Recordset
    11.     Dim sSQL As String
    12.  
    13.     sSQL = "SELECT * FROM Table1"
    14.     Set oRs = New ADODB.Recordset
    15.     Set oRs = oCnn.Execute(sSQL)
    16.     Set oApp = New CRAXDRT.Application
    17.     Set oReport = oApp.OpenReport(App.Path & "\MyReport.rpt", 1)
    18.     oReport.Database.SetDataSource oRs, 3, 1
    19.     crvMyCRViewer.ReportSource = oReport
    20.     crvMyCRViewer.ViewReport
    21.  
    22. End Sub

    Then I came into problem when trying to setup a crosstab report. How do I setup a crosstab report using method as described above? Actually I didn't want to go for too much change for my code if possible.

    Is it possible using oReport.Database.SetDataSource for two or more recordset? Because as we know that we need at least 3 tables as data source to create a crosstab report, doesn't it? CMIIW

    Any help would be greatly appreciated. Thank you.
    Last edited by smartcanix; Jan 17th, 2008 at 10:44 AM.

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