R
rock
Hi All,
i need to create a report,based on 4 tables,over 300
fileds.but dataset only support 100 fileds, so i have to
use OLEDB(ADO).
Now the name of database changed,ex: change "pc_sys2003"
to "pc_sys2004",but the tables is not changed.
how should i write the codes?
the foolowing is right if the database's name is not
changed:
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Dim qds As New ReportDocument
Dim lli As New TableLogOnInfo
Dim ttb As Table
qds.Load(Application.StartupPath & "\CrystalReport5.rpt")
For Each ttb In qds.Database.Tables
lli = ttb.LogOnInfo
With lli.ConnectionInfo
.ServerName = RTrim(ServerName)
.DatabaseName = RTrim(CurServer)
.UserID = RTrim(UserName)
.Password = RTrim(PassWord)
End With
ttb.ApplyLogOnInfo(lli)
Next ttb
CrystalReportViewer1.ReportSource = qds
by the way,it's no use if i change the "CurServer"
and i must change servername in Crystal Report Design Mode
what i want to know is how should i write these codes in
programme?
thanks a lot!
i need to create a report,based on 4 tables,over 300
fileds.but dataset only support 100 fileds, so i have to
use OLEDB(ADO).
Now the name of database changed,ex: change "pc_sys2003"
to "pc_sys2004",but the tables is not changed.
how should i write the codes?
the foolowing is right if the database's name is not
changed:
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Dim qds As New ReportDocument
Dim lli As New TableLogOnInfo
Dim ttb As Table
qds.Load(Application.StartupPath & "\CrystalReport5.rpt")
For Each ttb In qds.Database.Tables
lli = ttb.LogOnInfo
With lli.ConnectionInfo
.ServerName = RTrim(ServerName)
.DatabaseName = RTrim(CurServer)
.UserID = RTrim(UserName)
.Password = RTrim(PassWord)
End With
ttb.ApplyLogOnInfo(lli)
Next ttb
CrystalReportViewer1.ReportSource = qds
by the way,it's no use if i change the "CurServer"
and i must change servername in Crystal Report Design Mode
what i want to know is how should i write these codes in
programme?
thanks a lot!