home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cfreport.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  2.6 KB  |  78 lines

  1. <!--- This view-only example shows the use of CFREPORT --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>CFREPORT Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9.  
  10. <BODY>
  11. <H3>CFREPORT Tag</H3>
  12. <P>CFREPORT allows reports from the Crystal Reports Professional 
  13. report writer to be displayed through a ColdFusion interface.  
  14. The CFREPORT tag requires the name of the report to run; 
  15. CFREPORT can also pass information to the report
  16. file being displayed to change the output conditions.
  17.  
  18. <P><i>CFREPORT is used in Windows NT only. It is not available under UNIX.</i></P>
  19.  
  20. <P>This view-only example can run a report called 
  21. "employees.rpt" and pass it an optional filter condition to 
  22. show only the information for a certain subset of the report. In this report,
  23. the subset is one or more departments that are listed in the form.</P>
  24.  
  25. <P><B>Note:</B> In order to run this report, you must take the following steps:
  26. <ol>
  27. <li>Install Crystal Reports if you have not already installed it. 
  28. <li>Stop all programs, and stop all ColdFusion services, from the Services panel 
  29. that is within the Control Panel prior to installation.  
  30. <li>Once you have installed Crystal Reports, you can restart the ColdFusion server 
  31. and all other ColdFusion services from the Services Panel.
  32. <li>Take out the comments around the first <CFIF> block and the last 
  33. </CFIF>end tag. 
  34. </ol>
  35.  
  36. <P>Substitute your own report files and filters for this code and CFREPORT can place 
  37. your existing Crystal Reports into web pages.</P>
  38.  
  39. <!--- <CFIF IsDefined("FORM.Departments")>
  40.     <CFREPORT REPORT="#GetDirectoryFromPath(CF_TEMPLATE_PATH)#EMPLOYEES.rpt">
  41.         {Employees.Department} IN "#FORM.Departments#"
  42.     </CFREPORT> 
  43.  
  44. <CFELSE> --->
  45.  
  46.     <FORM ACTION="cfreport.cfm" METHOD=POST>
  47.     
  48.     <P>This example demonstrates the integration of Crystal Reports in a ColdFusion 
  49.     web application. </P>
  50.     
  51.     <CENTER>
  52.     <TABLE BORDER=1><TD>
  53.     <TABLE><TR>
  54.     <TD WIDTH=200>
  55.     <P><FONT SIZE=-1>
  56.     Select the departments you would like to include in the report. 
  57.     Use the CTRL key to select more than one department. 
  58.     </FONT></TD>
  59.     <TD><SELECT NAME="Departments" MULTIPLE  SIZE=4>
  60.                 
  61.                 <OPTION VALUE="Sales" SELECTED>Sales
  62.                 <OPTION VALUE="Accounting" SELECTED>Accounting
  63.                 <OPTION VALUE="Engineering" SELECTED>Engineering
  64.                 <OPTION VALUE="Administration" SELECTED>Administration
  65.                 </SELECT></TD>
  66.     </TR>
  67.     <TR><TD></TD><TD><INPUT TYPE="submit" VALUE="   Generate Report"></TD>
  68.     </TR>
  69.     </TABLE>
  70.     </TABLE>
  71.     </CENTER>
  72.  
  73.     </FORM>
  74. <!--- </CFIF> --->
  75.  
  76. </BODY>
  77. </HTML>       
  78.