分享
 
 
 

(4)ASPCallCrystalReportwithStoreProcedure

王朝厨房·作者佚名  2007-01-04
窄屏简体版  字體: |||超大  

’SPString.SQL

if exists (select name from sysobjects where name = ’SPROCString’)

drop proc SPROCString

GO

CREATE PROCEDURE SPROCString

@pTitle varchar(80)

AS

SET NOCOUNT ON

SELECT

*

FROM

TitleView

WHERE

Title = @pTitle

or @pTitle = ’*’

’toolbar.asp

<%

’ 05/02/98

’ Added the following features:

’ Tab Query String Parameter

’ - This is the selected tab’s tabArray index value.

’ Page Expiry Time

’ - The page will expire when downloaded by browser so that user is insured that all data

’ will be current.

’ DrillDown Tabs

’ - Added in the session("tabArray") object to keep track of the drill down tabs.

’ Search

’ - Added javascript window.alert function call to indicate when text is not found in rpt view.

’ Goto Page Text Box

’ - Added textbox and filenew.gif so user can enter and request desired page number.

’ NOTE: Netscape 2.0 browsers do not call the on submit event handler when the image is selected.

’ Thus, the user will not be warned when incorrect data is entered into the goto page box.

’ This problem does not happen when the user selects return.

Response.Expires = 0

’ Viewer Tab images

drilld = "<img border=0 src=’/viewer/images/toolbar/pdrilld.gif’ alt = ’Parent Group’>"

drillu = "<img border=0 src=’/viewer/images/toolbar/cdrillu.gif’ alt = ’Current Group’>"

previewu = "<img border=0 src=’/viewer/images/toolbar/pviewu.gif’ alt = ’Preview’>"

previewd = "<img border=0 src=’/viewer/images/toolbar/pviewd.gif’ alt = ’Preview’>"

’ Set the correct numbers on the paging buttons

brch = request.querystring("BRCH")

if brch <> "" then

brch = "&" & "brch=" & brch

basepage = "<a href=" & chr(34) & "javascript:parent.parent.location=’rptserver.asp?init=html_frame&page=1’" & chr(34) & ">"

end if

getPageCommand = "rptserver.asp?cmd=toolbar%5Fpage&viewer=html%5Fframe&vfmt=html%5Fframe" & brch

searchFound = request.querystring("SEARCHFOUND")

if searchFound <> "" then

if Cint(searchFound) = 0 then

messageText = "onLoad = " & chr(34) & "window.alert(’Text Not Found in the Report’);" & chr(34)

end if

end if

CurrentPageNumber = CStr(session("CurrentPageNumber"))

lastknownpage = CStr(session("lastknownpage"))

LastPageNumber = CStr(session("LastPageNumber"))

if CurrentPageNumber = "" then

CurrentPageNumber = "1"

end if

if lastknownpage = "" then

lastknownpage = "0"

end if

if LastPageNumber <> "" and (CurrentPageNumber = LastPageNumber) then

lastknownpage = CurrentPageNumber

’ remember the last known page

session("lastknownpage") = CurrentPageNumber

nextlink = ""

lastlink = ""

if CInt(CurrentPageNumber) > 1 then

previouspage = CInt(CurrentPageNumber) - 1

previouslink = "<a href=" & chr(34) & "javascript:parent.location=’rptserver.asp?cmd=toolbar%5Fpage&viewer=html%5Fframe&vfmt=html%5Fframe&page=" & previouspage & brch & "’" & chr(34) & ">"

firstlink = "<a href=" & chr(34) & "javascript:parent.location=’rptserver.asp?cmd=toolbar%5Fpage&viewer=html%5Fframe&vfmt=html%5Fframe&page=1" & brch & "’" & chr(34) & ">"

else

previouslink = ""

firstlink = ""

end if

else

if (CInt(lastknownpage) < CInt(CurrentPageNumber)) and LastPageNumber = "" then

’ remember the last known page

session("lastknownpage") = CurrentPageNumber

lastknownpage = CurrentPageNumber & "+"

else

if lastknownpage <> LastPageNumber then

lastknownpage = lastknownpage & "+"

end if

