Skip to Content
author's profile photo Former Member
Former Member

Release license after using viewrpt.asp

Post Author:

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"


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

Any help would be appreciated.


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 02:21 PM

    Post Author: Argan

    CA Forum: .NET

    The official answer is once you pass off to Enterprise you can no longer control the token. You would need to use the CreateLogonToken and set it for however long you want to the token to last and you can not release it prior to that.

    That being said, I have seen where people use javascript and frames to put the URL reporting in a frame and use another frame to log off. I do not work with ASP (this is a .NET forum, the asp folks are in the java forum usually 😊 ) but know it can be done.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.