472,328 Members | 1,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

How to change "database and User" into CR9 Webservice

Hello, i'm sorry my bad english :(

I have CR9 Webservice, how to change databadse name and User_name into
Webservice method? (not Viewer Control)

Tks!!

--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org

Feb 20 '06 #1
8 1711
Hi maybe this example can help you, it's a vb.net sample but could help you

http://www.vb-tips.com/default.aspx?...1-e779bfb411c5

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:eh**************@TK2MSFTNGP15.phx.gbl...
Hello, i'm sorry my bad english :(

I have CR9 Webservice, how to change databadse name and User_name into
Webservice method? (not Viewer Control)

Tks!!

--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org

Feb 20 '06 #2
Hi, tks for link :-)

The Sample is not use Webservice :(, the sample use Client pass Parameter :(

How to into webservice change Database? Example:
Client (WF) -- > WS --> Report

Client Pass the parameters for Connection to WS.

I Want Connection setting into WS only, and Client consume WS only

it understands to me?

Tks
--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:uz**************@tk2msftngp13.phx.gbl...
Hi maybe this example can help you, it's a vb.net sample but could help
you

http://www.vb-tips.com/default.aspx?...1-e779bfb411c5

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:eh**************@TK2MSFTNGP15.phx.gbl...
Hello, i'm sorry my bad english :(

I have CR9 Webservice, how to change databadse name and User_name into
Webservice method? (not Viewer Control)

Tks!!

--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org


Feb 20 '06 #3
Hi, can't you use the crpConnectionInfo part from the link, inside the
webservice?

I hope this helps

Greetz Peter

'Part from the sample
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
'If you don't use integrated security
'provide the username and password used to logon to the database
If blnIntegrated = False Then
crpConnectionInfo.UserID = strUserId
crpConnectionInfo.Password = strPassword
End If

'Apply the ConnectionloginInfo to every table that's used inside the
report
For Each tblCurrent In crReportDocument.Database.Tables
crpTableLogOnInfo = tblCurrent.LogOnInfo
crpTableLogOnInfo.ConnectionInfo = crpConnectionInfo
tblCurrent.ApplyLogOnInfo(crpTableLogOnInfo)
Next

'Set the sections collection with report sections
crSections = crReportDocument.ReportDefinition.Sections
For Each crSection In crSections
crReportObjects = crSection.ReportObjects
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject
Then
'If there's a subreport, typecast the reportobject to a
subreport object
crSubreportObject = CType(crReportObject,
SubreportObject)

'Open the subreport
subRepDoc =
crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)

crDatabase = subRepDoc.Database
crTables = crDatabase.Tables

'Loop through all the tables and set the connection
info,
'Pass on the connection info to the logoninfo object
then add the
'logoninfo to the subreport
For Each crTable In crTables
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crpConnectionInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
Next
End If
Next
Next

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:e7**************@TK2MSFTNGP09.phx.gbl...
Hi, tks for link :-)

The Sample is not use Webservice :(, the sample use Client pass Parameter :(
How to into webservice change Database? Example:
Client (WF) -- > WS --> Report

Client Pass the parameters for Connection to WS.

I Want Connection setting into WS only, and Client consume WS only

it understands to me?

Tks
--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:uz**************@tk2msftngp13.phx.gbl...
Hi maybe this example can help you, it's a vb.net sample but could help
you

http://www.vb-tips.com/default.aspx?...1-e779bfb411c5
Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:eh**************@TK2MSFTNGP15.phx.gbl...
Hello, i'm sorry my bad english :(

I have CR9 Webservice, how to change databadse name and User_name into
Webservice method? (not Viewer Control)

Tks!!

--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org



Feb 20 '06 #4
Hi, tks!!

My Webservice code is:

Public Sub New()
Me.ReportSource = Me.Server.MapPath("CR1.rpt")
End Sub

Where insert your code?

--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:%2***************@tk2msftngp13.phx.gbl...
Hi, can't you use the crpConnectionInfo part from the link, inside the
webservice?

I hope this helps

Greetz Peter

'Part from the sample
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
'If you don't use integrated security
'provide the username and password used to logon to the database
If blnIntegrated = False Then
crpConnectionInfo.UserID = strUserId
crpConnectionInfo.Password = strPassword
End If

'Apply the ConnectionloginInfo to every table that's used inside
the
report
For Each tblCurrent In crReportDocument.Database.Tables
crpTableLogOnInfo = tblCurrent.LogOnInfo
crpTableLogOnInfo.ConnectionInfo = crpConnectionInfo
tblCurrent.ApplyLogOnInfo(crpTableLogOnInfo)
Next

'Set the sections collection with report sections
crSections = crReportDocument.ReportDefinition.Sections
For Each crSection In crSections
crReportObjects = crSection.ReportObjects
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject
Then
'If there's a subreport, typecast the reportobject to a
subreport object
crSubreportObject = CType(crReportObject,
SubreportObject)

'Open the subreport
subRepDoc =
crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)

crDatabase = subRepDoc.Database
crTables = crDatabase.Tables

'Loop through all the tables and set the connection
info,
'Pass on the connection info to the logoninfo object
then add the
'logoninfo to the subreport
For Each crTable In crTables
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crpConnectionInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
Next
End If
Next
Next

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:e7**************@TK2MSFTNGP09.phx.gbl...
Hi, tks for link :-)

