473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Crystal report web service, change database/server location?

Hi,
I have a crystal reports hosted on the IIS as web service. Everything works fine except that I can not access the database other than the one on which the report originally created.

I am using the LogOnInfo of the viewer to set the user name, password, database location and server names
But the following kb article says 'When using the viewer's LogOnInfo collection, you are unable to change the database/table information for a report web service. The LogOnInfo connection will only allow the report web service to use the database/table information that was used to design the report'


http://support.businessobjects.com/l...s/c2014056.asp

so question is 'How do I programmatically change the server and the database on the fly?'

Thanks for any suggestions

Sam
Jul 21 '05 #1
4 8164
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

Jul 21 '05 #2
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

Jul 21 '05 #3
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


Jul 21 '05 #4
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
>



Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Grant Stanley | last post by:
I'm developing an application in VS.Net 2003 using C#, which uses Crystal Reports. When creating each report, crystal asks where the database to use is, so I specify our SQL server using the ADO...
2
by: GC | last post by:
HI, I'am using Crystal Report with visual Studio .NEt 2003 When i make a report using a store procedure, I can not see all the fields of the store proc and i'm suppose to see those fields. I'm...
7
by: Bernie Yaeger | last post by:
I can't believe that there aren't lots of developers who: 1. create a crystal report that connects to sql server 2. calls the report using the crystalreportviewer control to view it and then,...
4
by: Brian Henry | last post by:
I have a bunch of reports in crystal reports.net, i need to basicly run them on differnt databases depending on which one the user logged into at the vb.net application start (dev, live,...
7
by: Henry | last post by:
I am writing a Windows forms VB.Net/MS SQL application via VS 2003 that utilizes Crystal Reports. I want to be able to dynamically set the report data source at run time. I'm trying to change...
3
by: FeveZ | last post by:
I've been stuck on a problem now for ages and i'm about ready to pack my project in because of it lol. OK here is my scenario. I have an existing Crystal Report, which I have added to my...
4
by: Sam Fisher | last post by:
Hi, I have a crystal reports hosted on the IIS as web service. Everything works fine except that I can not access the database other than the one on which the report originally created. I am...
0
by: Chris | last post by:
I have the following situation in a VB.Net App I am working on: 1.)A report created in VS.Net 2003 using the CR.Net component of VS 2003. 2.)The datasource for the report is a Stored Proc in a...
9
by: Altman | last post by:
I am currently using ASP.Net 2003 and will be upgrading to 2005 sometime in the near future. I have been having issues with using Crystal Reports that were included with .Net to handle my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.