The Simplest Interactive Report


(Run Example)  (View Source)

To make a report interactive and editable by users on the fly, you need to do two things:

  1. Set the interactive attribute of the <bloxreport:report> tag to "true". This will make the Report Editor-- a set of interactive context menus embedded in the rendered report-- available to users as they move the mouse over to each column header and footer.
  2. Include a style sheet that defines the styles in which to display various elements in the menus. A default style sheet is provided. You can add the following line in your JSP page to use the provided style sheet.

    <link rel="stylesheet" href="<%= URLFactory.toExternalForm(URLFactory.SERVER_CONTEXT, "/report/report.css")%>" />

Note that interactive reports are not supported for Netscape browsers.

Here is all the code sample:

<!-- Importing the Blox Reporting Tag Library  -->
<%@ taglib uri="bloxreporttld" prefix="bloxreport" %>
<HTML>
<HEAD>
   <!-- using a stylesheet that defines the styles for the interactive context menus-->
   <link rel="stylesheet" href="<%= URLFactory.toExternalForm(URLFactory.SERVER_CONTEXT, "/report/report.css")%>" />
</HEAD>
<BODY>

   <!--- Simplest interactive report using a SQL Data Source --->
   <bloxreport:report id = "Report2" interactive = "true">
     <bloxreport:sqlData
	query="SELECT Week_Ending, Area, Location, Product, 
             Code, Type, Cost, Units, Sales" >
	<bloxreport:dataSourceConnection
             dataSourceName = "chocoblocks" >
	</bloxreport:dataSourceConnection>
      </bloxreport:sqlData>
   </bloxreport:report>

</BODY>
</HTML>

(Run Example)  (View Source)