The Sample is not use Webservice :(, the sample use Client pass Parameter

:(

How to into webservice change Database? Example:
Client (WF) -- > WS --> Report

Client Pass the parameters for Connection to WS.

I Want Connection setting into WS only, and Client consume WS only

it understands to me?

Tks
--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:uz**************@tk2msftngp13.phx.gbl...
> Hi maybe this example can help you, it's a vb.net sample but could help
> you
>
> http://www.vb-tips.com/default.aspx?...1-e779bfb411c5 >
> Greetz Peter
>
> --
> Programming today is a race between software engineers striving to
> build
> bigger and better idiot-proof programs, and the Universe trying to produce > bigger and better idiots. So far, the Universe is winning. (Rich Cook)
>
> "Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
> news:eh**************@TK2MSFTNGP15.phx.gbl...
>> Hello, i'm sorry my bad english :(
>>
>> I have CR9 Webservice, how to change databadse name and User_name into
>> Webservice method? (not Viewer Control)
>>
>> Tks!!
>>
>> --
>>
>> --------------------------
>> Salu2
>> Maxi [MVP SQL SERVER]
>> www.sqlgurus.org
>>
>>
>>
>
>



Feb 20 '06 #5
Public Sub New()
Me.ReportSource = Me.Server.MapPath("CR1.rpt")
End Sub
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:um**************@TK2MSFTNGP14.phx.gbl...
Hi, tks!!

My Webservice code is:

Public Sub New()
Me.ReportSource = Me.Server.MapPath("CR1.rpt")
End Sub

Where insert your code?

--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:%2***************@tk2msftngp13.phx.gbl...
Hi, can't you use the crpConnectionInfo part from the link, inside the
webservice?

I hope this helps

Greetz Peter

'Part from the sample
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
'If you don't use integrated security
'provide the username and password used to logon to the database
If blnIntegrated = False Then
crpConnectionInfo.UserID = strUserId
crpConnectionInfo.Password = strPassword
End If

'Apply the ConnectionloginInfo to every table that's used inside
the
report
For Each tblCurrent In crReportDocument.Database.Tables
crpTableLogOnInfo = tblCurrent.LogOnInfo
crpTableLogOnInfo.ConnectionInfo = crpConnectionInfo
tblCurrent.ApplyLogOnInfo(crpTableLogOnInfo)
Next

'Set the sections collection with report sections
crSections = crReportDocument.ReportDefinition.Sections
For Each crSection In crSections
crReportObjects = crSection.ReportObjects
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject
Then
'If there's a subreport, typecast the reportobject to a
subreport object
crSubreportObject = CType(crReportObject,
SubreportObject)

'Open the subreport
subRepDoc =
crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)

crDatabase = subRepDoc.Database
crTables = crDatabase.Tables

'Loop through all the tables and set the connection
info,
'Pass on the connection info to the logoninfo object
then add the
'logoninfo to the subreport
For Each crTable In crTables
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crpConnectionInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
Next
End If
Next
Next

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:e7**************@TK2MSFTNGP09.phx.gbl...
Hi, tks for link :-)

