ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahh_5.4.0.1/jspcusttablejsp.htm

167 lines
7.0 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="Example: JSPReportProcessor sample JSP file" />
<meta name="abstract" content="" />
<meta name="description" content="" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="jspcusttablejsp" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Example: JSPReportProcessor sample JSP file</title>
</head>
<body id="jspcusttablejsp"><a name="jspcusttablejsp"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: JSPReportProcessor sample JSP file</h1>
<div><p></p>
<div class="section"><div class="note"><span class="notetitle">Note:</span> Read the <a href="codedisclaimer.htm#codedisclaimer">Code
example disclaimer</a> for important legal information.</div>
<pre>&lt;?xml version="1.0"?&gt;
&lt;!--
Copyright (c) 1999 The Apache Software Foundation. All rights reserved.
--&gt;
&lt;%@ page session="false"%&gt;
&lt;%@ page language="java" contentType="text/html" %&gt;
&lt;%@ page import="java.lang.*" %&gt;
&lt;%@ page import="java.util.*" %&gt;
&lt;%-- &lt;jsp:useBean id='cust_table' scope='page' class='table.JSPcust_table'/&gt; --%&gt;
&lt;%!
String[][] cust_data = new String [4][5];
public void jspInit()
{
//cust_record_field [][] cust_data;
// cust_record holds customer name, customer address, customer city, customer state,
// customer zip
String [] cust_record_1 = {"IBM","3602 4th St","Rochester","Mn","55901"};
String [] cust_record_2 = {"HP","400 2nd","Springfield","Mo","33559"};
String [] cust_record_3 = {"Wolzack","34 Hwy 52N","Lansing","Or","67895"};
String [] cust_record_4 = {"Siems","343 60th","Salem","Tx","12345"};
cust_data[0] = cust_record_1;
cust_data[1] = cust_record_2;
cust_data[2] = cust_record_3;
cust_data[3] = cust_record_4;
}
%&gt;
&lt;!-- First test of parse and compose. --&gt;
&lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;
&lt;fo:layout-master-set&gt;
&lt;fo:simple-page-master master-name="theMaster" &gt;
&lt;fo:region-body region-name="theRegion" margin-left=".2in"/&gt;
&lt;/fo:simple-page-master&gt;
&lt;fo:page-sequence-master master-name="theMaster"&gt;
&lt;fo:single-page-master-reference master-name="thePage"/&gt;
&lt;/fo:page-sequence-master&gt;
&lt;/fo:layout-master-set&gt;
&lt;fo:page-sequence master-name="theMaster"&gt;
&lt;fo:flow flow-name="theRegion"&gt;
&lt;fo:block&gt;
&lt;fo:block text-align="center"&gt; NORCAP &lt;/fo:block&gt;
&lt;fo:block space-before=".2in" text-align="center"&gt;PAN PACIFIC HOTEL IN SAN FRANCISCO &lt;/fo:block&gt;
&lt;fo:block text-align="center"&gt; FRIDAY, DECEMBER 8-9, 2000 &lt;/fo:block&gt;
&lt;/fo:block&gt;
&lt;fo:block space-before=".5in" font-size="8pt"&gt;
&lt;fo:table table-layout="fixed"&gt;
&lt;fo:table-column column-width="3in"/&gt;
&lt;fo:table-column column-width="3in"/&gt;
&lt;fo:table-column column-width="3in"/&gt;
&lt;fo:table-column column-width="3in"/&gt;
&lt;fo:table-column column-width="3in"/&gt;
&lt;fo:table-body&gt;
&lt;fo:table-row&gt;
&lt;fo:table-cell column-number="1"&gt;
&lt;fo:block border-bottom-style="solid"&gt;NAME&lt;/fo:block&gt;
&lt;/fo:table-cell&gt;
&lt;fo:table-cell column-number="2"&gt;
&lt;fo:block border-bottom-style="solid"&gt;ADDRESS&lt;/fo:block&gt;
&lt;/fo:table-cell&gt;
&lt;fo:table-cell column-number="3"&gt;
&lt;fo:block border-bottom-style="solid"&gt;CITY&lt;/fo:block&gt;
&lt;/fo:table-cell&gt;
&lt;fo:table-cell column-number="4"&gt;
&lt;fo:block border-bottom-style="solid"&gt;STATE&lt;/fo:block&gt;
&lt;/fo:table-cell&gt;
&lt;fo:table-cell column-number="5"&gt;
&lt;fo:block border-bottom-style="solid"&gt;ZIP CODE&lt;/fo:block&gt;
&lt;/fo:table-cell&gt;
&lt;/fo:table-row&gt;
&lt;%
// add row to table
for(int i = 0; i &lt;= 3; i++)
{
String[] _array = cust_data[i];
%&gt;
&lt;fo:table-row&gt;
&lt;fo:table-cell column-number="1"&gt;
&lt;fo:block space-before=".1in"&gt;
&lt;% if(_array[0].equals("IBM")) { %&gt;
&lt;fo:inline background-color="blue"&gt;
&lt;% out.print(_array[0]); %&gt;
&lt;/fo:inline&gt;
&lt;% } else { %&gt;
&lt;% out.print(_array[0]); %&gt;
&lt;% } %&gt;
&lt;/fo:block&gt;
&lt;/fo:table-cell&gt;
&lt;fo:table-cell column-number="2"&gt;
&lt;fo:block space-before=".1in"&gt;
&lt;% out.print(_array[1]); %&gt;
&lt;/fo:block&gt;
&lt;/fo:table-cell&gt;
&lt;fo:table-cell column-number="3"&gt;
&lt;fo:block space-before=".1in"&gt;
&lt;% out.print(_array[2]); %&gt;
&lt;/fo:block&gt;
&lt;/fo:table-cell&gt;
&lt;fo:table-cell column-number="4"&gt;
&lt;fo:block space-before=".1in"&gt;
&lt;% out.print(_array[3]); %&gt;
&lt;/fo:block&gt;
&lt;/fo:table-cell&gt;
&lt;fo:table-cell column-number="5"&gt;
&lt;fo:block space-before=".1in"&gt;
&lt;% out.print(_array[4]); %&gt;
&lt;/fo:block&gt;
&lt;/fo:table-cell&gt;
&lt;/fo:table-row&gt;
&lt;%
} // end row while
%&gt;
&lt;/fo:table-body&gt;
&lt;/fo:table&gt;
&lt;/fo:block&gt;
&lt;/fo:flow&gt;
&lt;/fo:page-sequence&gt;
&lt;/fo:root&gt;</pre>
</div>
</div>
</body>
</html>