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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

old promptex now gone in CE9?

Status
Not open for further replies.

gondoi

Programmer
Mar 10, 2003
8
0
0
US
Hey everyone,

I am having some trouble here, and as usual, I can't find the correct documentation from Crystal.

I am about to upgrade to CE9 from CE8 and I need to port some custom .csp and .asp pages over.

Here is what I have done in CE8:
I have replaced the reportviewer.csp page with my own custom page that intercepts the call to it and checks the report to see if the parameters need a dynamically built menu for the paramater values.
If it does not need a dynamic menu then it is passed on to the original reportviewer page I renamed reportviewercall.csp.
If it does need a dynamic menu, then it calls the appropriate SQL SELECTs to the database and populates the drop-menu. This menu is named &quot;promptex-<parameter name>&quot; so that when the form is submitted to the viewer.cwr the user isn't prompted for the value and uses what they chose from the drop-down.

My problem in CE9 is that I got the dynamic menus to work, but when submitting to the new viewreport.csp or viewreport_ia.csp (whichever is appropriate) the &quot;promptex-<parameter name>&quot;s do not get used and the users are prompted for a value.

After searching all the documentation I could get my hands on, I have decided that they took this functionality out.
Is this true? And if so, how can I pass parameter values in a similar manner?

I have seen examples where people have created parameter objects and populated those, etc, etc. But my goal is to modify as few Crystal csp pages as possible, so I would rather simply pass the values to the page without having to get the values with my own custom code.

Can anyone help with this huge post?
Thanks,
gondoi
 
Hi,
According to Crystal Suport folks, the ability to use the
promptex-ParaName = somevalue
has been 'deprecated' but still works..
( Lots and Lots of people wrote custom pages that use it, - it was a big advance over the older prompt0,prompt1..promptN stuff - so customers would not be happy to see it go just yet..[smile])

Without seeing your code, I do not know why it does not in your application of it..


[profile]
 
Well, I have basically the same page I had before, just that I changed the page it's passed to to viewreport.csp or whatever.

What I do is add form elements to the ViewForm form, and name them &quot;promptex-ParaName&quot;.
So, I have this
[tt]
<select name=&quot;promptex-date&quot;>
<option>1</option>
</select>
[/tt]
There is more to it of course, but that's just an idea. I have everything set up just like the original reportviewer.csp page, but then I add those selects per needed parameters.
So basically, it should see the promptex- just as before, but it runs the report and then prompts again for the data.

If you need specific code, let me know so I can post it or send it to you.

Thanks,
gondoi
 
I use a different method to pass the parameters to the report, so seeing those 2 pages would be useful.
If you are curious how I use them, see
thread782-460040 and look for my large reply..

Posting reportviewer and viewreport should be sufficient to start..

[profile]
 
Ok, here comes a LONG post...

reportviewer.csp:

[tt]
<%@ Language=VBScript %>
<!-- #METADATA type=&quot;typelib&quot; file=&quot;C:\Program Files\Common Files\System\ADO\MSADO15.Dll&quot; -->
<!-- #include file=&quot;helper.csp&quot; -->
<!-- #include file=&quot;DropMenu.asp&quot; -->
<!-- Reworking of reportviewer.csp done to handle more dynamic picklists and all others -->
<!-- BK Box 03/2003 -->
<%
'On Error Resume Next

DIM reportNumber
DIM reportName
DIM reportType
DIM ExportType
DIM vwr
DIM strViewer
DIM expo
DIM strUserID
DIM strMgrID
DIM tmpMgrID
DIM strSupID
DIM tmpSupID
DIM conn
DIM rs
DIM altLogon
DIM bSupDrop
DIM bMgrDrop

bSupDrop = False
bMgrDrop = False

reportNumber = Request.QueryString(&quot;reportNumber&quot;)
reportName = Request.QueryString(&quot;reportName&quot;)
reportType = Request.QueryString(&quot;reportType&quot;)
expo = Request.QueryString(&quot;expo&quot;)