The Sample is not use Webservice :(, the sample use Client pass Parameter
:(

How to into webservice change Database? Example:
Client (WF) -- > WS --> Report

Client Pass the parameters for Connection to WS.

I Want Connection setting into WS only, and Client consume WS only

it understands to me?

Tks
--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:uz**************@tk2msftngp13.phx.gbl...
> Hi maybe this example can help you, it's a vb.net sample but could

help > you
>
>

http://www.vb-tips.com/default.aspx?...1-e779bfb411c5
>
> Greetz Peter
>
> --
> Programming today is a race between software engineers striving to
> build
> bigger and better idiot-proof programs, and the Universe trying to

produce
> bigger and better idiots. So far, the Universe is winning. (Rich Cook) >
> "Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
> news:eh**************@TK2MSFTNGP15.phx.gbl...
>> Hello, i'm sorry my bad english :(
>>
>> I have CR9 Webservice, how to change databadse name and User_name into >> Webservice method? (not Viewer Control)
>>
>> Tks!!
>>
>> --
>>
>> --------------------------
>> Salu2
>> Maxi [MVP SQL SERVER]
>> www.sqlgurus.org
>>
>>
>>
>
>



Feb 21 '06 #6
Sorry about the previous post, I acedently pressed send

I think this code should help you, I paste my code in your sub new, I hope
it's clear to you

If you use a crReportDocument in windows form app you also need to call
crReportDocument.Dispose() when the form closes. I don't know if this is
also necessary with a webservice, but I think so.

Greetz Peter

'you need to add a reference to these 3 dll's

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.ReportSource

'The variable containing the report
Private crReportDocument As ReportDocument
Public Sub New()

Dim tblCurrent As Table
Dim crSubreportObject As SubreportObject
Dim subRepDoc As New ReportDocument
Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database
Dim crTables As Tables
Dim crTable As Table
Dim crSection As Section
Dim crSections As Sections
Dim crReportObjects As ReportObjects
Dim crReportObject As ReportObject
Dim crLogOnInfo As TableLogOnInfo
Dim crpConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
Dim crpTableLogOnInfo As New CrystalDecisions.Shared.TableLogOnInfo
crReportDocument = New ReportDocument

crReportDocument.Load(Me.Server.MapPath("CR1.rpt") )
Me.ReportSource = crReportDocument

With crpConnectionInfo
.ServerName = "Server"
.DatabaseName = "Database'
End With
'If you don't use integrated security
'provide the username and password used to logon to the database

crpConnectionInfo.UserID = "user"
crpConnectionInfo.Password = "password"

'Apply the ConnectionloginInfo to every table that's used inside the report
For Each tblCurrent In crReportDocument.Database.Tables
crpTableLogOnInfo = tblCurrent.LogOnInfo
crpTableLogOnInfo.ConnectionInfo = crpConnectionInfo
tblCurrent.ApplyLogOnInfo(crpTableLogOnInfo)
Next

'if there are subreports they also need the correct logon info
'Set the sections collection with report sections
crSections = crReportDocument.ReportDefinition.Sections
For Each crSection In crSections
crReportObjects = crSection.ReportObjects
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject
Then
'If there's a subreport, typecast the reportobject to a
subreport object
crSubreportObject = CType(crReportObject,
SubreportObject)

'Open the subreport
subRepDoc =
crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)

crDatabase = subRepDoc.Database
crTables = crDatabase.Tables

'Loop through all the tables and set the connection
info,
'Pass on the connection info to the logoninfo object
then add the
'logoninfo to the subreport
For Each crTable In crTables
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crpConnectionInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
Next
End If
Next
Next
End Sub
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:um**************@TK2MSFTNGP14.phx.gbl...
Hi, tks!!

My Webservice code is:

Public Sub New()
Me.ReportSource = Me.Server.MapPath("CR1.rpt")
End Sub

Where insert your code?

--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:%2***************@tk2msftngp13.phx.gbl...
Hi, can't you use the crpConnectionInfo part from the link, inside the
webservice?

I hope this helps

Greetz Peter

'Part from the sample
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
'If you don't use integrated security
'provide the username and password used to logon to the database
If blnIntegrated = False Then
crpConnectionInfo.UserID = strUserId
crpConnectionInfo.Password = strPassword
End If

'Apply the ConnectionloginInfo to every table that's used inside
the
report
For Each tblCurrent In crReportDocument.Database.Tables
crpTableLogOnInfo = tblCurrent.LogOnInfo
crpTableLogOnInfo.ConnectionInfo = crpConnectionInfo
tblCurrent.ApplyLogOnInfo(crpTableLogOnInfo)
Next

'Set the sections collection with report sections
crSections = crReportDocument.ReportDefinition.Sections
For Each crSection In crSections
crReportObjects = crSection.ReportObjects
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject
Then
'If there's a subreport, typecast the reportobject to a
subreport object
crSubreportObject = CType(crReportObject,
SubreportObject)

'Open the subreport
subRepDoc =
crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)

