Can I pass parameters when creating files via CR
before the this program, I got a html setting selected file type
then This ASP creates files in my server, but can I pass parameters while creaing files??
thanks in advance.
dim exOpts
reportname = "Reqslate.rpt"
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")
End If
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if
Path = Request.ServerVariables("PATH_TRANSLATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path,iLen)
Wend
Set session("oRpt") = session("oApp").OpenReport(path & reportname,1)
set exOpts = Session("oRpt").ExportOptions
exOpts.DestinationType = 1
dim expType
expType = CInt(Request("exportType"))
exOpts.FormatType = expType
dim expFilename
Select case expType
case 14 'word
expFilename = "Reqslate.doc"
exOpts.DiskFileName = server.MapPath(expFilename)
case 36 'Excel
expFilename = "Reqslate.xls"
exOpts.DiskFileName = server.MapPath(expFilename)
case 31 'PDF
expFilename = "Reqslate.pdf"
exOpts.DiskFileName = server.MapPath(expFilename)
exOpts.PDFExportAllPages = true
end select
Session("oRpt").Export False
Response.Redirect(expFilename)
|