Before rushing into viewing and scheduling, you will want to take a look at an interesting feature in Crystal Enterprise: the ability to preview a report using thumbnails. It is possible to request the server to take a snapshot of the first page of the report and return it to the browser as an image file. This image can then be displayed as part of the Report Details page.
To retrieve a thumbnail, a separate page needs to be created since the code that writes an image to the screen erases any text that may have previously been there.
You can create a thumbnail by following these steps:
PluginInterface
property to get a Report object with which information about the report can be retrieved.
Picture
property to retrieve the thumbnail.
Note: You can generate a thumbnail image of a report when the report is created. If a thumbnail has been generated with the report, and if the EnableThumbnail property is True, a thumbnail image of the report will be available for retrieval. If it is False, then no thumbnail will be available.
Generally speaking, the result of a query is an InfoObjects
collection that may contain various objects like reports or folders. The items in this collection are returned as InfoObjects
, but each InfoObject
may expose a different interface, depending on what features it supports. The PluginInterface
property makes it easier to communicate with one of these objects by providing a means to query for a specific interface, which is something that normal Microsoft Active Scripting does not provide.
Query = "Select * From CI_INFOOBJECTS Where SI_ID = " & ID
In this particular case, the PluginInterface
property returns the interface for the Report object, and this interface is used to retrieve thumbnail information for the report you selected. For more information on the Report object's properties and methods, Report Object.
You can use the Picture Property to retrieve different types of images.To retrieve a thumbnail, use the following setting: Picture(4).
'Retrieve the thumbnail picture.
Response.ContentType = "image/jpeg"
Response.Redirect "images/rpt_tn.gif"
Response.Redirect "images/rpt_tn.gif"
Note that if the thumbnail for the report has not been enabled, then a generic image named rpt_tn.gif
is put in its place.
Using the thumbnail function is tricky since it erases all of the text on the screen. To use it, you must reference the entire file in an HTML image tag.
<IMG SRC='thumbnail.csp
This will cause the image on the thumbnail.csp page to be printed on the page that called it.
You've reached the end of this lesson. To see a full version of a CSP page that retrieves a thumbnail image, see Thumbnail.csp
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |