-
2
- #1
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("ReportName" & ".rpt"
Param1Val=request("param1"
Param1Type=request("param1Type"
Param2Val=request("param2"
Param2Type=request("param2Type"
Param3Val=request("param3"
Param3Type=request("param3Type"
Param4Val=request("param4"
Param4Type=request("param4Type"
if lcase(reportname)="cctvquote.rpt" or lcase(reportname)="greenfolder.rpt" then
set cn=createobject("adodb.connection"
set cmd=createobject("adodb.command"
set rs=createobject("adodb.recordset"
cn.Open session("connectionstring"
mysql="select status from proposal where id=" & request("param1" & " and revision=" & request("param2"
rs.open mysql,cn,3,3
if cdbl(rs("status")<1 then
cmd.ActiveConnection=cn
cmd.CommandText="wsp_generate_proposal " &_
"@ProposalNum=" & request("param1" &_
",@Revision=" & request("param2"
cmd.Execute
end if
end if
Set oObjectFactory = CreateObject("CrystalReports.ObjectFactory.2"
Path = Request.ServerVariables("Path_Translated"
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
Dim oReportLogons, oReportParameters
If Request.QueryString("pg" = "1" Then
'Create the ObjectFactory to instantiate Crystal Objects
Set ObjectFactory = CreateObject("CrystalReports.ObjectFactory.2"
'Create the ReportClientDocument
Set session("oClientDoc" = ObjectFactory.CreateObject("CrystalClientDoc.ReportClientDocument"
'Open the report.
session("oClientDoc".Open ("rassdk://" & path & reportname)
Set ReportParameters = session("oClientDoc".DataDefinition.ParameterFields
'Set oReportLogons = session("oClientDoc".DatabaseLogonInfos
session("oClientDoc".DatabaseController.Logon "securityone", "intranetonly"
'DatabaseController.Logon userName, password
'For each logon in oReportLogons
' logon.UserName = "securityone"'
'logon.Password = "intranetonly"
'Next
key=1
For each parameter in ReportParameters
Set parameterField = parameter
paramName = parameterField.Name
parameterField.CurrentValues.RemoveAll
Dim paramValue, strValue
Set paramValue = CreateObject("CrystalReports.ParameterFieldDiscreteValue"
strValue = Trim(Request("param" & 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("CrystalReports.CrystalReportInteractiveViewer"
With HTMLViewer
.ReportSource = session("oClientDoc".reportsource
.Name = "Page"
.isOwnPage = True
.isOwnForm = True
.HasHeaderArea=False
.IsDisplayGroupTree = False
.hasexportbutton=false
.isenabledrilldown=false
End With
response.write HTMLViewer.ProcessHttpRequest (Request, Response, Session)
%>
Thanks,
Aaron
<%
ReportName=RequesT("ReportName" & ".rpt"
Param1Val=request("param1"
Param1Type=request("param1Type"
Param2Val=request("param2"
Param2Type=request("param2Type"
Param3Val=request("param3"
Param3Type=request("param3Type"
Param4Val=request("param4"
Param4Type=request("param4Type"
if lcase(reportname)="cctvquote.rpt" or lcase(reportname)="greenfolder.rpt" then
set cn=createobject("adodb.connection"
set cmd=createobject("adodb.command"
set rs=createobject("adodb.recordset"
cn.Open session("connectionstring"
mysql="select status from proposal where id=" & request("param1" & " and revision=" & request("param2"
rs.open mysql,cn,3,3
if cdbl(rs("status")<1 then
cmd.ActiveConnection=cn
cmd.CommandText="wsp_generate_proposal " &_
"@ProposalNum=" & request("param1" &_
",@Revision=" & request("param2"
cmd.Execute
end if
end if
Set oObjectFactory = CreateObject("CrystalReports.ObjectFactory.2"
Path = Request.ServerVariables("Path_Translated"
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
Dim oReportLogons, oReportParameters
If Request.QueryString("pg" = "1" Then
'Create the ObjectFactory to instantiate Crystal Objects
Set ObjectFactory = CreateObject("CrystalReports.ObjectFactory.2"
'Create the ReportClientDocument
Set session("oClientDoc" = ObjectFactory.CreateObject("CrystalClientDoc.ReportClientDocument"
'Open the report.
session("oClientDoc".Open ("rassdk://" & path & reportname)
Set ReportParameters = session("oClientDoc".DataDefinition.ParameterFields
'Set oReportLogons = session("oClientDoc".DatabaseLogonInfos
session("oClientDoc".DatabaseController.Logon "securityone", "intranetonly"
'DatabaseController.Logon userName, password
'For each logon in oReportLogons
' logon.UserName = "securityone"'
'logon.Password = "intranetonly"
'Next
key=1
For each parameter in ReportParameters
Set parameterField = parameter
paramName = parameterField.Name
parameterField.CurrentValues.RemoveAll
Dim paramValue, strValue
Set paramValue = CreateObject("CrystalReports.ParameterFieldDiscreteValue"
strValue = Trim(Request("param" & 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("CrystalReports.CrystalReportInteractiveViewer"
With HTMLViewer
.ReportSource = session("oClientDoc".reportsource
.Name = "Page"
.isOwnPage = True
.isOwnForm = True
.HasHeaderArea=False
.IsDisplayGroupTree = False
.hasexportbutton=false
.isenabledrilldown=false
End With
response.write HTMLViewer.ProcessHttpRequest (Request, Response, Session)
%>