crDatabase = subRepDoc.Database
crTables = crDatabase.Tables

'Loop through all the tables and set the connection
info,
'Pass on the connection info to the logoninfo object
then add the
'logoninfo to the subreport
For Each crTable In crTables
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crpConnectionInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
Next
End If
Next
Next

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:e7**************@TK2MSFTNGP09.phx.gbl...
Hi, tks for link :-)

The Sample is not use Webservice :(, the sample use Client pass Parameter
:(

How to into webservice change Database? Example:
Client (WF) -- > WS --> Report

Client Pass the parameters for Connection to WS.

I Want Connection setting into WS only, and Client consume WS only

it understands to me?

Tks
--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:uz**************@tk2msftngp13.phx.gbl...
> Hi maybe this example can help you, it's a vb.net sample but could

help > you
>
>

http://www.vb-tips.com/default.aspx?...1-e779bfb411c5
>
> Greetz Peter
>
> --
> Programming today is a race between software engineers striving to
> build
> bigger and better idiot-proof programs, and the Universe trying to

produce
> bigger and better idiots. So far, the Universe is winning. (Rich Cook) >
> "Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
> news:eh**************@TK2MSFTNGP15.phx.gbl...
>> Hello, i'm sorry my bad english :(
>>
>> I have CR9 Webservice, how to change databadse name and User_name into >> Webservice method? (not Viewer Control)
>>
>> Tks!!
>>
>> --
>>
>> --------------------------
>> Salu2
>> Maxi [MVP SQL SERVER]
>> www.sqlgurus.org
>>
>>
>>
>
>



Feb 21 '06 #7
Tks!! Excelent!!! :-))))
--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:%2******************@TK2MSFTNGP10.phx.gbl...
Sorry about the previous post, I acedently pressed send

I think this code should help you, I paste my code in your sub new, I hope
it's clear to you

If you use a crReportDocument in windows form app you also need to call
crReportDocument.Dispose() when the form closes. I don't know if this is
also necessary with a webservice, but I think so.

Greetz Peter

'you need to add a reference to these 3 dll's

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.ReportSource

'The variable containing the report
Private crReportDocument As ReportDocument
Public Sub New()

Dim tblCurrent As Table
Dim crSubreportObject As SubreportObject
Dim subRepDoc As New ReportDocument
Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database
Dim crTables As Tables
Dim crTable As Table
Dim crSection As Section
Dim crSections As Sections
Dim crReportObjects As ReportObjects
Dim crReportObject As ReportObject
Dim crLogOnInfo As TableLogOnInfo
Dim crpConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
Dim crpTableLogOnInfo As New CrystalDecisions.Shared.TableLogOnInfo
crReportDocument = New ReportDocument

crReportDocument.Load(Me.Server.MapPath("CR1.rpt") )
Me.ReportSource = crReportDocument

With crpConnectionInfo
.ServerName = "Server"
.DatabaseName = "Database'
End With
'If you don't use integrated security
'provide the username and password used to logon to the database

crpConnectionInfo.UserID = "user"
crpConnectionInfo.Password = "password"

'Apply the ConnectionloginInfo to every table that's used inside the
report
For Each tblCurrent In crReportDocument.Database.Tables
crpTableLogOnInfo = tblCurrent.LogOnInfo
crpTableLogOnInfo.ConnectionInfo = crpConnectionInfo
tblCurrent.ApplyLogOnInfo(crpTableLogOnInfo)
Next

'if there are subreports they also need the correct logon info
'Set the sections collection with report sections
crSections = crReportDocument.ReportDefinition.Sections
For Each crSection In crSections
crReportObjects = crSection.ReportObjects
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject
Then
'If there's a subreport, typecast the reportobject to a
subreport object
crSubreportObject = CType(crReportObject,
SubreportObject)

'Open the subreport
subRepDoc =
crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)

crDatabase = subRepDoc.Database
crTables = crDatabase.Tables

'Loop through all the tables and set the connection
info,
'Pass on the connection info to the logoninfo object
then add the
'logoninfo to the subreport
For Each crTable In crTables
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crpConnectionInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
Next
End If
Next
Next
End Sub
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:um**************@TK2MSFTNGP14.phx.gbl...
Hi, tks!!

