Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sort option....

Status
Not open for further replies.

nelco

Programmer
Apr 4, 2006
93
US
I have in my asp page radio options sort by vendor no, cost center, name, to date.
Based on user selection - sort option, I have to show crystal report in that sort.
I tried to see some of the similar programs and used the code but does not work in X1.
I am able to show report but not in way I select sort options.

Any help / suggestions ?

 
sound like you need to pass the sort order selection from the control on the page as a parameter to the report. Is your report based on a stored procedure?
 
My report is not based on stored procedure. This is the one I am using. I am able to get the report but not based on sort option I select on form. Any help?
Here is the code

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include virtual="/Connections/Store_Operations.asp" -->

<%

reportname = Request.form("rm")
if Request.form("rm") = "" then
reportname = "lpm_rentpayment.rpt"
sortby = trim(request.form("Sort"))
%>
<%
Sub Parse_Conn(CString, ArgArray)
tmp = Split(CString, ";", -1, 1)
for i = 0 to ubound(tmp) - 1
xmp = Split(tmp(i), "=", -1, 1)
ArgArray(i) = xmp(1)
Next
End Sub
Dim DBargs(4)
Parse_Conn MM_Store_Operations_STRING, DBargs
Session("Abandon") = "N"
reportname = reportname
on error resume next
%>
<!-- #include virtual="/CrystalReportsXI/AlwaysRequiredSteps.asp" -->

<%
Make_DB_Connection MM_Store_Operations_STRING
'set crtable1 = session("oRpt").Database.Tables.Item(1)
' crtable1.SetLogonInfo CStr(DBargs(0)), CStr(DBargs(1)), CStr(DBargs(2)), CStr(DBargs(3))
strSelect = trim(request.form("Sort"))
if strSelect = "SAP_COST_CENTER_NO" then
PageTitle = "Cost Center"
end if
if strSelect = "SAP_VND_no" then
PageTitle = "Vendor Number"
end if
if strSelect = "VND_LINE_1_NME" then
PageTitle = "Vendor Name"
end if
if strSelect = "LEASE_TO_DATE" then
PageTitle = " Lease to date"
end if

PageTitle = "***** Payments Report " & PageTitle

Session("oRpt").ReportTitle = PageTitle

Set session("ParamCollection") = Session("oRpt").Parameterfields
Set Parms = session("ParamCollection").Item(1)
Call Parms.SetCurrentValue (Cstr(strSelect), 12)
end if
%>


<!--#include virtual="/CrystalReports/MoreRequiredSteps.asp"-->

<HTML>
<HEAD>
<TITLE><%=PageTitle%></TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 ONUNLOAD="CallDestroy();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>

<OBJECT ID="CRViewer"
CLASSID="CLSID:2DEF4530-8CE6-41c9-84B6-A54536C90213"
WIDTH=100% HEIGHT=100%
CODEBASE="/viewer9/activeXViewer/activexviewer.cab#Version=9,2,0,442" VIEWASTEXT>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="DisplayToolbar" VALUE=1>
<PARAM NAME="EnableProgressControl" VALUE=1>
<PARAM NAME="EnableStopButton" VALUE=1>
<PARAM NAME="EnableCloseButton" VALUE=1>
<PARAM NAME="EnableNavigationControls" VALUE=1>
<PARAM NAME="PromptOnRefresh" VALUE=1>
<PARAM NAME="EnablePopupMenu" VALUE=1>
<PARAM NAME="DisplayBackgroundEdge" VALUE=1>
<PARAM NAME="DisplayBorder" VALUE=1>
<PARAM NAME="DisplayTabs" VALUE=1>
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBroker9.WebReportBroker")
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
else
Dim webSource
Set webSource = CreateObject("WebReportSource9.WebReportSource")
webSource.ReportSource = webBroker
webSource.URL = "/crystalReports/rptserver.asp"
webSource.PromptOnRefresh = False
CRViewer.ReportSource = webSource


CRViewer.EnableRefreshButton = True
CRViewer.DisplayBackgroundEdge = False
CRViewer.DisplayTabs = False
CRViewer.DisplayGroupTree = false
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>

<script language="javascript">
function CallDestroy()
{
window.open("/CrystalReports/Cleanup.asp");
}
</script>
</BODY>
</HTML>
 
Hi,
Have you confirmed that:
for
Set Parms = session("ParamCollection").Item(1)

The Item(1) is the correct parameter to use?
and for

Call Parms.SetCurrentValue (Cstr(strSelect), 12)


you have used that value in your GroupBy formula?




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top