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!

Specifying Reports Part Viewer

Status
Not open for further replies.

LenGerstle

Programmer
Apr 2, 2003
2
0
0
US
Do you need to be using RAS to use the reports parts viewer?
We are using xsl and JavaScript to invoke reports via CE 9.0.
How do you specify that you want the Report Parts viewer vs any other viewer ?
Is there any documentation anywhere that explains how to bring up the different viewers ?
 
Here's the main() CSP function I use to call the Report Part viewer. The function calls are pretty basic, creating an InfoStore object, logging in, etc. If you need help with those, let me know.

The reportid I use is kinda screwy. It's based on a fixed-format name, with a primary key in it, that comes from the QueryString. You'll see it. :p

Function Main()
'Get the InfoStore object from the session. This global object is used
'to get the report id of the report to be viewed and to launch any necessary
'services from Crystal Enterprise.

'Call Get Logon if session("iStore") has not been set and
'if a valid logon token is not present
If TypeName(Session("IStore")) = "ISInfoStore" Then
Set iStore = Session("iStore")
'response.write "Using Session Logon"
ElseIf Request.Cookies(&quot;LogonToken&quot;) <> &quot;&quot; Then
Set iStore = GetIStoreFromToken(Request.Cookies(&quot;LogonToken&quot;))
'response.write &quot;Using Logon token&quot;
Else
Set iStore = GetIStore
'response.write &quot;Using SSO Logon&quot;
End If

'Get the reportID of the report to be viewed based on the user's choice that
'is stored the request object.
Dim targetReport, reportID

' targetReport format is &quot;PI_xxxxxxxxxxxx - Parts&quot;
' PI_, 12 digits that indicate a report id, and - Parts.
'
' Based on PerformanceIndicator.PerfInd.PIKey, which is passed via Request.QueryString(&quot;PIKey&quot;)

targetReport = &quot;PI_&quot; & String(12-Len(Request.QueryString(&quot;PIKey&quot;)), &quot;0&quot;) & Request.QueryString(&quot;PIKey&quot;) & &quot; - Parts&quot;
reportID = GetReportID (targetReport)


'Get the report source of the report to be viewed from either the
'Crystal Enterprise Page Server or from the Report Application Server.
Dim reportSource
Set reportSource = GetReportSource (reportID)


'Set up an image cleaner
Dim imageCleaner
'Set imageCleaner = EnsureImageCleanerIsRunning


'launch the appropriate viewer with the reportSource set above.
LaunchPartViewer reportSource

'Stop the image cleaner now that the viewing is complete.
'StopImageCleaner(imageCleaner)
End Function

To display the report part, call main() from the appropriate place in your html, like this...

<tr bordercolor=&quot;#FFFFFF&quot;>
<td colspan=&quot;3&quot;>
<div align=&quot;center&quot;>
<%
'Declare global variables for use throughout the page.
Dim iStore
Dim objectFactory
Set objectFactory = Server.CreateObject(&quot;CrystalReports.ObjectFactory.2&quot;)

' Call the main function of this page.
Main()
%>
</div>
</td>
</tr>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top