My Webservice code is:

Public Sub New()
Me.ReportSource = Me.Server.MapPath("CR1.rpt")
End Sub

Where insert your code?

--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:%2***************@tk2msftngp13.phx.gbl...
> Hi, can't you use the crpConnectionInfo part from the link, inside the
> webservice?
>
> I hope this helps
>
> Greetz Peter
>
>
>
> 'Part from the sample
> With crpConnectionInfo
> .ServerName = strServer
> .DatabaseName = strDataBase
> End With
> 'If you don't use integrated security
> 'provide the username and password used to logon to the database
> If blnIntegrated = False Then
> crpConnectionInfo.UserID = strUserId
> crpConnectionInfo.Password = strPassword
> End If
>
> 'Apply the ConnectionloginInfo to every table that's used inside
> the
> report
> For Each tblCurrent In crReportDocument.Database.Tables
> crpTableLogOnInfo = tblCurrent.LogOnInfo
> crpTableLogOnInfo.ConnectionInfo = crpConnectionInfo
> tblCurrent.ApplyLogOnInfo(crpTableLogOnInfo)
> Next
>
> 'Set the sections collection with report sections
> crSections = crReportDocument.ReportDefinition.Sections
> For Each crSection In crSections
> crReportObjects = crSection.ReportObjects
> For Each crReportObject In crReportObjects
> If crReportObject.Kind =
> ReportObjectKind.SubreportObject
> Then
> 'If there's a subreport, typecast the reportobject
> to a > subreport object
> crSubreportObject = CType(crReportObject,
> SubreportObject)
>
> 'Open the subreport
> subRepDoc =
> crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)
>
> crDatabase = subRepDoc.Database
> crTables = crDatabase.Tables
>
> 'Loop through all the tables and set the connection
> info,
> 'Pass on the connection info to the logoninfo object
> then add the
> 'logoninfo to the subreport
> For Each crTable In crTables
> With crpConnectionInfo
> .ServerName = strServer
> .DatabaseName = strDataBase
> End With
> crLogOnInfo = crTable.LogOnInfo
> crLogOnInfo.ConnectionInfo = crpConnectionInfo
> crTable.ApplyLogOnInfo(crLogOnInfo)
> Next
> End If
> Next
> Next
>
> --
> Programming today is a race between software engineers striving to
> build
> bigger and better idiot-proof programs, and the Universe trying to produce > bigger and better idiots. So far, the Universe is winning. (Rich Cook)
>
> "Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
> news:e7**************@TK2MSFTNGP09.phx.gbl...
>> Hi, tks for link :-)
>>
>> The Sample is not use Webservice :(, the sample use Client pass Parameter > :(
>>
>> How to into webservice change Database? Example:
>>
>>
>> Client (WF) -- > WS --> Report
>>
>> Client Pass the parameters for Connection to WS.
>>
>> I Want Connection setting into WS only, and Client consume WS only
>>
>> it understands to me?
>>
>> Tks
>>
>>
>> --
>>
>> --------------------------
>> Salu2
>> Maxi [MVP SQL SERVER]
>> www.sqlgurus.org
>>
>>
>> "Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
>> news:uz**************@tk2msftngp13.phx.gbl...
>> > Hi maybe this example can help you, it's a vb.net sample but could help >> > you
>> >
>> >
> http://www.vb-tips.com/default.aspx?...1-e779bfb411c5 >> >
>> > Greetz Peter
>> >
>> > --
>> > Programming today is a race between software engineers striving to
>> > build
>> > bigger and better idiot-proof programs, and the Universe trying to
> produce
>> > bigger and better idiots. So far, the Universe is winning. (Rich Cook) >> >
>> > "Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
>> > news:eh**************@TK2MSFTNGP15.phx.gbl...
>> >> Hello, i'm sorry my bad english :(
>> >>
>> >> I have CR9 Webservice, how to change databadse name and User_name into >> >> Webservice method? (not Viewer Control)
>> >>
>> >> Tks!!
>> >>
>> >> --
>> >>
>> >> --------------------------
>> >> Salu2
>> >> Maxi [MVP SQL SERVER]
>> >> www.sqlgurus.org
>> >>
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Feb 21 '06 #8
Glad to help

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:#5**************@TK2MSFTNGP09.phx.gbl...
Tks!! Excelent!!! :-))))
--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:%2******************@TK2MSFTNGP10.phx.gbl...
Sorry about the previous post, I acedently pressed send