end if

if CInt(CurrentPageNumber) > 1 then

previouspage = CInt(CurrentPageNumber) -1

previouslink = "<a href=" & chr(34) & "javascript:parent.location=’rptserver.asp?cmd=toolbar%5Fpage&viewer=html%5Fframe&vfmt=html%5Fframe&page=" & previouspage & brch & "’" & chr(34) & ">"

firstlink = "<a href=" & chr(34) & "javascript:parent.location=’rptserver.asp?cmd=toolbar%5Fpage&viewer=html%5Fframe&vfmt=html%5Fframe&page=1" & brch & "’" & chr(34) & ">"

else

previouslink = ""

firstlink = ""

previouspage = 1

end if

nextpage = CInt(CurrentPageNumber) + 1

nextlink = "<a href=" & chr(34) & "javascript:parent.location=’rptserver.asp?cmd=toolbar%5Fpage&viewer=html%5Fframe&vfmt=html%5Fframe&page=" & nextpage & brch & "’" & chr(34) & ">"

lastlink = "<a href=" & chr(34) & "javascript:parent.location=’rptserver.asp?cmd=toolbar%5Fpage&viewer=html%5Fframe&vfmt=html%5Fframe&page=32756" & brch & "’" & chr(34) & ">"

end if

%>

<html>

<script language="javascript">

function ValidateNumber(val, msg)

{

if (val == "")

{

alert("Please enter a value for the " + msg + " field.");

return (false);

}

var checkOK = "0123456789";

var checkStr = val;

var allValid = true;

var decPoints = 0;

var allNum = "";

for (i = 0; i < checkStr.length; i++)

{

ch = checkStr.charAt(i);

for (j = 0; j < checkOK.length; j++)

if (ch == checkOK.charAt(j))

break;

if (j == checkOK.length)

{

allValid = false;

break;

}

allNum += ch;

}

if (!allValid)

{

alert("Please enter only digit characters in the " + msg + " field.");

return (false);

}

var chkVal = allNum;

var prsVal = parseInt(allNum);

if (chkVal != "" && !(prsVal >= "1"))

{

alert("Please enter a value greater than \"0\" in the " + msg + " field.");

return (false);

}

return (true);

}

var currentValue = "<% response.write CurrentPageNumber %>";

function checkValue(){

var pageNumber = document.forms[0].elements[0].value;

if(!ValidateNumber(pageNumber, "Goto Page Number")){

document.forms[0].elements[0].value = currentValue;

parent.status = "Please Enter a Positive Numeric Value. NO SPACES";

return false;

}

else

// a new page will be downloaded with the next page number

return true;

}

</script>

<body background="/viewer/images/toolbar/toolbg.gif" topmargin=0 leftmargin=0 <% response.write messageText%>>

<form method="POST" name=getPg target = "CrystalViewerPageFrame" action = <% response.write getPageCommand %> onSubmit="return checkValue();">

<table border=0 width=100% cellpadding=0 cellspacing=0 height=100%><tr nowrap>

<td nowrap align=right width=10%><% response.write firstlink %><img border=0 src="/viewer/images/toolbar/first.gif" alt="First page"><% response.write previouslink %><img border=0 src="/viewer/images/toolbar/prev.gif" alt="Previous page"></td>

<td nowrap valign=center align=center width=10%> <b> <%response.write CurrentPageNumber %> </b> of <%response.write lastknownpage %></td>

<td nowrap align=left width=10%><%response.write nextlink %><img border=0 src="/viewer/images/toolbar/next.gif" alt="Next page"></a><%response.write lastlink %><img border=0 src="/viewer/images/toolbar/last.gif" alt="Last page"></a></td>

<td align=left width=5%><input type=text value = "<%response.write CurrentPageNumber %>" size=4 maxlength=5 name=PAGE alt = "Goto Page" ></td>

<td align=left width=5%> <input type=image src="/viewer/images/toolbar/filenew.gif" alt="Goto Page"></td>

</form>

<form method="POST" name=pf target="CrystalViewerPageFrame" action="rptserver.asp?cmd=srch&viewer=html%5Fframe&vfmt=html_frame&page=<%response.write CurrentPageNumber %>&dir=FOR&case=0<% response.write brch%>">

