How to change the database of the subreport

R

Ray

Dear all,
By using the following code, I can change the database name of the
crystal report

....
Dim ReportTemp As New ReportDocument
ReportTemp.Load(_report)

For Each table In ReportTemp.Database.Tables
pPrintSetting.OriDataBase = table.Location
pPrintSetting.GetInfo()
logoninfo = table.LogOnInfo
With logoninfo.ConnectionInfo
.ServerName = pPrintSetting.ServerName
.DatabaseName = pPrintSetting.DatabaseName
.UserID = pPrintSetting.UserID
.Password = pPrintSetting.Password
End With
table.ApplyLogOnInfo(logoninfo)
table.Location = String.Concat(pPrintSetting.DatabaseName,
".dbo.", table.Location.Substring(table.Location.LastIndexOf(".") + 1))
Next table
ReportTemp.RecordSelectionFormula = _select
....

However, if there is a subreport in the report, the subreport's database
name cannot be changed, is it possible to change the database name of the
subreport?

Thanks a lot,
Ray
 
P

Peter Proost

Hi Cor,

I must be blind or something because I already use the beta but I don't see
the thingy for makeing shorter links

Greetz Peter
 
P

Peter Proost

Cor,

thanks for the tip. I was looking for something called get a shorter link,
or make a short link that's why I didn't find it :)

Greetz Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top