Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 26th, 2006, 03:48 AM
Registered User
 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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)






Similar Threads
Thread Thread Starter Forum Replies Last Post
VS not creating Class files for CR reports zothen123 Crystal Reports 6 July 14th, 2009 02:25 PM
How to pass parameter value to CR SQL Command vijaykumartaduri BOOK: Professional Crystal Reports for VS.NET 3 July 31st, 2007 12:13 AM
How I can pass parameters to 2 ASP files at ones? zukit Classic ASP Databases 4 December 15th, 2004 05:20 AM
how to pass the data from dataset to CR? zouky Crystal Reports 0 November 8th, 2004 02:49 AM
How to pass multiple parameters to CR 9 syedjavid Crystal Reports 1 September 17th, 2003 05:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.