PDA

Click to See Complete Forum and Search --> : Crystal XI + VB6


Besoup
Dec 14th, 2006, 08:44 AM
Hey,
I am designing a report that is going to run of a temporary table being created on a SQL Server via VB6. My question is how do I change the source table name in my code so it will look at the current temporary table. My temporary table names will vary but the fields inside them will be identically named. Will changing the source table name of the report effect the report itself if all the field names are the same still?

any input is greatly appreciated.

Besoup
Dec 14th, 2006, 10:17 AM
I have the code to open the report here:

Private Sub RunReport(stTableName As String)
Dim crxApp As New CRAXDDRT.Application
Dim crxReport As CRAXDDRT.Report
Dim crxDatabaseTables As CRAXDDRT.DatabaseTables
Dim crxDatabaseTable As CRAXDDRT.DatabaseTable
Dim crxDatabase As CRAXDDRT.Database
Dim crxParm As CRAXDDRT.ParameterValues
Dim crxSubReport As CRAXDDRT.Report

Dim ReportName As String
ReportName = "\\Server\Reports\PL.rpt"

Set crxReport = crxApp.OpenReport(ReportName)

With crView
.ReportSource = crxReport
.ViewReport
While .IsBusy
DoEvents
Wend
.Zoom "100"
.Visible = True
End With

End Sub

I just want to programmatically change the name of the table that the report is looking at if that is possible...