473,378 Members | 1,175 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,378 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 1811
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 which is instance home, db2 home etc. I had to...
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 not recognized in Access XP. I've tried to find a...
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 error, user-defined type not defined). It is likely...
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 Microsoft Jet database engine cannot open the file...
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 Source=C:\Gizmo\Gizmo.mdb" Then the application...
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 can tell me how to execute sql command as above?...
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 without any problems. But I added one middle step to...
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: "The remote copy of database "ABC" has not been...
0
by: vaibhavsumant | last post by:
<project name="DBCreate" default="usage" basedir="."> <property name="user" value="db2admin"/> <property name="passwd" value="db2admin"/> <property name="dbprefix" value=""/> <property...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.