|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to change "database and User" into CR9 WebserviceHello, 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!! Hi maybe this example can help you, it's a vb.net sample but could help you
http://www.vb-tips.com/default.aspx?ID=68888abf-f137-45d1-8a81-e779bfb411c5 Greetz Peter -- Show quoteHide quoteProgramming 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" <maxi***@infovia.com.ar.Sacame> schreef in bericht news:ehbIGSiNGHA.3776@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 > > > 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 Show quoteHide quote "Peter Proost" <pproost@nospam.hotmail.com> escribió en el mensaje news:uzlqRriNGHA.2992@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?ID=68888abf-f137-45d1-8a81-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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > news:ehbIGSiNGHA.3776@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 >> >> >> > > 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 -- Show quoteHide quoteProgramming 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" <maxi***@infovia.com.ar.Sacame> schreef in bericht http://www.vb-tips.com/default.aspx?ID=68888abf-f137-45d1-8a81-e779bfb411c5news:e7e8bFjNGHA.3788@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" <pproost@nospam.hotmail.com> escribió en el mensaje > news:uzlqRriNGHA.2992@tk2msftngp13.phx.gbl... > > Hi maybe this example can help you, it's a vb.net sample but could help > > you > > > > Show quoteHide quote > > > > 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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > > news:ehbIGSiNGHA.3776@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 > >> > >> > >> > > > > > > Hi, tks!!
My Webservice code is: Public Sub New() Me.ReportSource = Me.Server.MapPath("CR1.rpt") End Sub Where insert your code? Show quoteHide quote "Peter Proost" <pproost@nospam.hotmail.com> escribió en el mensaje news:%23TntDWjNGHA.208@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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > news:e7e8bFjNGHA.3788@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" <pproost@nospam.hotmail.com> escribió en el mensaje >> news:uzlqRriNGHA.2992@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?ID=68888abf-f137-45d1-8a81-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" <maxi***@infovia.com.ar.Sacame> schreef in bericht >> > news:ehbIGSiNGHA.3776@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 >> >> >> >> >> >> >> > >> > >> >> > > Public Sub New()
Me.ReportSource = Me.Server.MapPath("CR1.rpt") End Sub -- Show quoteHide quoteProgramming 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" <maxi***@infovia.com.ar.Sacame> schreef in bericht http://www.vb-tips.com/default.aspx?ID=68888abf-f137-45d1-8a81-e779bfb411c5news:umJzZhjNGHA.2696@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" <pproost@nospam.hotmail.com> escribió en el mensaje > news:%23TntDWjNGHA.208@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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > > news:e7e8bFjNGHA.3788@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" <pproost@nospam.hotmail.com> escribió en el mensaje > >> news:uzlqRriNGHA.2992@tk2msftngp13.phx.gbl... > >> > Hi maybe this example can help you, it's a vb.net sample but could help > >> > you > >> > > >> > > > Show quoteHide quote > >> > > >> > 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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > >> > news:ehbIGSiNGHA.3776@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 > >> >> > >> >> > >> >> > >> > > >> > > >> > >> > > > > > > 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 -- Show quoteHide quoteProgramming 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" <maxi***@infovia.com.ar.Sacame> schreef in bericht http://www.vb-tips.com/default.aspx?ID=68888abf-f137-45d1-8a81-e779bfb411c5news:umJzZhjNGHA.2696@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" <pproost@nospam.hotmail.com> escribió en el mensaje > news:%23TntDWjNGHA.208@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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > > news:e7e8bFjNGHA.3788@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" <pproost@nospam.hotmail.com> escribió en el mensaje > >> news:uzlqRriNGHA.2992@tk2msftngp13.phx.gbl... > >> > Hi maybe this example can help you, it's a vb.net sample but could help > >> > you > >> > > >> > > > Show quoteHide quote > >> > > >> > 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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > >> > news:ehbIGSiNGHA.3776@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 > >> >> > >> >> > >> >> > >> > > >> > > >> > >> > > > > > > Tks!! Excelent!!! :-))))
Show quoteHide quote "Peter Proost" <pproost@nospam.hotmail.com> escribió en el mensaje news:%23h%23mfPsNGHA.3936@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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > news:umJzZhjNGHA.2696@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" <pproost@nospam.hotmail.com> escribió en el mensaje >> news:%23TntDWjNGHA.208@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" <maxi***@infovia.com.ar.Sacame> schreef in bericht >> > news:e7e8bFjNGHA.3788@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" <pproost@nospam.hotmail.com> escribió en el mensaje >> >> news:uzlqRriNGHA.2992@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?ID=68888abf-f137-45d1-8a81-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" <maxi***@infovia.com.ar.Sacame> schreef in bericht >> >> > news:ehbIGSiNGHA.3776@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 >> >> >> >> >> >> >> >> >> >> >> > >> >> > >> >> >> >> >> > >> > >> >> > > Glad to help
-- Show quoteHide quoteProgramming 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" <maxi***@infovia.com.ar.Sacame> schreef in bericht http://www.vb-tips.com/default.aspx?ID=68888abf-f137-45d1-8a81-e779bfb411c5news:#5qg0ZuNGHA.3788@TK2MSFTNGP09.phx.gbl... > Tks!! Excelent!!! :-)))) > > > -- > > -------------------------- > Salu2 > Maxi [MVP SQL SERVER] > www.sqlgurus.org > > > "Peter Proost" <pproost@nospam.hotmail.com> escribió en el mensaje > news:%23h%23mfPsNGHA.3936@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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > > news:umJzZhjNGHA.2696@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" <pproost@nospam.hotmail.com> escribió en el mensaje > >> news:%23TntDWjNGHA.208@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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > >> > news:e7e8bFjNGHA.3788@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" <pproost@nospam.hotmail.com> escribió en el mensaje > >> >> news:uzlqRriNGHA.2992@tk2msftngp13.phx.gbl... > >> >> > Hi maybe this example can help you, it's a vb.net sample but could > > help > >> >> > you > >> >> > > >> >> > > >> > > > Show quoteHide quote > >> >> > > >> >> > 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" <maxi***@infovia.com.ar.Sacame> schreef in bericht > >> >> > news:ehbIGSiNGHA.3776@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 > >> >> >> > >> >> >> > >> >> >> > >> >> > > >> >> > > >> >> > >> >> > >> > > >> > > >> > >> > > > > > >
Best data structure?
empty GUID from string in VB2005 Help creating custom ComboBox control Text Files Changing CheckedState or Checked-value without raising ItemChecked-event Opacity Unable to open file Installing published application fails MyApplication has encountered a problem... when not Administrator! What is the difference between VB.NET and ASP.NET?? |
|||||||||||||||||||||||