I think this code should help you, I paste my code in your sub new, I hope
it's clear to you

If you use a crReportDocument in windows form app you also need to call
crReportDocument.Dispose() when the form closes. I don't know if this is
also necessary with a webservice, but I think so.

Greetz Peter

'you need to add a reference to these 3 dll's

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.ReportSource

'The variable containing the report
Private crReportDocument As ReportDocument
Public Sub New()

Dim tblCurrent As Table
Dim crSubreportObject As SubreportObject
Dim subRepDoc As New ReportDocument
Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database
Dim crTables As Tables
Dim crTable As Table
Dim crSection As Section
Dim crSections As Sections
Dim crReportObjects As ReportObjects
Dim crReportObject As ReportObject
Dim crLogOnInfo As TableLogOnInfo
Dim crpConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
Dim crpTableLogOnInfo As New CrystalDecisions.Shared.TableLogOnInfo
crReportDocument = New ReportDocument

crReportDocument.Load(Me.Server.MapPath("CR1.rpt") )
Me.ReportSource = crReportDocument

With crpConnectionInfo
.ServerName = "Server"
.DatabaseName = "Database'
End With
'If you don't use integrated security
'provide the username and password used to logon to the database

crpConnectionInfo.UserID = "user"
crpConnectionInfo.Password = "password"

'Apply the ConnectionloginInfo to every table that's used inside the
report
For Each tblCurrent In crReportDocument.Database.Tables
crpTableLogOnInfo = tblCurrent.LogOnInfo
crpTableLogOnInfo.ConnectionInfo = crpConnectionInfo
tblCurrent.ApplyLogOnInfo(crpTableLogOnInfo)
Next

'if there are subreports they also need the correct logon info
'Set the sections collection with report sections
crSections = crReportDocument.ReportDefinition.Sections
For Each crSection In crSections
crReportObjects = crSection.ReportObjects
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject
Then
'If there's a subreport, typecast the reportobject to a subreport object
crSubreportObject = CType(crReportObject,
SubreportObject)

'Open the subreport
subRepDoc =
crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)

crDatabase = subRepDoc.Database
crTables = crDatabase.Tables

'Loop through all the tables and set the connection
info,
'Pass on the connection info to the logoninfo object
then add the
'logoninfo to the subreport
For Each crTable In crTables
With crpConnectionInfo
.ServerName = strServer
.DatabaseName = strDataBase
End With
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crpConnectionInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
Next
End If
Next
Next
End Sub
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
news:um**************@TK2MSFTNGP14.phx.gbl...
Hi, tks!!

My Webservice code is:

Public Sub New()
Me.ReportSource = Me.Server.MapPath("CR1.rpt")
End Sub

Where insert your code?

--

--------------------------
Salu2
Maxi [MVP SQL SERVER]
www.sqlgurus.org
"Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
news:%2***************@tk2msftngp13.phx.gbl...
> Hi, can't you use the crpConnectionInfo part from the link, inside the > webservice?
>
> I hope this helps
>
> Greetz Peter
>
>
>
> 'Part from the sample
> With crpConnectionInfo
> .ServerName = strServer
> .DatabaseName = strDataBase
> End With
> 'If you don't use integrated security
> 'provide the username and password used to logon to the database > If blnIntegrated = False Then
> crpConnectionInfo.UserID = strUserId
> crpConnectionInfo.Password = strPassword
> End If
>
> 'Apply the ConnectionloginInfo to every table that's used inside > the
> report
> For Each tblCurrent In crReportDocument.Database.Tables
> crpTableLogOnInfo = tblCurrent.LogOnInfo
> crpTableLogOnInfo.ConnectionInfo = crpConnectionInfo
> tblCurrent.ApplyLogOnInfo(crpTableLogOnInfo)
> Next
>
> 'Set the sections collection with report sections
> crSections = crReportDocument.ReportDefinition.Sections
> For Each crSection In crSections
> crReportObjects = crSection.ReportObjects
> For Each crReportObject In crReportObjects
> If crReportObject.Kind =
> ReportObjectKind.SubreportObject
> Then
> 'If there's a subreport, typecast the reportobject
> to