'GET THE InfoStore
Dim iStore
Set iStore = Session(&quot;IStore&quot;)
If( Err.Number = 0 ) Then
strUserID = iStore.EnterpriseSession.UserInfo.UserName

Set altLogon = iStore.Query(&quot;Select * from CI_INFOOBJECTS Where SI_ID=&quot; & ReportNumber).item(1).PluginInterface.ReportLogons.Item(1)

'get connection and query into recordset
Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.Open altLogon.ServerName,&quot;username&quot;,&quot;password&quot;
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Set rs = conn.Execute(&quot;SELECT DISTINCT Manager,Supervisor FROM Employee where EmpID = '&quot; & strUserID & &quot;'&quot;)

if NOT rs.EOF AND NOT rs.BOF Then
tmpMgrID = rs(&quot;Manager&quot;)
tmpSupID = rs(&quot;Supervisor&quot;)

If (tmpMgrID = &quot;&quot; OR isNull(tmpMgrID)) AND (tmpSupID = &quot;&quot; OR isNUll(tmpSupID)) Then
strMgrID = strUserID
strSupID = &quot;All&quot;
ElseIF (tmpMgrID = tmpSupID) Then
strMgrID = tmpMgrID
bSupDrop = True
Else
strMgrID = tmpMgrID
strSupID = tmpSupID
End IF
Else
bMgrDrop = True
bSupDrop = True
End If

' If NOT rs.EOF AND NOT rs.BOF Then
' strMgrID = Trim(rs(&quot;Manager&quot;))
' End If

' If strMgrID = &quot;&quot; or isNull(strMgrID)Then
' strMgrID = &quot;No Manager&quot;
' End If

Set conn = Nothing
Set rs = Nothing

If( needPicklist() OR plCheck() ) Then
Picklist()
Else
Dim url
url = &quot;reportviewercall.csp?reportNumber=&quot; & reportNumber & &quot;&reportName=&quot; & escape(reportName) & &quot;&reportType=&quot; & reportType & &quot;&expo=&quot; & expo
Response.Redirect(url)
End If
End If

'*****************************
'** FUNCTION: needPicklist() *
'*****************************
Function needPicklist()
needPicklist = False

' check that we need a dynamic picklist
If (bMgrDrop OR bSupDrop) Then
needPicklist = True
End If
End Function

'*****************************
'*** FUNCTION: plCheck() *****
'*****************************
Function plCheck()
DIM cReport
DIM cParams
DIM oParam

Set cReport = iStore.Query(&quot;Select * from CI_INFOOBJECTS Where SI_ID=&quot; & ReportNumber).item(1)
Set cParams = cReport.PluginInterface.ReportParameters

plCheck = False

For Each oParam in cParams
If left(oParam.ParameterName,3) = &quot;pl&&quot; then
plCheck = True
End If
Next
End Function

'*****************************
'*** FUNCTION: Picklist() ****
'*****************************
Function Picklist()
Header()

DIM cReport
DIM cParams
DIM oParam
DIM cLogon
DIM tablename
DIM fieldname
DIM conn
DIM rs
DIM strParamName
DIM iLen
DIM regEx
DIM strTemp
DIM boolTemp

