CRYSTAL REPORTS ON THE WEB - TUTORIAL 1

By ServerWatch Staff (Send Email)
Posted Apr 12, 1999


Vaijay

PROBLEM When displaying a crystal report using the web report server the username and password needed to logon to the database are to be supplied along with the report name.

(ex: <A HREF="http://yourservername/Report1.rpt?user0=username&password0=password">)

The problem with this is, the user will be able to see the username and password in the URL. To avoid showing the username and password in the URL do the following.
 

SOLUTION
When displaying a crystal report using the web report server the username and password needed to logon to the database are to be supplied along with the report name.

PURPOSE: To display crystal reports on the web(seagate crystal reports 6.0) using the web report server. The following will show you how to display the crystal report without displaying the username and password in the URL.
 
SCENARIO: One .html page -- > "Report.html"
The "Report.html" page contains a pull-down menu containing report names and a "GET REPORT" button. The user selects a report from the pull-down menu and clicks on the "GET REPORT BUTTON". The crystal report is then displayed in the Cystal ActiveX Viewer.
 
PRE-REQUISITES: Create the crsytal reports shown in the pull down menu in the "Report.html" page and save them in the same directory that contains the "Report.html" file, on your web server.
 
SYSTEM REQUIREMENTS: Seagate Crystal Reports 6.0/7.0, IIS 4.0 and IE 4.0 or above. The Crystal reports should be installed on the web server. Be sure to apply all the patches supplied by Seagate if using the crystal reports 6.0

STEPS TO FOLLOW

STEP   1 Create the "Report.html" file. To do this, simply copy the following code, paste it into a new file in a text-editor (ex notepad,editplus etc.) and save the file as "Report.html"

<HTML>
<HEAD>
<TITLE>Automation Server Demo>/TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
function OpenReport()
{
var RptName = document.DispRep.RptList.options[document.DispRep.RptList.selectedIndex].value;
DispRep.METHOD = "POST";
DispRep.ACTION = RptName;
DispRep.submit();
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="DispRep" METHOD="POST" ACTION="DispRpt.asp">
<SELECT NAME="RptList">
<OPTION VALUE="Report1.rpt" > Report1.rpt </OPTION>
<OPTION VALUE="Report2.rpt" > Report2.rpt </OPTION>
<OPTION VALUE="Report3.rpt" > Report3.rpt </OPTION>
<OPTION VALUE="Report4.rpt" > Report4.rpt </OPTION>
<OPTION VALUE="Report5.rpt" > Report5.rpt </OPTION>
</SELECT>
<INPUT TYPE="HIDDEN" NAME=rf VALUE=1>
<INPUT TYPE="HIDDEN" NAME=user0 VALUE=yourusername>
<INPUT TYPE="HIDDEN" NAME=password0 VALUE=yourpassword>
<input type="BUTTON" value="Get Report" onclick="OpenReport();">
</FORM>
</BODY>
</HTML>

Here Report1.rpt ... Report5.rpt are the crsytal reports that you want to display on the web. yourusername and yourpassword are the username and password values you use to log onto your database.
 
 
CAUTION Make sure that the "Report.html" and all the crystal reports are in the same directory on your web server. Then launch the "Report.html" page from your browser. Select a report and click on the "Get Report" button. This will display the report in the ActiveX Viewer.

Page 1 of 1


Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.


 

 


Thanks for your registration, follow us on our social networks to keep up-to-date