a
> subreport object
> crSubreportObject = CType(crReportObject,
> SubreportObject)
>
> 'Open the subreport
> subRepDoc =
> crSubreportObject.OpenSubreport(crSubreportObject. SubreportName)
>
> crDatabase = subRepDoc.Database
> crTables = crDatabase.Tables
>
> 'Loop through all the tables and set the connection > info,
> 'Pass on the connection info to the logoninfo object > then add the
> 'logoninfo to the subreport
> For Each crTable In crTables
> With crpConnectionInfo
> .ServerName = strServer
> .DatabaseName = strDataBase
> End With
> crLogOnInfo = crTable.LogOnInfo
> crLogOnInfo.ConnectionInfo = crpConnectionInfo
> crTable.ApplyLogOnInfo(crLogOnInfo)
> Next
> End If
> Next
> Next
>
> --
> Programming today is a race between software engineers striving to
> build
> bigger and better idiot-proof programs, and the Universe trying to

produce
> bigger and better idiots. So far, the Universe is winning. (Rich Cook) >
> "Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
> news:e7**************@TK2MSFTNGP09.phx.gbl...
>> Hi, tks for link :-)
>>
>> The Sample is not use Webservice :(, the sample use Client pass

Parameter
> :(
>>
>> How to into webservice change Database? Example:
>>
>>
>> Client (WF) -- > WS --> Report
>>
>> Client Pass the parameters for Connection to WS.
>>
>> I Want Connection setting into WS only, and Client consume WS only
>>
>> it understands to me?
>>
>> Tks
>>
>>
>> --
>>
>> --------------------------
>> Salu2
>> Maxi [MVP SQL SERVER]
>> www.sqlgurus.org
>>
>>
>> "Peter Proost" <pp*****@nospam.hotmail.com> escribió en el mensaje
>> news:uz**************@tk2msftngp13.phx.gbl...
>> > Hi maybe this example can help you, it's a vb.net sample but could

help
>> > you
>> >
>> >
>

http://www.vb-tips.com/default.aspx?...1-e779bfb411c5
>> >
>> > Greetz Peter
>> >
>> > --
>> > Programming today is a race between software engineers striving to
>> > build
>> > bigger and better idiot-proof programs, and the Universe trying to
> produce
>> > bigger and better idiots. So far, the Universe is winning. (Rich

Cook)
>> >
>> > "Maxi" <ma*****@infovia.com.ar.Sacame> schreef in bericht
>> > news:eh**************@TK2MSFTNGP15.phx.gbl...
>> >> Hello, i'm sorry my bad english :(
>> >>
>> >> I have CR9 Webservice, how to change databadse name and User_name

into
>> >> Webservice method? (not Viewer Control)
>> >>
>> >> Tks!!
>> >>
>> >> --
>> >>
>> >> --------------------------
>> >> Salu2
>> >> Maxi [MVP SQL SERVER]
>> >> www.sqlgurus.org
>> >>
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Feb 21 '06 #9

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

Similar topics

1
by: Kenjis Kaan | last post by:
I had to run DB2 on Win2k. After installation it puts a directory under c:\DB2 and c:\DB2Log and C:\Program Files\SQLLIB Now am all confused...
11
by: RWC | last post by:
Hello, I'm having trouble converting code in Access XP / 2002. I have some code that declares an variable "as database" in Access 97, which is...
11
by: MLH | last post by:
I copied the following code snippet from A97 HELP. Am getting an error at compile time suggesting there's a problem with the first line (compile...
0
by: Tom Wild | last post by:
Hi I am trying to connect to an Access database from a WebPage in VB.Net but when I try to open the connection I get the following error: The...
1
by: Tom Wild | last post by:
Hi I am trying to create a webform that connects to an Access database. If I use the connection string: "Provider=Microsoft.Jet.OLEDB.4.0;Data...
7
by: Risen | last post by:
Hi,all, I want to execute SQL command " DROP DATABASE mydb" and "Restore DATABASE ....." in vb.net 2003. But it always shows error. If any body...
2
by: Peter Afonin | last post by:
Hello, I'm using CreateUserWizard control in ASP.NET 2.0. I'm storing the data in SQL Server 2005. The first and last steps run smoothly...
0
by: serge | last post by:
I have 2 SQL Enterprise Editions running SP2 and same collation. When i try to start database mirroring I get the following error message: ...
0
by: vaibhavsumant | last post by:
<project name="DBCreate" default="usage" basedir="."> <property name="user" value="db2admin"/> <property name="passwd" value="db2admin"/>...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.