Thanks Brian Bischof for the valueable information.
Yes now i am using the LogOnInfo property of viewer control to set the
server and the database locations.
But when i check the table names i always see the one table in the list, I
do not see the database name embeded with the table name as you explained
Here is what i am doing...
CrystalReportViewer1.ReportSource =
http://Server/ReportService/repservice.asmx
Dim tli As CrystalDecisions.Shared.TableLogOnInfo
For Each tli In CrystalReportViewer1.LogOnInfo '<Here i always see only
one table in the collection irrspective of number of table i actually have
in the report
tli.ConnectionInfo.Password = "password"
tli.ConnectionInfo.UserID = "sa"
tli.ConnectionInfo.ServerName = "ServerName"
tli.ConnectionInfo.DatabaseName = "DatabaseName"
Next
CrystalReportViewer1.Visible = True
Still the problem is same it always querris the database on which i created
the report
Any thoughts
Thanks again
"Brian Bischof" <Br***@NoSpamBischofSystems.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Two things to note here. First is that you actually CAN make changes to
the
database connection using the Viewer control via a web service. Use the
LogonInfo property of the viewer control. Secondly, anytime you change the
server name and database name then you also have to reset the TableName
property back to just the table name. If you examine the TableName
property
in debug mode then you'll notice that the database name is embedded in
this
string and thus needs to be reset.
Secondly, you can make changes to a report using the ReportObject on the
server by doing so within CreateReport() event (part of the hidden
.asmx.vb
file). This isn't really documented anywhere, but I go into details in
Chapter 18 of my book. Anything you do to the ReportObject normally can be
done with a web service. You just have to do it within the CreateReport()
event.
HTH,
Brian Bischof
www.CrystalReportsBook.com
"Sam Fisher" <so*****@microsoft.com> wrote in message
news:e$**************@TK2MSFTNGP12.phx.gbl... Thanks but I do not think that would work for me
As I said the report is hosted on web service and I am accessing the
report by the url such as
CrystalReportViewer1.ReportSource =
http://LocalHost//MyService/MyReport.asmx
So I am not able to get the 'Report' object to iterate thru.
"ZRexRider" <je****@ptd.net> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com... > Something similar to the following works for me.
>
> Search help or Google for SetLogOnInfo
>
>
> Private SUB(byref crxReport as report, byval strServerName as String,
> byval strDatabase as string)
> Dim n as Integer
> ' Loop through all tables in report and update their connection
> parameters
> '
--------------------------------------------------------------------------
--- > For n = 1 To crxReport.Database.Tables.Count
> crxReport.Database.Tables.Item(n).SetLogOnInfo _
> strServerName, _
> strDatabase
> Next n
> End Sub
>