Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change report DSN on RAS!!! (interactiveviewer.asp)

Status
Not open for further replies.

lechuz

Programmer
Jan 8, 2003
26
0
0
MX

Hi!

I would like to know if anyone knows how to dinamically change the DSN of my reports, I have my reports running on the RAS, I send them the username, password and the report parameters and they work fine, but they use the DSN saved on the report... I want my user to be able to change the DSN from the application, does anyone knows the rigth objects to do that? does anyone has an example of it?

Here is my code:

<%
dim Path
dim iLen

Path = Request.ServerVariables(&quot;PATH_TRANSLATED&quot;)
While (Right(Path, 1) <> &quot;\&quot; And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend

Dim ReportDoc, objFactory, rptAppSession

'Use the ObjectFactory object to abstract the version number
'to one location

Set objFactory = CreateObject(&quot;CrystalReports.ObjectFactory.2&quot;)
Set Session(&quot;objFactory&quot;) = objFactory
Set rptAppSession = objFactory.CreateObject(&quot;CrystalReports.ReportAppSession&quot;)

' The name of the ReportAppServer is specified in clientSDKOptions.xml
rptAppSession.Initialize
Set Session(&quot;rptAppSession&quot;) = rptAppSession
'Create a new ReportClientDocument object for this reportAppSession
Set Session(&quot;oClientDoc&quot;) = rptAppSession.CreateService(&quot;CrystalClientDoc.ReportClientDocument&quot;)
'Open the report
Session(&quot;oClientDoc&quot;).Open &quot;rassdk://&quot; & Path& &quot;report.rpt&quot;

Session(&quot;userName&quot;) = &quot;username&quot;
Session(&quot;password&quot;) = &quot;password&quot;
Session(&quot;oClientDoc&quot;).DatabaseController.Logon Session(&quot;userName&quot;), Session(&quot;password&quot;)

after this there are only parameters managment but that was my connection settings

 
Take a look at discussion here:

Also, don't use rassdk if you can avoid - use ras:// instead. Because it will copy your report back and forth over the network even if ras and sdk are on the same machine... Put your report on ras machine, not sdk one, and use ras://...

Lady Linet
 
Does anyone know a solution like this in java/JSP?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top