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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal 9 License issues 2

Status
Not open for further replies.

kifaro

Programmer
Oct 4, 2002
54
US
I am fed up with Crystal!!! I am hoping someone else has a solution. Here is what I am experiencing: When I run my report like this the report remains in the queue, thereby taking up a license. If I kill the session("oClientDoc") object it regenerates the WHOLE report every time you switch page. This is Crystal 9 Advanced which is supposed to cache. Am I doing something wrong or is it not as advertised (BTW Crystal's tech support told me I couldn't do it, in otherwords only 3 people can look at reports at 1 time, I think they are smoking crack!!)

Thanks,
Aaron

<%

ReportName=RequesT(&quot;ReportName&quot;) & &quot;.rpt&quot;
Param1Val=request(&quot;param1&quot;)
Param1Type=request(&quot;param1Type&quot;)
Param2Val=request(&quot;param2&quot;)
Param2Type=request(&quot;param2Type&quot;)
Param3Val=request(&quot;param3&quot;)
Param3Type=request(&quot;param3Type&quot;)
Param4Val=request(&quot;param4&quot;)
Param4Type=request(&quot;param4Type&quot;)

if lcase(reportname)=&quot;cctvquote.rpt&quot; or lcase(reportname)=&quot;greenfolder.rpt&quot; then
set cn=createobject(&quot;adodb.connection&quot;)
set cmd=createobject(&quot;adodb.command&quot;)
set rs=createobject(&quot;adodb.recordset&quot;)
cn.Open session(&quot;connectionstring&quot;)
mysql=&quot;select status from proposal where id=&quot; & request(&quot;param1&quot;) & &quot; and revision=&quot; & request(&quot;param2&quot;)
rs.open mysql,cn,3,3

if cdbl(rs(&quot;status&quot;))<1 then
cmd.ActiveConnection=cn
cmd.CommandText=&quot;wsp_generate_proposal &quot; &_
&quot;@ProposalNum=&quot; & request(&quot;param1&quot;) &_
&quot;,@Revision=&quot; & request(&quot;param2&quot;)

cmd.Execute
end if
end if

Set oObjectFactory = CreateObject(&quot;CrystalReports.ObjectFactory.2&quot;)
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 oReportLogons, oReportParameters

If Request.QueryString(&quot;pg&quot;) = &quot;1&quot; Then
'Create the ObjectFactory to instantiate Crystal Objects
Set ObjectFactory = CreateObject(&quot;CrystalReports.ObjectFactory.2&quot;)

'Create the ReportClientDocument
Set session(&quot;oClientDoc&quot;) = ObjectFactory.CreateObject(&quot;CrystalClientDoc.ReportClientDocument&quot;)

'Open the report.
session(&quot;oClientDoc&quot;).Open (&quot;rassdk://&quot; & path & reportname)


Set ReportParameters = session(&quot;oClientDoc&quot;).DataDefinition.ParameterFields
'Set oReportLogons = session(&quot;oClientDoc&quot;).DatabaseLogonInfos
session(&quot;oClientDoc&quot;).DatabaseController.Logon &quot;securityone&quot;, &quot;intranetonly&quot;

'DatabaseController.Logon userName, password
'For each logon in oReportLogons
' logon.UserName = &quot;securityone&quot;'
'logon.Password = &quot;intranetonly&quot;
'Next
key=1
For each parameter in ReportParameters

Set parameterField = parameter
paramName = parameterField.Name
parameterField.CurrentValues.RemoveAll

Dim paramValue, strValue
Set paramValue = CreateObject(&quot;CrystalReports.ParameterFieldDiscreteValue&quot;)
strValue = Trim(Request(&quot;param&quot; & key))

Select Case (parameterField.Type)
Case 6 ' Number value
if isNumeric(strValue) then
Dim longValue
longValue = CLng(strValue)
paramValue.Value = longValue
else
error = true
Exit For
end if
Case 9 ' Date value
if IsDate(strValue) then
Dim dateValue
dateValue = CDate(strValue)
paramValue.Value = dateValue
else
error = true
Exit For
end if
Case 11 'string value
paramValue.Value = strValue
Case Else
'not supported yet
End Select
' Add this value to current value list
parameterField.CurrentValues.Add paramValue
key=key+1
Next


End If

Set HTMLViewer = oObjectFactory.CreateObject(&quot;CrystalReports.CrystalReportInteractiveViewer&quot;)
With HTMLViewer
.ReportSource = session(&quot;oClientDoc&quot;).reportsource
.Name = &quot;Page&quot;
.isOwnPage = True
.isOwnForm = True
.HasHeaderArea=False
.IsDisplayGroupTree = False
.hasexportbutton=false
.isenabledrilldown=false

End With

response.write HTMLViewer.ProcessHttpRequest (Request, Response, Session)
%>
 
The caching that is availabe with CR9Adv is via the Report Application Server (RAS) that is included with CR9Adv. This is on a seperate cd and needs to be installed on a network server. The key to leveraging it is the ReportClientDoc object. This will cause the report generation and the ensuing caching to be done on the RAS server.

You will need to install the RAS Server on one network server and it does check to see if it can see anyothers at startup and will shut is selfdown if one exsits. The you will need to install the RAS SDK on any machines that will be serving the reports to the users. These may be the same machine or the may not. In our case we a one server that is running RAS and has the SDK installed because this is the intranet server that the users connect to but I also have the SDK installed on my machine so that I can connect to the RAS server for development.

If you are using the regular ReportDocument object then it you will see the report rerendered for each page and will encounter the licensing issues you mentioned.

--Marshall

PS. Crystal's tech support people don't seem to understand this poduct and aren't a lot of help. Marshall Curtis
Sr. Information Systems Analyst
Carlisle Walker Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top