<comment><td nowrap align=center width=15%><a href="javascript:parent.parent.location=’rptserver.asp?cmd=rfsh&viewer=html%5Fframe&vfmt=html%5Fframe&page=<%response.write CurrentPageNumber %>’"><img border=0 src="/viewer/images/toolbar/refresh.gif" alt="Refresh"></a></td></comment>

<td align=right width=15%><input type=text size=10 maxlength=255 name=text></td>

<td align=left width=5%><input type=image src="/viewer/images/toolbar/search.gif"></td>

<td nowrap valign=bottom align=right width=20%>

<%

dim counter

dim tmpArray

dim upperBound

tmpArray = session("tabArray")

counter = Int(UBound(tmpArray) / 5)

if tmpArray(0) <> "EMPTY" then

response.write drillu

if counter > 0 then

response.write "<a href=" & chr(34) & "javascript:parent.parent.location = ’htmstart.asp?tab=" & (counter * 5) & "’" & chr(34) & ">"

response.write drilld & "</a>"

End If

response.write "<a href=" & chr(34) & "javascript:parent.parent.location = ’htmstart.asp?tab=" & 0 & "’" & chr(34) & ">"

response.write previewd & "</a>"

else

response.write previewu

end if%>

</td>

</tr></table>

</form>

</body>

</html>

’SmartViewerHTMLFrame.asp

<%

’=================================================================

’ This file contains the ASP code for the Smart Viewer HTML Page

’=================================================================

response.redirect ("htmstart.asp")

%>

’SmartViewerHTMLPage.asp

<%

’=================================================================

’ This file contains the ASP code for the Smart Viewer HTML Page

’=================================================================

response.redirect ("rptserver.asp")

%>

’SmartViewerJava.asp

<%

’This file contains the HTML code to instantiate the Smart Viewer Java.

’You will notice that the Report Name parameter references the rptserver.asp file.

’This is because the report pages are actually created by rptserver.asp.

’Rptserver.asp accesses session("oApp"), session("oRpt") and session("oPageEngine")

’to create the report pages that will be rendered by the ActiveX Smart Viewer.

%>

<html>

<head>

<title>Seagate Java Viewer using Browser’s JVM</title>

</head>

<body bgcolor=C6C6C6>

<SCRIPT LANGUAGE="JavaScript"><!--

var _ns3 = false;

var _ns4 = false;

//--></SCRIPT>

<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--

var _info = navigator.userAgent;

var _ns3 = (navigator.appName.indexOf("Netscape") >= 0 && _info.indexOf("Win16") < 0 && _info.indexOf("Mozilla/3") >= 0);

var _ns4 = (navigator.appName.indexOf("Netscape") >= 0 && _info.indexOf("Win16") < 0 && _info.indexOf("Mozilla/4") >= 0 );

//--></SCRIPT></COMMENT>

<SCRIPT LANGUAGE="JavaScript"><!--

if(_ns3==true)

document.writeln( ’<applet code=com.seagatesoftware.img.ReportViewer.ReportViewer codebase="/viewer/JavaViewer" id=ReportViewer width=100% height=100% archive="/viewer/JavaViewer/ReportViewer.zip">’ );

else if (_ns4 == true)

document.writeln( ’<applet code=com.seagatesoftware.img.ReportViewer.ReportViewer codebase="/viewer/JavaViewer" id=ReportViewer width=100% height=100% archive="/viewer/JavaViewer/ReportViewer.jar">’ );

else

document.writeln( ’<applet code=com.seagatesoftware.img.ReportViewer.ReportViewer codebase="/viewer/JavaViewer" id=ReportViewer width=100% height=100% >’ );

//--></SCRIPT>

<param name=ReportName value="rptserver.asp">

<param name=HasGroupTree value=true>

<param name=ShowGroupTree value=true>

<param name=HasRefreshButton value=false>

<param name=HasPrintButton value=true>

<param name=HasExportButton value=true>

<param name=cabbase value="/viewer/JavaViewer/ReportViewer.cab">

</applet>

</body>

</html>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有