I'm trying (desperately) to change the Server Name and the Table Name. I'm developing in a different location than the Reports will ultimately be used in. The two lines "call zz.attributes.add..." are syntactically correct, but they don't force it to use Server "XXX" or Table "XXX" (the report still displays, which means it's using the connection data it was developed with.) By the way, changing zz.UserName (or Password) to "XXX" WILL cause it to fail, so I know that much is working.
How do I change the Server Name and table Name it's using at Run Time?
Here's what I have...
Thank You
Good Luck!
WindUp
How do I change the Server Name and table Name it's using at Run Time?
Here's what I have...
Code:
<%@ Language=VBScript CodePage=65001 ENABLESESSIONSTATE = True %>
<% '*** Turn OFF Error Handling ***
On Error Goto 0
Response.ExpiresAbsolute = Now() - 1
Dim objectFactory
Set objectFactory = CreateObject("CrystalReports.ObjectFactory.2")
'*** Create ConnectionInfo Object and ConnectionInfos Collection ***
Dim ConInfo, ConInfos
Set ConInfos = ObjectFactory.CreateObject("CrystalReports.ConnectionInfos")
Set ConInfo = ObjectFactory.CreateObject("CrystalReports.ConnectionInfo")
'*** Add ConnectionInfo to the Collection ***
ConInfos.Add ConInfo
'*** Set up ConnectionInfo ***
dim zz
for each zz in ConInfos
'*** These Two Line Work ***
zz.UserName = Session("request_form_login")
zz.Password = Session("request_form_password")
'*** These two lines do NOT work ***
call zz.attributes.add("Server name","XXX")
call zz.attributes.add("Table Name","XXX")
next
Dim HTMLViewer
Set HTMLViewer = objectFactory.CreateObject("CrystalReports.CrystalReportViewer")
HTMLViewer.DatabaseLogonInfos = ConInfos
HTMLViewer.Name = "page"
HTMLViewer.IsOwnForm = true
HTMLViewer.IsOwnPage = true
Dim theReportName
theReportName = Request("ReportName")
theReportName = Request.ServerVariables("APPL_PHYSICAL_PATH") & theReportName
HTMLViewer.ReportSource = theReportName
HTMLViewer.Refresh()
Call HTMLViewer.ProcessHttpRequest(Request, Response, Session)
Good Luck!
WindUp