Skip to Content
0
Former Member
Sep 19, 2007 at 07:48 PM

Release license after using viewrpt.asp

33 Views

Post Author: rkelly@micros.com

CA Forum: .NET

I am new to development but I have created a .asp file that will log in to CMS, open a report and export it to PDF format.

My problem is the license is not being released. It takes about 20 minutes before the license is sent back to the pool.

I would like to have the license freed as soon as the report is exported.

Here is my code:

<%@ Language=VBScript %><HTML><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=charset=UTF-8"><BODY><%

Dim UserID Dim Password Dim CMS Dim Aut

CMS = &#91;cms name&#93; UserID = "" Password = "" Aut = "secWindowsNT"

Dim ContractID ContractID = Request.querystring("ContractID")

Response.Expires = 0

On Error Resume Next

Dim SessionManager Set SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr")

If Err.Number <> 0 then Response.Write "Couldn't create SessionManager" Else Dim Sess Set Sess = SessionManager.Logon(UserID, Password, CMS, Aut)

If Err.Number <> 0 then Response.Write "<SCRIPT language=""javascript""> " & _ " alert (""You must have a valid account to access the " & _ "Business Objects server." & _ """);</SCRIPT>" Else Dim IStore Dim LogonTokenMgr Set IStore = Sess.Service ("", "InfoStore") Session("IStore") = IStore Set LogonTokenMgr = Sess.LogonTokenMgr Session("IStore") = Sess.LogonTokenMgr LogonToken = LogonTokenMgr.CreateLogonTokenEx("", 60, 100)

Response.Redirect "https://&#91;server name&#93;/crystalreportviewers11/viewrpt.asp?APSTOKEN=" + LogonToken + "&id=973324&prompt0=" + ContractID + "&cmd=EXPORT&EXPORT_FMT=U2FPDF:0&CONNECT=1"

Session.Abandon()

End If End If%></BODY></HTML>

Any help would be appreciated.

Ray