Set regEx = New RegExp
regEx.Pattern = &quot;[\.\'\,\_\-\(\)]&quot;
regEx.IgnoreCase = True
regEx.Global = True

Response.ExpiresAbsolute = Now() - 1

Set cReport = iStore.Query(&quot;Select * from CI_INFOOBJECTS Where SI_ID=&quot; & ReportNumber).item(1)
Set cParams = cReport.PluginInterface.ReportParameters
Set cLogon = cReport.PluginInterface.ReportLogons.Item(1)

'loop through params to check for Picklist params
For Each oParam in cParams
If left(oParam.ParameterName,3) = &quot;pl&&quot; then
'set what table and field...
strParamName = right(oParam.ParameterName,len(oParam.parametername)-3)
iLen = InStr(strParamName,&quot;&&quot;)
tablename = left(strParamName,iLen-1)
fieldname = right(strParamName,len(strParamName)-iLen)

'Display prompt if available
If oParam.Prompt <> &quot;&quot; Then
Response.Write &quot;<b>&quot; & oParam.Prompt & &quot;</b><br><br>&quot; & vbCRLF
Else
Response.Write &quot;<b>&quot; & oParam.ParameterName & &quot;</b><br><br>&quot; & vbCRLF
End If

'get connection and query into recordset
Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.Open cLogon.ServerName,&quot;username&quot;,&quot;password&quot;
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Set rs = conn.Execute(&quot;SELECT DISTINCT &quot; & fieldname & &quot; FROM &quot; & tablename & &quot; ORDER BY &quot; & fieldname)

'If a multiple select enable the correct box
If oParam.EnableMultipleValues Then
Response.Write &quot;<select size=16 multiple class=&quot;&quot;menuFormElement&quot;&quot; name=&quot;&quot;promptex-&quot; & oParam.ParameterName & &quot;&quot;&quot;>&quot; & vbCRLF
Else
Response.Write &quot;<select class=&quot;&quot;menuFormElement&quot;&quot; name=&quot;&quot;promptex-&quot; & oParam.ParameterName & &quot;&quot;&quot;>&quot; & vbCRLF
End If

'Loop through selects
boolTemp = 1
Do While Not rs.EOF
strTemp = Trim(rs(fieldname))
If strTemp <> &quot;&quot; Then
Response.Write &quot;<OPTION VALUE=&quot;&quot;&quot; & regEx.Replace(strTemp,&quot;?&quot;) & &quot;&quot;&quot;&quot;
If boolTemp Then
Response.Write &quot; selected&quot;
End If
boolTemp = 0
Response.Write &quot;>&quot; & Trim(rs(fieldname)) & &quot;</OPTION>&quot; & vbCRLF
End If
rs.MoveNext
Loop
Response.Write &quot;</select><br>&quot; & vbCRLF
If oParam.EnableMultipleValues Then
Response.Write &quot;Hold down Ctrl and click to select more than one.<br>&quot; & vbCRLF
End If
Response.Write &quot;<br>&quot; & vbCRLF

Set conn = Nothing
Set rs = Nothing
End If
Next

If bMgrDrop OR bSupDrop Then
MgrSupDrop()
End If

Footer()
End Function

'********************************
'****** Sub: MgrSupDrop() *******
'********************************
Sub MgrSupDrop()

DIM tablename
DIM fieldname
DIM conn
DIM rs
DIM regEx
DIM strTemp
DIM boolTemp
DIM altLogon

Set regEx = New RegExp
regEx.Pattern = &quot;[\.\'\,\_\-\(\)]&quot;
regEx.IgnoreCase = True
regEx.Global = True

'set what table and field...
tablename = &quot;employee&quot;

'If bMgrDrop Then
' fieldname = &quot;Manager&quot;
'Else
' fieldname = &quot;Supervisor&quot;
'End If

Set altLogon = iStore.Query(&quot;Select * from CI_INFOOBJECTS Where SI_ID=&quot; & ReportNumber).item(1).PluginInterface.ReportLogons.Item(1)

If bMgrDrop Then
fieldname = &quot;Manager&quot;
'get connection and query into recordset

Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.Open altLogon.ServerName,&quot;username&quot;,&quot;password&quot;
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Set rs = conn.Execute(&quot;SELECT DISTINCT &quot; & fieldname & &quot; FROM &quot; & tablename & &quot; WHERE &quot; & fieldname & &quot; IS NOT NULL ORDER BY &quot; & fieldname)

'Display prompt
Response.Write &quot;<b>Please choose the &quot; & fieldname & &quot;</b><br><br>&quot; & vbCRLF

Response.Write &quot;<select class=&quot;&quot;menuFormElement&quot;&quot; id=&quot;&quot;mgrCode&quot;&quot; name=&quot;&quot;promptex-mgrCode&quot;&quot;&quot;
IF bSupDrop Then
Response.Write &quot; onchange=&quot;&quot;javascript:Change_Users(document.viewForm.supCode.options,document.viewForm.mgrCode);&quot;&quot;&quot;
End IF
Response.Write &quot;>&quot; & vbCRLF

'Loop through selects
boolTemp = 1
Do While Not rs.EOF
strTemp = Trim(rs(fieldname))
If strTemp <> &quot;&quot; Then
Response.Write &quot;<OPTION VALUE=&quot;&quot;&quot; & regEx.Replace(strTemp,&quot;?&quot;) & &quot;&quot;&quot;&quot;
If boolTemp Then
Response.Write &quot; selected&quot;
End If
boolTemp = 0
Response.Write &quot;>&quot; & Trim(rs(fieldname)) & &quot;</OPTION>&quot; & vbCRLF
End If
rs.MoveNext
Loop
Response.Write &quot;</select><br>&quot; & vbCRLF
Response.Write &quot;<br>&quot; & vbCRLF

Set conn = Nothing
Set rs = Nothing
End If

If bSupDrop Then
Response.Write &quot;<b>Please choose the Supervisor</b><br><br>&quot; & vbCRLF
Response.Write &quot;<select class=&quot;&quot;menuFormElement&quot;&quot; id=&quot;&quot;supCode&quot;&quot; name=&quot;&quot;promptex-supCode&quot;&quot;></select><br><br>&quot; & vbCRLF
End If
End Sub

'********************************
'******** Sub: Header() *********
'********************************
Sub Header()
DIM strHeader

strHeader = &quot;<html>&quot; &vbCRLF
strHeader = strHeader & &quot; <head>&quot; &vbCRLF
strHeader = strHeader & &quot; <title>ePortfolio - View Report</title>&quot; &vbCRLF
strHeader = strHeader & &quot;<link rel='stylesheet' type='text/css' name='stylelink' href='&quot; & GetLinkPath() & &quot;css/default.css'>&quot; &vbCRLF
strHeader = strHeader & &quot; </head>&quot; &vbCRLF
strHeader = strHeader & &quot; <body>&quot; &vbCRLF
strHeader = strHeader & &quot;<!-- HEADER -->&quot; &vbCRLF
strHeader = strHeader & &quot;<table class='header' width='760' border='0' cellpadding='3' cellspacing='0'>&quot; &vbCRLF
strHeader = strHeader & &quot;<tr>&quot; &vbCRLF
strHeader = strHeader & &quot; <td class='header'>&quot; &vbCRLF
strHeader = strHeader & &quot; <a href=' &vbCRLF
strHeader = strHeader & &quot; <img src='&quot; & GetLinkPath() & &quot;images/eportfolio.gif' border='0' alt='corporate logo'>&quot; &vbCRLF
strHeader = strHeader & &quot; </a>&quot; &vbCRLF
strHeader = strHeader & &quot; </td>&quot; &vbCRLF
strHeader = strHeader & &quot; <td class='header' align='right'>&quot; &vbCRLF
strHeader = strHeader & &quot; <span class='headerWelcome'>Welcome!</span><br>&quot; &vbCRLF
strHeader = strHeader & &quot; <a class='header' href='javascript:self.close();'>Cancel</a>&quot; &vbCRLF
strHeader = strHeader & &quot; </td>&quot; &vbCRLF
strHeader = strHeader & &quot; <tr class='menu'><td colspan=2> </td></tr>&quot; &vbCRLF
strHeader = strHeader & &quot; <tr cspan=2 class='category'><td colspan=2> </td></tr>&quot; &vbCRLF
strHeader = strHeader & &quot; <tr cspan=2 class='path'><td colspan=2> </td></tr>&quot; &vbCRLF
strHeader = strHeader & &quot;</tr>&quot; &vbCRLF
strHeader = strHeader & &quot;</table>&quot; &vbCRLF

Response.Write strHeader

lastFive()

DIM strToken
DIM ltm

'GET LOGON TOKEN
SET ltm = iStore.EnterpriseSession.LogonTokenMgr
strToken = ltm.CreateLogonToken(&quot;&quot;, 1, 20)
If( iStore.EnterpriseSession.UserInfo.UserId <> 11 ) Then
If( Err.Number = 0 ) Then
GetViewer()
End If
End If
GetExportType()

'DISPLAY THE REPORT VIEWER
Dim url
If( vwr = &quot;&quot; And ExportType = &quot;&quot; ) Then
url = &quot;viewreport_ia.csp?init=connect&id=&quot; & reportNumber
ElseIf ( ExportType = &quot;&quot; ) Then
url = &quot;viewreport.csp?init=connect&id=&quot; & reportNumber
Else
url = &quot;viewrpt.cwr?id=&quot; & reportNumber
End If

Response.Write &quot;<form name='viewForm' method='post' action='&quot; & url & &quot;'>&quot; & vbCRLF
Response.Write &quot;<input type='hidden' name='apstoken' value='&quot; & strToken & &quot;'>&quot; & vbCRLF
Response.Write &quot;<input type='hidden' name='promptex-vzcode' value='&quot; & strUserID & &quot;'>&quot; & vbCRLF
If Not bMgrDrop Then
Response.Write &quot;<input type='hidden' name='promptex-mgrcode' value='&quot; & strMgrID & &quot;'>&quot; & vbCRLF
End If
If Not bSupDrop Then
Response.Write &quot;<input type='hidden' name='promptex-supcode' value='&quot; & strSupID & &quot;'>&quot; & vbCRLF
End If
End Sub

'********************************
'******** Sub: Footer() *********
'********************************
Sub Footer()
DIM strFooter

strFooter = &quot;<INPUT class=&quot;&quot;menuFormElement&quot;&quot; name=sa type=submit value=&quot;&quot;View Report&quot;&quot;>&quot;
strFooter = strFooter & &quot;</form>&quot; & vbCRLF
strFooter = strFooter & &quot; </body>&quot; & vbCRLF
strFooter = strFooter & &quot;</html>&quot; & vbCRLF

Response.Write(strFooter)
End Sub

'*****************************
'*** FUNCTION: GetViewer() ***
'*****************************
Function GetViewer()
'GET VIEWER FROM COOKIES
vwr = Request.Cookies(&quot;ePortfolio_vwr&quot;)

Select Case vwr
Case 0
strViewer = &quot;actx&quot;
Case 1
strViewer = &quot;html_frame&quot;
Case 2
strViewer = &quot;html_page&quot;
Case 3
strViewer = &quot;java&quot;
Case 4
strViewer = &quot;java_plugin&quot;
Case 5
strViewer = &quot;nav_plugin&quot;
End Select
Dim s
s = Request.ServerVariables(&quot;HTTP_USER_AGENT&quot;)
If( ( strViewer = &quot;nav_plugin&quot; ) And ( Instr(s, &quot;MSIE&quot;) ) )Then
strViewer = &quot;actx&quot;

ElseIf( ( strViewer = &quot;actx&quot; ) And ( Instr(s, &quot;MSIE&quot;) = 0 ) ) Then
strViewer = &quot;nav_plugin&quot;

End If

End Function

'*********************************
'*** FUNCTION: GetExportType() ***
'*********************************
Function GetExportType()
Dim defExpo
Dim expo
If( Request.Cookies(&quot;ePortfolio_expo&quot;) <> &quot;&quot; ) Then
defExpo = Request.Cookies(&quot;ePortfolio_expo&quot;)
Else
defExpo = 0
End If

If( Request.QueryString(&quot;expo&quot;) <> &quot;undefined&quot; And Request.QueryString(&quot;expo&quot;) <> &quot;&quot; ) Then
expo = Request.QueryString(&quot;expo&quot;)
Else
expo = defExpo
End If

'If exporting to Word, Excel or rtf, append SessionID because older IE would send 2 GET request and lose all cookies in the 2nd req
Select Case expo
Case 0
ExportType = &quot;&quot; 'Crystal Report format is default so no command need be sent.
Case 1
ExportType = &quot;&cmd=export&export_fmt=U2FXLS%3A5&&quot; & Session.SessionID 'MS Excel 7 format
Case 2
ExportType = &quot;&cmd=export&export_fmt=U2FWORDW%3A0&&quot; & Session.SessionID 'MS Word format
Case 3
ExportType = &quot;&cmd=export&export_fmt=U2FPDF%3A0&quot; 'Adobe Acrobat format
Case 5
ExportType = &quot;&cmd=export&export_fmt=U2FRTF%3A0&quot; & Session.SessionID 'Rich Text Format
Case 6
ExportType = &quot;&cmd=export&export_fmt=U2FTEXT%3A0&quot; 'Text format
Case Else
ExportType = &quot;&quot;
End Select

End Function

'***************************
'****** SUB: lastFive() ****
'***************************
Sub lastFive()
'GET LAST FIVE REPORTS FROM SESSION OBJECT
Dim lastFiveRptName(4)
Dim lastFiveRptNum(4)
Dim i
Dim num
Dim match
Dim lastElement

If( IsArray(Session(&quot;lastFiveRptName&quot;)) ) Then
'GET CURRENT LIST IN SESSION OBJECT
For i = 0 to 4
lastFiveRptName(i) = Session(&quot;lastFiveRptName&quot;)(i)
lastFiveRptNum(i) = Session(&quot;lastFiveRptNum&quot;)(i)
Next

match = false
'FIND MATCH IN LIST
For i = 0 to 4
num = Split(lastFiveRptNum(i), &quot;:&quot;)
If num(0) = reportNumber Then
match = true
Exit For
End If
Next

If match = false Then
lastElement = 4

'SHIFT ELEMENTS IN LIST
For i = lastElement to 1 Step -1
lastFiveRptName(i) = lastFiveRptName(i-1)
lastFiveRptNum(i) = lastFiveRptNum(i-1)
Next

'ADD NEW REPORT TO TOP
lastFiveRptName(0) = reportName
lastFiveRptNum(0) = reportNumber & &quot;:&quot; & reportType
End If

Else
lastFiveRptName(0) = reportName
lastFiveRptNum(0) = reportNumber & &quot;:&quot; & reportType
For i = 1 to 4
lastFiveRptName(i) = &quot;-&quot;
lastFiveRptNum(i) = &quot;0&quot;
Next

End If

'SET LIST IN SESSION OBJECT
Session(&quot;lastFiveRptName&quot;) = Array(lastFiveRptName(0), lastFiveRptName(1), lastFiveRptName(2), lastFiveRptName(3), lastFiveRptName(4))
Session(&quot;lastFiveRptNum&quot;) = Array(lastFiveRptNum(0), lastFiveRptNum(1), lastFiveRptNum(2), lastFiveRptNum(3), lastFiveRptNum(4))
End Sub
[/tt]

viewreport.csp

[tt]
<%@ language=JavaScript codepage=65001%>

<!-- #include file=&quot;setcodepage.csp&quot; -->
<!-- #include file=&quot;helper_js.csp&quot; -->
<!-- #include file=&quot;checksession_js.csp&quot; -->
<!-- #include file=&quot;handleerror_js.csp&quot; -->

<%
SetPageExpiry();

try
{
// Get the current info store
var iStore = CheckSession(true);
var id = String( Request.QueryString.Item( &quot;id&quot; ) );
var initCommand = String(Request.QueryString.Item(&quot;init&quot;));

var viewer1;
var sf;
var rptSrc;

var cachedRptSrcID = GetSession(&quot;RptSrcID&quot;);
if ((cachedRptSrcID == id) && (initCommand != &quot;connect&quot;))
{
// Use the cached report source
rptSrc = GetSession(&quot;RptSrc&quot;);
}

// If we didn't find a report source, just make a new one
if (typeof(rptSrc) != &quot;object&quot;)
{
var rptSrcFactory = iStore.EnterpriseSession.Service (&quot;&quot;, &quot;PSReportFactory&quot;);
rptSrc = rptSrcFactory.OpenReportSource(Number(id));

SetSession(&quot;RptSrcID&quot;, id);
SetSession(&quot;RptSrc&quot;, rptSrc);
}

EnsureImageCleanerIsRunning();
viewer1 = Server.CreateObject( &quot;CrystalReports.CrystalReportViewer&quot; );

// set selection formula
sf = Request.QueryString.Item(&quot;sf&quot;);
if ( sf.Count != 0 )
viewer1.ViewTimeSelectionFormula = String(sf);

viewer1.ReportSource = rptSrc;
viewer1.IsOwnForm = true;
viewer1.IsOwnPage = true;
viewer1.IsDisplayGroupTree = true;
viewer1.PageToTreeRatio = 5.0;
viewer1.IsDisplayToolbar = true;
viewer1.IsDisplayPage = true;
viewer1.HasRefreshButton = true;
viewer1.URI = String(Request.ServerVariables.Item(&quot;SCRIPT_NAME&quot;)) + String(Request.ServerVariables.Item(&quot;PATH_INFO&quot;)) + &quot;?&quot;;

if (initCommand == &quot;connect&quot;)
{
//Response.Write(Request.ServerVariables.Item(&quot;QUERY_STRING&quot;));

var queryItemCount = Request.QueryString.Count;
var first = true;
//Response.Write(&quot;queryItemCount = &quot; + queryItemCount);
for (var i = 1; i <= queryItemCount; i++)
{
//Response.Write(&quot;name=&quot; + Request.QueryString.Key(i));
//Response.Write(&quot;value=&quot; + Request.QueryString.Item(i));
if (Request.QueryString.Key(i) != &quot;init&quot;)
{
if (first == false)
viewer1.URI += &quot;&&quot;;

viewer1.URI = viewer1.URI + Request.QueryString.Key(i) + &quot;=&quot; + Request.QueryString.Item(i);

if (first == true)
first = false;
}
}
}
else
viewer1.URI = viewer1.URI + Request.ServerVariables.Item(&quot;QUERY_STRING&quot;);
//Response.Write(viewer1.URI);

viewer1.ProcessHttpRequest( Request, Response, Session );
}
catch(e)
{
WriteErrorRetrieve(e.description);
}
%>
[/tt]
 
Ok, I have now tried both ways... Through the querystring, and through the form. Neither work. Are you sure that they said it was still in CE 9, but just depreciated?

Thanks
gondoi
 
Hi,
Yep..That's what I was told - and the tech I spoke to verified it with others..(We don't have 9 installed yet, so I cannot verify the info..)
Try this code in the HEAD of one of your pages ( substitute your promptex-Name as needed and use a report ID # from some report that allows guest access . You would use your server name obviously -
I call this from a button on an asp form and pass it the prompt value as p, the reportid as m.

Code:
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function RunRpt(p,m){
   var pstr = p
    windowprops = &quot;fullscreen=no,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes&quot;;
   locstr = &quot;[URL unfurl="true"]http://<YOURCESERVER>/viewrpt.cwr?id=&quot;[/URL] + m 
   teststr = &quot;&promptex-EmpNbr=&quot; + pstr
   userstr = &quot;&apsuser=Guest&apsauthtype=secEnterprise&quot;
   initstr = &quot;&init=actx&quot;
 }
  reportWindow = window.open( locstr + userstr + pstr + initstr,&quot;rptWindow&quot;,windowprops);
</SCRIPT>

Just a way to test the concept of Promptex and eliminating most other variables that could cause an error in execution.
Of course, you could just pass the needed parameters directly in the URL since this is just for testing:

Code:
[URL unfurl="true"]http://yourcrystalserver/viewrpt.cwr?id=###&apsuser=Guest&apsauthtype=secEnterprise&promptex-MyName=&quot;VALUE&quot;&init=actx[/URL]

[profile]
 
Ok, talk about a waste of time... I've been trying to pass to the new viewreport.csp that came with CE 9 and which they use now, assuming that viewer.cwr had been taken out.

Just copy and pasted my old page in there and it works great.

Thanks for the help Turkbear

gondoi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top