- 爱易网页
-
ASP教程
- ASP Call Crystal Report with Store Procedure(6)
日期:2013-05-25 浏览次数:20841 次
'rptserver.asp
Case "SRCH"
Call RetrieveObjects
Call CheckForError
' create page variable
gvPageNumber = CInt(PAGE)
Select Case VFMT
Case "ENCP"
if goPageGenerator.FindText(TEXT, 0, gvPageNumber) then
Response.ContentType = EMFMIMETYPE
session("oEMF").sendpagenumberrecord(gvPageNumber)
else
gsErrorText = "The specified text, '" & TEXT & "' was not found in the report"
Response.ContentType = EMFMIMETYPE
session("oEMF").SendErrorMsg 33, gsErrorText
end if
Case "HTML_FRAME"
' We are being called by HTML viewer
' need to get the text from the form post
dim searchFound
TEXT = request.form("text")
' Now find out what page the text is on
tempNumber = gvPageNumber + 1
If(CBool(goPageGenerator.FindText(TEXT, 0, tempNumber))) then
session("CurrentPageNumber") = tempNumber
searchFound = 1
else
session("CurrentPageNumber") = gvPageNumber
searchFound = 0
End If
if BRCH <> "" then
gvURL = "framepage.asp?brch=" & BRCH & "&SEARCHFOUND=" & searchFound
else
gvURL = "framepage.asp?SEARCHFOUND=" & searchFound
end if
response.redirect gvURL
Case "HTML_PAGE"
' We are being called by HTML viewer
' need to get the text from the form post
TEXT = request.form("text")
' Now find out what page the text is on
tempNumber = gvPageNumber
If(CBool(goPageGenerator.FindText(TEXT, 0, tempNumber))) then
gvPageNumber = tempNumber
Set goPage = goPageCollection(gvPageNumber)
session("oPageEngine").ImageOptions = 1
response.binarywrite goPage.Renderhtml(1,3,3,request.ServerVariables("SCRIPT_NAME"),8209)
else
' Send back an html page indicating the text was not found.
Response.Write "<html><title>Seagate ASP Reports Server</title><body bgcolor='white'><center><h1>The text cannot be found in this report.</h1></center></body></html>"
End If
end select
Case "TOOLBAR_PAGE"
' Redirect to the framepage, need to know if we are
' on the last page.
if session("LastPageNumber") <> "" then
if CInt(PAGE) > CInt(session("LastPageNumber")) then
session("CurrentPageNumber") = session("LastPageNumber")
else
session("CurrentPageNumber") = PAGE
end if
else
Call RetrieveObjects
Call CheckForError
' create the actual page
Set goPage = goPageCollection(PAGE)
' check for an exception on the page number
Call ValidatePageNumber
if goPage.IsLastPage then
session("LastPageNumber") = goPage.pagenumber
session("CurrentPageNumber") = session("LastPageNumber")
else
session("CurrentPageNumber") = PAGE
end if
end if
if BRCH <> "" then
gvURL = "framepage.asp?brch=" & BRCH
else
gvURL = "framepage.asp"
end if
response.redirect gvURL