Transformation is adding unformatting data

I am very new with XSLT and all the details, so excuse me is I don't see the error in my ways. I also realize this is probably a very long post, but I did not want to leave anything out just in case someone wanted to see the xml, xsl or html.
What I am trying to accomplish is take an XML document and transform it into a HTML presentation using a table. I have started with a simple case of one row within the table. It populating the table row correctly, but for some reason, the original stream of data for the row (unformatted) is appearing above the table twice. I can not explain why this occurring. Can someone help me?
This is how I have the xsl files chained together:
DocSearchResults --> documents --> document
                                                      |-->pageRange
                                                                      |-->docContent
                                                                                  |-->pageRange
--------------------------------------------------------------------------------This is the DocSearchResults:
?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"    version="1.0"    xmlns:xalan="http://xml.apache.org/xslt">    <xsl:include href="documents.xsl"/> <xsl:output method="html" encoding="iso-8859-1" indent="yes"/>         <xsl:variable name="table-heading">            <td><b>Sequence</b></td>            <td><b>DocumentId</b></td>            <td><b>Create Date</b></td>            <td><b>Create Time</b></td>            <td><b>Create Operator</b></td>            <td><b>ExternalDocKey</b></td>            <td><b>ExternalSysName</b></td>            <td><b>Mail Desc</b></td>            <td><b>Mail Id</b></td>            <td><b>ArchBoxId</b></td>            <td><b>MagFldName</b></td>            <td><b>MagFlg</b></td>            <td><b>Fax Nbr</b></td>            <td><b>Begin Page</b></td>            <td><b>End Page</b></td>            <td><b>PageTotal</b></td>            <td><b>WrkStnId</b></td>            <td><b>File Size</b></td>            <td><b>File Type</b></td>            <td><b>PiDocType</b></td>            <td><b>Annotation</b></td>            <td><b>Doc Content Seq</b></td>            <td><b>Doc Content Desc</b></td>            <td><b>Begin Page</b></td>            <td><b>End Page</b></td>            <td><b>PageTotal</b></td>            <td><b>Secure Flag</b></td>            <td><b>TaskId</b></td>        </xsl:variable>    <xsl:template match="/"> <html lang="en">  <body>       <h2>Document Details</h2>       <h3>Total Documents:<xsl:value-of select="Documents/count"/></h3>           <table  border="1" cellpadding="5">              <tr>                <xsl:copy-of select="$table-heading"/>              </tr>               <!-- This is to pick up documents -->               <xsl:call-template name="documents">                  <xsl:with-param name="documentsNode" select="Documents"/>               </xsl:call-template>           </table>  </body></html>     </xsl:template></xsl:stylesheet>
--------------------------------------------------------------------------------This is the documents xsl:
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"    version="1.0"    xmlns:xalan="http://xml.apache.org/xslt">     <xsl:include href="document.xsl"/> <xsl:output method="html" encoding="iso-8859-1" indent="yes"/>   <xsl:template name="documents">    <xsl:param name="documentsNode"/>    <tr><xsl:call-template name="document">             <xsl:with-param name="documentNodes" select="$documentsNode/*"/>        </xsl:call-template>    </tr>  </xsl:template> </xsl:stylesheet>
--------------------------------------------------------------------------------This is the document xsl
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"    version="1.0"    xmlns:xalan="http://xml.apache.org/xslt">    <xsl:include href="pageRange.xsl"/><xsl:include href="docContent.xsl"/> <xsl:output method="html" encoding="iso-8859-1" indent="yes"/>   <xsl:template name ="document" >        <xsl:param name="documentNodes"/>                                <td><xsl:value-of select="$documentNodes/id"/></td>                                               <xsl:variable name="docid" select="$documentNodes/docid"/>                <xsl:choose>                   <xsl:when test="$docid = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($docid)>0">                     <td><xsl:value-of select="$docid"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                                <xsl:variable name="createdate" select="$documentNodes/createdate"/>                <xsl:choose>                   <xsl:when test="$createdate = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($createdate)>0">                     <td><xsl:value-of select="$createdate"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <xsl:variable name="createtime" select="$documentNodes/createtime"/>                <xsl:choose>                   <xsl:when test="$createtime = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($createtime)>0">                     <td><xsl:value-of select="$createtime"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                 <xsl:variable name="createoper" select="$documentNodes/createoper"/>                <xsl:choose>                   <xsl:when test="$createoper = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($createoper)>0">                     <td><xsl:value-of select="$createoper"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <xsl:variable name="extdockey" select="$documentNodes/extdockey"/>                <xsl:choose>                   <xsl:when test="$extdockey = null">                     <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($extdockey)>0">                     <td><xsl:value-of select="$extdockey"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                               <xsl:variable name="extsystemname" select="$documentNodes/extsystemname"/>                <xsl:choose>                   <xsl:when test="$extsystemname = null">                     <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($extsystemname)>0">                     <td><xsl:value-of select="$extsystemname"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <xsl:variable name="maildesc" select="$documentNodes/mailinfo/maildesc"/>                <xsl:choose>                   <xsl:when test="$maildesc = null">                     <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($maildesc)>0">                     <td><xsl:value-of select="$maildesc"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <xsl:variable name="mailid" select="$documentNodes/mailinfo/mailid"/>                <xsl:choose>                   <xsl:when test="$mailid = null">                     <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($mailid)>0">                     <td><xsl:value-of select="$mailid"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <xsl:variable name="archboxid" select="$documentNodes/archboxid"/>                <xsl:choose>                   <xsl:when test="$archboxid = null">                     <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($archboxid)>0">                     <td><xsl:value-of select="$archboxid"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <xsl:variable name="magfldname" select="$documentNodes/magfldname"/>                <xsl:choose>                   <xsl:when test="$magfldname = null">                     <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($magfldname)>0">                     <td><xsl:value-of select="$magfldname"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <xsl:variable name="magflag" select="$documentNodes/magflag"/>                <xsl:choose>                   <xsl:when test="$magflag = null">                     <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($magflag)>0">                     <td><xsl:value-of select="$magflag"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <xsl:variable name="faxnbr" select="$documentNodes/faxnbr"/>                <xsl:choose>                   <xsl:when test="$faxnbr = null">                     <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($faxnbr)>0">                     <td><xsl:value-of select="$faxnbr"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <!-- This is to pick up page ranges -->                <xsl:apply-templates mode="docPages"/>                                                                             <xsl:variable name="wrkstnid" select="$documentNodes/wrkstnid"/>                <xsl:choose>                   <xsl:when test="$wrkstnid = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($wrkstnid)>0">                     <td><xsl:value-of select="$wrkstnid"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <!-- This will always be populated -->                <td><xsl:value-of select="$documentNodes/filesize"/></td>                                <xsl:variable name="filetype" select="$documentNodes/filetype"/>                <xsl:choose>                   <xsl:when test="$filetype = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($filetype)>0">                     <td><xsl:value-of select="$filetype"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <xsl:variable name="pidoctype" select="$documentNodes/pidoctype"/>                <xsl:choose>                   <xsl:when test="$pidoctype = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($pidoctype)>0">                     <td><xsl:value-of select="$pidoctype"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                 <xsl:variable name="annotations" select="$documentNodes/annotations"/>                <xsl:choose>                   <xsl:when test="$annotations = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($annotations)>0">                     <td><xsl:value-of select="$annotations"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>                </xsl:choose>                                <!-- This is to pick up Doc Content -->               <xsl:call-template name="docContent" >                  <xsl:with-param name="docContentNode" select="$documentNodes/DocumentContent"/>               </xsl:call-template>             </xsl:template> </xsl:stylesheet>
--------------------------------------------------------------------------------This is the document content xsl:
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"    version="1.0"    xmlns:xalan="http://xml.apache.org/xslt">    <xsl:include href="pageRange.xsl"/> <xsl:output method="html" encoding="iso-8859-1" indent="yes"/>        <xsl:template name="docContent" >           <xsl:param name="docContentNode"/>            <xsl:variable name="id" select="$docContentNode/id"/>             <xsl:choose>                  <xsl:when test="$id = null">                    <td><xsl:text>empty</xsl:text></td>                  </xsl:when>                  <xsl:when test="string-length($id)>0">                    <td><xsl:value-of select="$id"/></td>                  </xsl:when>                  <xsl:otherwise>                    <td><xsl:text>empty</xsl:text></td>                  </xsl:otherwise>             </xsl:choose>                             <xsl:variable name="contentdesc" select="$docContentNode/contentdesc"/>             <xsl:choose>                  <xsl:when test="$contentdesc = null">                    <td><xsl:text>empty</xsl:text></td>                  </xsl:when>                  <xsl:when test="string-length($contentdesc)>0">                    <td><xsl:value-of select="$contentdesc"/></td>                  </xsl:when>                  <xsl:otherwise>                    <td><xsl:text>empty</xsl:text></td>                  </xsl:otherwise>             </xsl:choose>                                       <!-- This is to get page ranges -->            <xsl:apply-templates mode="docContentPages" />                                   <xsl:variable name="securedflg" select="$docContentNode/securedflg"/>             <xsl:choose>                  <xsl:when test="$securedflg = null">                    <td><xsl:text>empty</xsl:text></td>                  </xsl:when>                  <xsl:when test="string-length($securedflg)>0">                    <td><xsl:value-of select="$securedflg"/></td>                  </xsl:when>                  <xsl:otherwise>                    <td><xsl:text>empty</xsl:text></td>                  </xsl:otherwise>             </xsl:choose>              <xsl:variable name="taskid" select="$docContentNode/taskid"/>             <xsl:choose>                  <xsl:when test="$taskid = null">                    <td><xsl:text>empty</xsl:text></td>                  </xsl:when>                  <xsl:when test="string-length($taskid)>0">                    <td><xsl:value-of select="$taskid"/></td>                  </xsl:when>                  <xsl:otherwise>                    <td><xsl:text>empty</xsl:text></td>                  </xsl:otherwise>             </xsl:choose>    </xsl:template> </xsl:stylesheet>
--------------------------------------------------------------------------------This is the page range xsl
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"    version="1.0"    xmlns:xalan="http://xml.apache.org/xslt">     <xsl:output method="html" encoding="iso-8859-1" indent="yes"/>     <xsl:template mode="docPages" match="Document/pagerange">                    <xsl:variable name="begpage1" select="begpage"/>                <xsl:choose>                   <xsl:when test="$begpage1 = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($begpage1)>0">                     <td><xsl:value-of select="$begpage1"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>           </xsl:choose>           <xsl:variable name="endpage1" select="endpage"/>                <xsl:choose>                   <xsl:when test="$endpage1 = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($endpage1)>0">                     <td><xsl:value-of select="$endpage1"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>           </xsl:choose>            <xsl:variable name="pagetotal1" select="pagetotal"/>                <xsl:choose>                   <xsl:when test="$pagetotal1 = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($pagetotal1)>0">                     <td><xsl:value-of select="$pagetotal1"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>           </xsl:choose>    </xsl:template>         <xsl:template mode="docContentPages" match="DocumentContent/pagerange">                    <xsl:variable name="begpage2" select="begpage"/>                <xsl:choose>                   <xsl:when test="$begpage2 = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($begpage2)>0">                     <td><xsl:value-of select="$begpage2"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>           </xsl:choose>           <xsl:variable name="endpage2" select="endpage"/>                <xsl:choose>                   <xsl:when test="$endpage2 = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($endpage2)>0">                     <td><xsl:value-of select="$endpage2"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>           </xsl:choose>            <xsl:variable name="pagetotal2" select="pagetotal"/>                <xsl:choose>                   <xsl:when test="$pagetotal2 = null">                      <td><xsl:text>empty</xsl:text></td>                   </xsl:when>                   <xsl:when test="string-length($pagetotal2)>0">                     <td><xsl:value-of select="$pagetotal2"/></td>                   </xsl:when>                   <xsl:otherwise>                     <td><xsl:text>empty</xsl:text></td>                   </xsl:otherwise>           </xsl:choose>    </xsl:template>  </xsl:stylesheet>
--------------------------------------------------------------------------------This is the original xml:
<?xml version="1.0" encoding="UTF-8"?> <Documents>   <count>1</count> <Document>     <id>1</id>    <docid>d0609080.003</docid>     <createdate>2006-09-08</createdate>     <createtime>10:17:53</createtime>     <mailinfo>          <maildesc>REPORT</maildesc>          <mailid>C:\PROGRAM FILES\CLIENT\EMS\PAYREJ.TXT</mailid>     </mailinfo>    <pagerange>       <begpage>1</begpage>       <endpage>10</endpage>       <pagetotal>10</pagetotal>    </pagerange>    <wrkstnid>piinit</wrkstnid>    <filesize>0.0</filesize>     <pidoctype>TEXT</pidoctype>    <DocumentContent>       <id>1</id>       <contentdesc>split</contentdesc>       <pagerange>          <begpage>1</begpage>          <endpage>5</endpage>          <pagetotal>10</pagetotal>       </pagerange>       <securedflg>N</securedflg>       <taskid>t0609300001</taskid>    </DocumentContent> </Document> </Documents>
--------------------------------------------------------------------------------This is the html produced:
<html lang="en" xmlns:xalan="http://xml.apache.org/xslt"><body><h2>Document Details</h2><h3>Total Documents:1</h3><table border="1" cellpadding="5"><tr><td><b>Sequence</b></td><td><b>DocumentId</b></td><td><b>Create Date</b></td><td><b>Create Time</b></td><td><b>Create Operator</b></td><td><b>ExternalDocKey</b></td><td><b>ExternalSysName</b></td><td><b>Mail Desc</b></td><td><b>Mail Id</b></td><td><b>ArchBoxId</b></td><td><b>MagFldName</b></td><td><b>MagFlg</b></td><td><b>Fax Nbr</b></td><td><b>Begin Page</b></td><td><b>End Page</b></td><td><b>PageTotal</b></td><td><b>WrkStnId</b></td><td><b>File Size</b></td><td><b>File Type</b></td><td><b>PiDocType</b></td><td><b>Annotation</b></td><td><b>Doc Content Seq</b></td><td><b>Doc Content Desc</b></td><td><b>Begin Page</b></td><td><b>End Page</b></td><td><b>PageTotal</b></td><td><b>Secure Flag</b></td><td><b>TaskId</b></td></tr><tr><td>1</td><td>d0609080.003</td><td>2006-09-08</td><td>10:17:53</td><td>empty</td><td>empty</td><td>empty</td><td>REPORT</td><td>C:\PROGRAM FILES\CLIENT\EMS\PAYREJ.TXT</td><td>empty</td><td>empty</td><td>empty</td><td>empty</td>   1      1    d0609080.003     2006-09-08     10:17:53               REPORT          C:\PROGRAM FILES\CLIENT\EMS\PAYREJ.TXT         <td>1</td><td>10</td><td>10</td>    piinit    0.0     TEXT           1       split                 1          5          10              N       t0609300001      <td>piinit</td><td>0.0</td><td>empty</td><td>TEXT</td><td>empty</td><td>1</td><td>split</td>   1      1    d0609080.003     2006-09-08     10:17:53               REPORT          C:\PROGRAM FILES\CLIENT\EMS\PAYREJ.TXT                1       10       10        piinit    0.0     TEXT           1       split       <td>1</td><td>5</td><td>10</td>       N       t0609300001      <td>N</td><td>t0609300001</td></tr></table></body></html>
--------------------------------------------------------------------------------I think you can see from the information it's just short of being right......
Thanks for reading my post and for any positive comments/encouragements you can provide.
Russ

Yes, just add the secondary file, BUT make sure the size is equal to the primary data file.
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • Adding new date field to already loaded data target.

    Hi,
        we have a cube containing date feild such as 0CALMONTH. the data is being loaded to the cube. now they have added new date feild (0FISCYEAR). how to get data to this feild. there is no data coming from source system for this feild. please can any one tell me how to include this feild and load data into it.
    with regards,
    sreekanth.

    Sreekanth,
       If Record creation date is the right field for deriving fiscal year, Why cant you derive the year from the date...by using automatioc time conversion...?? In update rules...??
      For exising data, you can do loop back to populate the data. see the below doc, for more info:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f421c86c-0801-0010-e88c-a07ccdc69601
    Hope it Helps
    Srini
    Message was edited by: Srini

  • Data Guard adding new data files to a tablespace.

    In the past, if you were manually updating an Oracle physical standby database there were issues with adding a data file to a tablespace. It was suggested that the data file should be created small and then the small physical file copied to the standby database. Once the small data file was in place it would be resized on the primary database then the repication would change the size on the standby.
    My question is, does Data Guard take care of this automaticlly for a physical standby? I can't find any specific reference on how it handles a new datafile.

    Never mind, I found the answer.
    STANDBY_FILE_MANAGEMENT=auto
    Set on the standby database will create the datafiles.

  • TableSorter errors when adding new data

    so here is the deal:
    I am using the TableSorter.java helper class with DefaultTableModel
    from: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    It works great when the data is static and I get it for the first time. however, occationally, when adding new data I get a NullPointerException error.
    in use:
    DefaultTableModel.addRow()
    DefaultTableModel.removeRow() and
    DefaultTableModel.insertRow() methods.
    Error:
    java.lang.ArrayIndexOutOfBoundsException: 5
         at com.shared.model.TableSorter.modelIndex(TableSorter.java:294)
         at com.shared.model.TableSorter.getValueAt(TableSorter.java:340)
         at javax.swing.JTable.getValueAt(Unknown Source)
         at javax.swing.JTable.prepareRenderer(Unknown Source)...
    code problem I:
        public Object getValueAt(int row, int column)
            return tableModel.getValueAt(modelIndex(row), column);
        }code problem II:
        public int modelIndex(int viewIndex)
                 return getViewToModel()[viewIndex].modelIndex;     
        }TableSroter class:
    package com.shared.model;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.List;
    import javax.swing.*;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.*;
    * TableSorter is a decorator for TableModels; adding sorting
    * functionality to a supplied TableModel. TableSorter does
    * not store or copy the data in its TableModel; instead it maintains
    * a map from the row indexes of the view to the row indexes of the
    * model. As requests are made of the sorter (like getValueAt(row, col))
    * they are passed to the underlying model after the row numbers
    * have been translated via the internal mapping array. This way,
    * the TableSorter appears to hold another copy of the table
    * with the rows in a different order.
    * <p/>
    * TableSorter registers itself as a listener to the underlying model,
    * just as the JTable itself would. Events recieved from the model
    * are examined, sometimes manipulated (typically widened), and then
    * passed on to the TableSorter's listeners (typically the JTable).
    * If a change to the model has invalidated the order of TableSorter's
    * rows, a note of this is made and the sorter will resort the
    * rows the next time a value is requested.
    * <p/>
    * When the tableHeader property is set, either by using the
    * setTableHeader() method or the two argument constructor, the
    * table header may be used as a complete UI for TableSorter.
    * The default renderer of the tableHeader is decorated with a renderer
    * that indicates the sorting status of each column. In addition,
    * a mouse listener is installed with the following behavior:
    * <ul>
    * <li>
    * Mouse-click: Clears the sorting status of all other columns
    * and advances the sorting status of that column through three
    * values: {NOT_SORTED, ASCENDING, DESCENDING} (then back to
    * NOT_SORTED again).
    * <li>
    * SHIFT-mouse-click: Clears the sorting status of all other columns
    * and cycles the sorting status of the column through the same
    * three values, in the opposite order: {NOT_SORTED, DESCENDING, ASCENDING}.
    * <li>
    * CONTROL-mouse-click and CONTROL-SHIFT-mouse-click: as above except
    * that the changes to the column do not cancel the statuses of columns
    * that are already sorting - giving a way to initiate a compound
    * sort.
    * </ul>
    * <p/>
    * This is a long overdue rewrite of a class of the same name that
    * first appeared in the swing table demos in 1997.
    * @author Philip Milne
    * @author Brendon McLean
    * @author Dan van Enckevort
    * @author Parwinder Sekhon
    * @version 2.0 02/27/04
    public class TableSorter extends AbstractTableModel
        protected TableModel tableModel;
        public static final int DESCENDING = -1;
        public static final int NOT_SORTED = 0;
        public static final int ASCENDING = 1;
        private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
        public static final Comparator COMPARABLE_COMAPRATOR = new Comparator()
            public int compare(Object o1, Object o2)
                return ((Comparable) o1).compareTo(o2);
        public static final Comparator LEXICAL_COMPARATOR = new Comparator()
            public int compare(Object o1, Object o2)
                return o1.toString().compareTo(o2.toString());
        private Row[] viewToModel;
        private int[] modelToView;
        private JTableHeader tableHeader;
        private MouseListener mouseListener;
        private TableModelListener tableModelListener;
        private Map columnComparators = new HashMap();
        private List sortingColumns = new ArrayList();
        public TableSorter()
            this.mouseListener = new MouseHandler();
            this.tableModelListener = new TableModelHandler();
        public TableSorter(TableModel tableModel)
            this();
            setTableModel(tableModel);
        public TableSorter(TableModel tableModel, JTableHeader tableHeader)
            this();
            setTableHeader(tableHeader);
            setTableModel(tableModel);
        private void clearSortingState()
            viewToModel = null;
            modelToView = null;
        public TableModel getTableModel()
            return tableModel;
        public void setTableModel(TableModel tableModel)
            if (this.tableModel != null)
                this.tableModel.removeTableModelListener(tableModelListener);
            this.tableModel = tableModel;
            if (this.tableModel != null)
                this.tableModel.addTableModelListener(tableModelListener);
            clearSortingState();
            fireTableStructureChanged();
        public JTableHeader getTableHeader()
            return tableHeader;
        public void setTableHeader(JTableHeader tableHeader)
            if (this.tableHeader != null)
                this.tableHeader.removeMouseListener(mouseListener);
                TableCellRenderer defaultRenderer = this.tableHeader.getDefaultRenderer();
                if (defaultRenderer instanceof SortableHeaderRenderer)
                    this.tableHeader.setDefaultRenderer(((SortableHeaderRenderer) defaultRenderer).tableCellRenderer);
            this.tableHeader = tableHeader;
            if (this.tableHeader != null)
                this.tableHeader.addMouseListener(mouseListener);
                this.tableHeader.setDefaultRenderer
                        new SortableHeaderRenderer(this.tableHeader.getDefaultRenderer())
        public boolean isSorting()
            return sortingColumns.size() != 0;
        private Directive getDirective(int column)
            for (int i = 0; i < sortingColumns.size(); i++)
                Directive directive = (Directive)sortingColumns.get(i);
                if (directive.column == column)
                    return directive;
            return EMPTY_DIRECTIVE;
        public int getSortingStatus(int column)
            return getDirective(column).direction;
        private void sortingStatusChanged()
            clearSortingState();
            fireTableDataChanged();
            if (tableHeader != null)
                tableHeader.repaint();
        public void setSortingStatus(int column, int status)
            Directive directive = getDirective(column);
            if (directive != EMPTY_DIRECTIVE)
                sortingColumns.remove(directive);
            if (status != NOT_SORTED)
                sortingColumns.add(new Directive(column, status));
            sortingStatusChanged();
        protected Icon getHeaderRendererIcon(int column, int size)
            Directive directive = getDirective(column);
            if (directive == EMPTY_DIRECTIVE)
                return null;
            return new Arrow(directive.direction == DESCENDING, size, sortingColumns.indexOf(directive));
        private void cancelSorting()
            sortingColumns.clear();
            sortingStatusChanged();
        public void setColumnComparator(Class type, Comparator comparator)
            if (comparator == null)
                columnComparators.remove(type);
            else
                columnComparators.put(type, comparator);
        protected Comparator getComparator(int column)
            Class columnType = tableModel.getColumnClass(column);
            Comparator comparator = (Comparator) columnComparators.get(columnType);
            if (comparator != null)
                return comparator;
            if (Comparable.class.isAssignableFrom(columnType))
                return COMPARABLE_COMAPRATOR;
            return LEXICAL_COMPARATOR;
        private Row[] getViewToModel()
            if (viewToModel == null)
                int tableModelRowCount = tableModel.getRowCount();
                viewToModel = new Row[tableModelRowCount];
                for (int row = 0; row < tableModelRowCount; row++)
                    viewToModel[row] = new Row(row);
                if (isSorting())
                    Arrays.sort(viewToModel);
            return viewToModel;
        public int modelIndex(int viewIndex)
                 return getViewToModel()[viewIndex].modelIndex;     
        private int[] getModelToView()
            if (modelToView == null)
                int n = getViewToModel().length;
                modelToView = new int[n];
                for (int i = 0; i < n; i++)
                    modelToView[modelIndex(i)] = i;
            return modelToView;
        // TableModel interface methods
        public int getRowCount()
            return (tableModel == null) ? 0 : tableModel.getRowCount();
        public int getColumnCount()
            return (tableModel == null) ? 0 : tableModel.getColumnCount();
        public String getColumnName(int column)
            return tableModel.getColumnName(column);
        public Class getColumnClass(int column)
            return tableModel.getColumnClass(column);
        public boolean isCellEditable(int row, int column)
            return tableModel.isCellEditable(modelIndex(row), column);
        public Object getValueAt(int row, int column)
            return tableModel.getValueAt(modelIndex(row), column);
        public void setValueAt(Object aValue, int row, int column)
            tableModel.setValueAt(aValue, modelIndex(row), column);
        // Helper classes
        private class Row implements Comparable
            private int modelIndex;
            public Row(int index)
                this.modelIndex = index;
            public int compareTo(Object o)
                int row1 = modelIndex;
                int row2 = ((Row) o).modelIndex;
                for (Iterator it = sortingColumns.iterator(); it.hasNext();)
                    Directive directive = (Directive) it.next();
                    int column = directive.column;
                    Object o1 = tableModel.getValueAt(row1, column);
                    Object o2 = tableModel.getValueAt(row2, column);
                    int comparison = 0;
                    // Define null less than everything, except null.
                    if (o1 == null && o2 == null)
                        comparison = 0;
                    } else if (o1 == null)
                        comparison = -1;
                    } else if (o2 == null)
                        comparison = 1;
                    } else {
                        comparison = getComparator(column).compare(o1, o2);
                    if (comparison != 0)
                        return directive.direction == DESCENDING ? -comparison : comparison;
                return 0;
        private class TableModelHandler implements TableModelListener
            public void tableChanged(TableModelEvent e)
                // If we're not sorting by anything, just pass the event along.            
                if (!isSorting())
                    clearSortingState();
                    fireTableChanged(e);
                    return;
                // If the table structure has changed, cancel the sorting; the            
                // sorting columns may have been either moved or deleted from            
                // the model.
                if (e.getFirstRow() == TableModelEvent.HEADER_ROW)
                    cancelSorting();
                    fireTableChanged(e);
                    return;
                // We can map a cell event through to the view without widening            
                // when the following conditions apply:
                // a) all the changes are on one row (e.getFirstRow() == e.getLastRow()) and,
                // b) all the changes are in one column (column != TableModelEvent.ALL_COLUMNS) and,
                // c) we are not sorting on that column (getSortingStatus(column) == NOT_SORTED) and,
                // d) a reverse lookup will not trigger a sort (modelToView != null)
                // Note: INSERT and DELETE events fail this test as they have column == ALL_COLUMNS.
                // The last check, for (modelToView != null) is to see if modelToView
                // is already allocated. If we don't do this check; sorting can become
                // a performance bottleneck for applications where cells 
                // change rapidly in different parts of the table. If cells
                // change alternately in the sorting column and then outside of            
                // it this class can end up re-sorting on alternate cell updates -
                // which can be a performance problem for large tables. The last
                // clause avoids this problem.
                int column = e.getColumn();
                if (e.getFirstRow() == e.getLastRow()
                        && column != TableModelEvent.ALL_COLUMNS
                        && getSortingStatus(column) == NOT_SORTED
                        && modelToView != null)
                    int viewIndex = getModelToView()[e.getFirstRow()];
                    fireTableChanged(new TableModelEvent(TableSorter.this,
                                                         viewIndex, viewIndex,
                                                         column, e.getType()));
                    return;
                // Something has happened to the data that may have invalidated the row order.
                clearSortingState();
                fireTableDataChanged();
                return;
        private class MouseHandler extends MouseAdapter
            public void mouseClicked(MouseEvent e)
                JTableHeader h = (JTableHeader) e.getSource();
                TableColumnModel columnModel = h.getColumnModel();
                int viewColumn = columnModel.getColumnIndexAtX(e.getX());
                int column = columnModel.getColumn(viewColumn).getModelIndex();
                if (column != -1)
                    int status = getSortingStatus(column);
                    if (!e.isControlDown())
                        cancelSorting();
                    // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
                    // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed.
                    status = status + (e.isShiftDown() ? -1 : 1);
                    status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
                    setSortingStatus(column, status);
        private static class Arrow implements Icon
            private boolean descending;
            private int size;
            private int priority;
            public Arrow(boolean descending, int size, int priority)
                this.descending = descending;
                this.size = size;
                this.priority = priority;
            public void paintIcon(Component c, Graphics g, int x, int y)
                Color color = c == null ? Color.GRAY : c.getBackground();            
                // In a compound sort, make each succesive triangle 20%
                // smaller than the previous one.
                int dx = (int)(size/2*Math.pow(0.8, priority));
                int dy = descending ? dx : -dx;
                // Align icon (roughly) with font baseline.
                y = y + 5*size/6 + (descending ? -dy : 0);
                int shift = descending ? 1 : -1;
                g.translate(x, y);
                // Right diagonal.
                g.setColor(color.darker());
                g.drawLine(dx / 2, dy, 0, 0);
                g.drawLine(dx / 2, dy + shift, 0, shift);
                // Left diagonal.
                g.setColor(color.brighter());
                g.drawLine(dx / 2, dy, dx, 0);
                g.drawLine(dx / 2, dy + shift, dx, shift);
                // Horizontal line.
                if (descending) {
                    g.setColor(color.darker().darker());
                } else {
                    g.setColor(color.brighter().brighter());
                g.drawLine(dx, 0, 0, 0);
                g.setColor(color);
                g.translate(-x, -y);
            public int getIconWidth()
                return size;
            public int getIconHeight()
                return size;
        private class SortableHeaderRenderer implements TableCellRenderer
            private TableCellRenderer tableCellRenderer;
            public SortableHeaderRenderer(TableCellRenderer tableCellRenderer)
                this.tableCellRenderer = tableCellRenderer;
            public Component getTableCellRendererComponent(JTable table,
                                                           Object value,
                                                           boolean isSelected,
                                                           boolean hasFocus,
                                                           int row,
                                                           int column)
                Component c = tableCellRenderer.getTableCellRendererComponent(table,
                        value, isSelected, hasFocus, row, column);
                if (c instanceof JLabel) {
                    JLabel l = (JLabel) c;
                    l.setHorizontalTextPosition(JLabel.LEFT);
                    int modelColumn = table.convertColumnIndexToModel(column);
                    l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize()));
                return c;
        private static class Directive
            private int column;
            private int direction;
            public Directive(int column, int direction)
                this.column = column;
                this.direction = direction;
    }any input will be appreciated.
    thanks
    Peter

    The code you posted doesn't help us at all. Its just a duplicate of the code from the tutorial. The custom code is what you have written. For example do you update the TableModel from the Event Thread? Do you update the SortModel or the DefaultTableModel? If you actually provide your test code and somebody has already downloaded the sort classes, then maybe they will test your code against the classes. But I doubt if people will download the sort classes and create a test program just to see if they can duplicate your results (at least I know I'm not about to).

  • Event times adding a date

    I have a G5, a laptop and an iPhone being sync'd with MobileMe. The iPhone is new last week. I have been sync'ing the two computers via MobileMe for a few months.
    Yesterday I noticed on the MacBook in iCal that all the event start and stop times had a date added after the normal date and time. Like this: "10/13/2009 0915 AM 10/13/20"
    The "10/13/20" at the end is the new thing. It now shows in all the events for start and stop times.
    Under iCal Preferences there is also a new date added after the "Day Starts/Stops At"
    Like this: "6:00 AM 1/1/00" Not sure where the "1/1/00" comes from or what it indicates (the beginning of time?)
    I can't remove these dates.
    The G5 and the iPhone seemed to be fine for awhile until I got a message on the G5 that said that MobileMe wants to change 1200 events in the G5 iCal. I think the MobileMe Cloud now reflects the messed up MacBook and is trying to make the G5 read the same. I turned off all sync'ing of iCal via MobileMe.
    I researched the support site to see if this problem has been reported in the past. Found a lot of stuff but nothing that is the same.
    I do not see any other strange happenings in the MacBook iCal, just the extra dates. There may be some; but I haven't seen them yet.
    Has anyone seen this? Has anyone have a fix or an idea of what to do to remove the extra dates?
    Thanks for your help.
    John

    I would like to drag this question back into the light after a holiday weekend. I'm hoping someone out there can give me a new lead to follow. I have tried everything.
    I restored all the data on my computer with a backup that was 4 months old. When I opened iCal the data all had the extra date info added to every event. It was the same.
    Either the problem has been there for quite awhile (the laptop is not the principle computer for inputting events; the G5 is) or the problem is something in the MacBook OS that is adding the date info every time you insert a time (since it shows in each event and also in the preferences beside every start/stop time) or it is related only to the Intel MacBook and not to the Power PC G5.
    I am out of ideas.
    Any help? Thanks,
    John

  • Help adding current Date and Time stamp to file name

    I need help with my script adding current Date and Time stamp to file name.
    This is my file name = myfile.htm
    I would like to save it as = myfile.htm 8/29/2007 11:41 AM
    This is my script:
    <script>
    function doSaveAs(){
         if (document.execCommand){
              document.execCommand('SaveAs','1','myfile.htm')
         else {
              alert("Save-feature available only in Internet Exlorer 5.x.")
    </script>
    <form>
    <input type="button" value="Click here to Save this page for your record" onClick="doSaveAs()"
    </form>
    Thank you

    I agree, I guess I overlooked that!
    I would like to save it as = myfile 8/29/2007 11:41 AM .htm
    I need help with my script adding current Date and Time stamp to file name.
    This is my file name = myfile.htm
    I would like to save it as = myfile 8/29/2007 11:41 AM .htm
    This is my script:
    <script>
    function doSaveAs(){
    if (document.execCommand){
    document.execCommand('SaveAs','1','myfile.htm')
    else {
    alert("Save-feature available only in Internet Exlorer 5.x.")
    </script>
    <form>
    <input type="button" value="Click here to Save this page for your record" onClick="doSaveAs()"
    </form>

  • Adding a Date Field to a Report Painter

    Hi,
    Could someone please throw light on adding a date field (for example, scheduled finish date of network) to a report painter report? I don't think this field (or any date field for that matter) is available as a characteristic for report painter.

    Hi Mahesh,
    i'm in the process of making a similar change,
    copying to a ZPROGRAM is not so difficult, but as i told you you have to add your new field to VBMTV structure, and copy the includes that you need to change,
    P.S. Note, when you copy you have to change some SELECT statements where
    it's selecting from T180V table based on sy-repid, you hav to change sy-repid to SAPMV75A, as there's some configuration done for this.
    Regards,
    Raghavendra

  • BRFplus: Adding Intermediate Data Objects to Expression Workarea

    Hi all,
    running BRFplus on NW 70105.
    I have a Step Sequence Expression with multiple steps calling various Functions.  Some of the Functions return intermediate results which must be stored in the context workarea.
    I would like to add these Data Objects to the workarea.  However the system will not allow me to do this without first adding the Data Objects as signature parameters of the calling Function, even though this does not make sense for intermediate values.
    Clicking the "Add existing Data Object" button for the workarea only allows me to add Data Objects which are in the context of the calling Function.
    Conversely if a Data Object is deleted from the calling Function's signature, then when checked the Function issues error message "Assigned expression uses Element CUSTOMER/Customer which is not in the context".
    Is the requirement to add all Expression workarea Data Objects to the calling Function's signature intended, or is this a bug ?  Or is there some other way of doing it that I am missing ??
    Thanks & regards,
    Grogan

    This is a restriction in NW 701. This restriction is removed in NW 702.

  • I've imported PowerBI designer file. so why do I keep getting 'It looks like you haven't added any data to this dashboard'

    This might be related to my post about not being able to enter a column name in the where clause, and Q&A always using COUNTRY_OF_ORIGIN.
    Anyway, I took my original designer file, removed the first page of the report I dd, then added a new page, but this time with a visualisation of sales amount by product name.  Saved the whole lot to a new pbix file, and uploaded it into the PowerBI
    cloud.  Pinned the visualsation to a dashboard, and started to enter a query.
    Up pops the message 'It looks like you haven't added any data to this dashboard' etc, etc.
    But, but, but I have uploaded the data. It's all in my pbix file. It seems that PowerBI usese the first column of my first dataset as the master for column names in the where clause. And if you do not have a visualisation that uses that column (i.e. COUNTRY_OF_ORIGIN
    in my case) then Q&A doesn't think it has a dataset.
    I am going to try some other tests to see if I can persuade PowerBI and Q&A to do its business properly.
    Angus

    The reset will not erase the virus but the reset can be done up to you.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • Problems adding Bridge Data to prepaid (Allset) iPhone5

    Anyone having problems trying to add bridge data to a prepaid (Allset) phone. I've tried to add 3GB to my iPhone 5 all day today and I've had no success. I've tried doing through (1) the new My Verizon Mobile App, (2) dialing *611 and following the prompts and (3) on my PC while logged into my "My Verizon" account. All three methods result in a "system error" and I can't add any bridge data. The only thing that worked, was it allowed me to put $25 on account by charging my credit card. So now I've been taken for $25 and can't do anything with the money on now have in my account. A call to customer service was a complete waste of time. The CSR told me to do the *228 Activation code on my 4G LTE iPhone 5. I'm not a CSR and I know you don't use *228 on an a 4G iPhone! After wasting 30 minutes and being told my SIM card "had to age" (very creative), I got tired of the snow job and hung up. Is anyone else having problems adding bridge data? Please advise if you have succeeded in adding bridge data today.

    Why have a Prepaid forum that is not monitored by CSR's who can actually do something about the issues posted by Prepaid customers? I'm not looking for a "sorry to hear about your problem" reply, I'm looking for answers/solutions. 
    What a ridiculous arrangement. This Prepaid sub-forum should be deleted so customers don't waste their time posting problems here.
    Sent from my iPad

  • Negative Signs added after data is imported

    Hello
    I'm kind of new in BPC to start, but I need to know why is that after the data is imported into BPC (using transformation and conversion files) the data has the negative(-) inserted on all the data.
    After doing the import, I verified the transformation file  and the output generated is without the negative, but after it's imported the negative is added.
    Here's my transformation file...
    *OPTIONS
    FORMAT = DELIMITED
    HEADER = YES
    DELIMITER = ,
    SKIP = 0
    SKIPIF =
    VALIDATERECORDS=YES
    CREDITPOSITIVE=NO
    MAXREJECTCOUNT=
    ROUNDAMOUNT=
    SPECIFICMAPPING= YES
    *MAPPING
    *CONVERSION
    ACCOUNTBENCH=CTA.xls!Conversion
    TIME=TME.xls!Conversion
    BENCHENTITY=Banco.xls!Conversion
    Any help or comment will be appreciated.

    España Rodrigo Gabriel,
    The "-" signs are depends on accouynt type, Account Type "AST" and "LEQ" has logic in BPC to manage the signes. You will have to manage the imported data to make sure it works right with the account type.
    Hope this helps.
    Sam

  • Adding New Data To Same Page - HELP

    I am trying to put together a invoice on the fly, the products are added to the invoice by selecting the disired product from a drop down menu and hitting the add button. You SHOULD then be able to select more products from the same drop down menu and htting add again will include it in the invoice.... simple?? Well the problem i have is that when i hit the add button to add another item it just replaces the one i have already added.... this is very annoying... i cannot think of a way to take the product data through the form submission ready for adding too.
    Any Ideas this is really bugging me, and the more time i spend on it, the worse its getting. Code Below
    <%@ page buffer="32kb" %>
    <%@ page import="java.sql.*, javax.servlet.ServletException, java.io.IOException, com.stock_control.*" %>
    <%!
    String convertResultsToSelect ( ResultSet rs, String selectName, String idCol, String descCol ) throws SQLException
    StringBuffer sb = new StringBuffer ( "<select name=" + selectName +">" );
    if (rs != null) {
    while (rs.next()) {
              sb.append ( "<option value=" );
    sb.append ( rs.getString(idCol) );
    sb.append ( ">" );
    sb.append ( rs.getString(descCol) );
    sb.append ( "</option>" );
    sb.append ( "</select>" );
    return sb.toString ();
    %>
    <html>
    <head>
    <title>Members Area - Stock Check</title>
    </head>
    <body bgcolor="#CCCCCC" topmargin="0">
    <%@ include file="topConn.jsp" %>
    <%
              String msg = "";
              String name = "";
              String address1 = "";
              String address2 = "";
              String town ="";
              String postcode = "";
              String country = "";
              String phone = "";
              String mail = "";
              String comments = "";
              float total = 0;
              int nextFree = 0;
              String prodResults;
              int numberOfItems = 0;
         String shop = (String)session.getValue("SHOP");
         String selectProd = "SELECT ProductID, ProductName FROM product WHERE ShopID=";
         rs1 = stmt.executeQuery(selectProd+shop);
         prodResults = convertResultsToSelect( rs1, "product","ProductID","ProductName");
         rs = stmt.executeQuery("SELECT COUNT(*) AS stockLevel FROM product WHERE ShopID ="+shop);     
    while(rs.next())
         numberOfItems = rs.getInt("stockLevel");
         Product[] products = new Product[numberOfItems];
    if (request.getParameter("add")!=null)
              // get values from all text boxes....
              name = request.getParameter("name");
              address1 = request.getParameter("address1");
              address2 = request.getParameter("address2");
              town = request.getParameter("town");
              postcode = request.getParameter("postcode");
              country = request.getParameter("country");
              phone = request.getParameter("phone");
              mail = request.getParameter("mail");
              comments = request.getParameter("comments");
                   // add data from dropdown
              String newProduct = request.getParameter("product");
              //connect to database and put product data into array + increment
                   int thenewid = 0;
                   String theName = "";
                   float thePrice = 0;
                   String nono = "0";
              String getProd = "SELECT * FROM product WHERE ProductID=";
              rs = stmt.executeQuery(getProd+newProduct);
              if(rs.next())
                   thenewid = Integer.parseInt(newProduct);
                   theName = rs.getString("ProductName");
                   thePrice = rs.getFloat("SalePrice");
                   Product addProduct = new Product(thenewid, theName, thePrice, nono);
                   products[nextFree] = addProduct; //PROBLEM
                   nextFree++;
    // reload page with new data in form
    //for loop arround array     
    %>
    <form method="GET">
    <div align=center>
    <p>
    <%=prodResults%>
    <input type="submit" value="Add" name="add"></p>
    <TABLE width=100% height="1">
    <TBODY>
    <tr>
    <td width="4%" height="19"> </td>
    <td width="96%" height="19"> 
    </td>
    </tr>
    <tr>
    <td width="4%" height="198"> </td>
    <td width="96%" height="198">
    <div align="center"></div>
    <table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber5">
    <tr>
    <td width="4%"> </td>
    <td width="15%"><font face="Verdana" size="2">Customer Name</font></td>
    <td width="30%"><input type="text" name="name" size="30" value="<%=name%>"></td>
    <td width="19%"><font face="Verdana" size="2">Customer Phone #</font></td>
    <td width="26%"><input name="phone" type="text" size="30" value="<%=phone%>"></td>
    <td width="6%"> </td>
    </tr>
    <tr>
    <td> </td>
    <td><font face="Verdana" size="2">Address Line 1</font></td>
    <td><input type="text" name="address1" size="40" value="<%=address1%>"></td>
    <td><font face="Verdana" size="2">Customer E-mail</font></td>
    <td><input name="mail" type="text" size="30" value="<%=mail%>"></td>
    <td> </td>
    </tr>
    <tr>
    <td height="32"> </td>
    <td><font face="Verdana" size="2">Address Line 2</font></td>
    <td> </td>
    <td><font face="Verdana" size="2">Comments</font></td>
    <td width="26%" rowspan="5"><p>
    <textarea name="comments" cols="29" rows="5"><%=comments%></textarea>
    </p>
    <p>  </p></td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td><font size="2" face="Verdana">Town/City</font></td>
    <td><input name="town" type="text" size="40" value="<%=town%>">
    <input name="address2" type="text" size="40" value="<%=address2%>"></td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td><font size="2" face="Verdana">Post Code</font></td>
    <td><input type="text" name="postcode" size="10" value="<%=postcode%>"></td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td><font size="2" face="Verdana">Country</font></td>
    <td><input type="text" name="country" size="40" value="<%=country%>"></td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td height="24"> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td height="23"> </td>
    <td><strong><font size="2" face="Verdana">Product Code</font></strong></td>
    <td><strong><font size="2" face="Verdana">Name</font></strong></td>
    <td><strong><font size="2" face="Verdana">Price</font></strong></td>
    <td> </td>
    <td> </td>
    </tr>
    <%
    if (request.getParameter("add")!=null)
    for(int i=0; i<nextFree; i++)
    Product temp = products;
    int prodID = temp.getid();
    String prodName = temp.getname();
    float prodPrice = temp.getprice();
    total = total + prodPrice;
    // work out total on the fly
    %>
    <tr>
    <td height="23"> </td>
    <td> <font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%=prodID%> </font></td>
    <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%=prodName%></font></td>
    <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">&pound;<%=prodPrice%></font></td>
    <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
    <td> </td>
    </tr>
    <%
    %>
    <tr>
    <td width="4%" height="23"> </td>
    <td width="15%"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
    <td width="30%"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
    <td width="19%"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Total:</font></strong></td>
    <td width="26%"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%=total%></font></td>
    <td width="6%"> </td>
    </tr>
    </table>
    <p align="center">
    <input type="submit" value="Continue" name="continue">
              </form>
    </p>
    </td> </tr> </TBODY></table>
    <%@ include file="bottomConn.jsp" %>
    </body>
    </html>

    anyone?

  • Transform 3D to 2D Data via a Materialized View

    Hi,
    I'm playing with Geoserver against an Oracle Locator database. Things are starting well, but I did notice a bug where 3D points and lines are not supported. I guess this is an issue with GeoTools. Anybody have a way to transform my 3D data to 2D. Since I do use the 3rd dimension for storing elevation, I don't want to lose the data. So I was thinking that I could create materialized views to "virtually strip" the 3rd dimension. Any thoughts? I'm not very strong in PL/SQL, so any code hints would be greatly appreciated as well.
    Thanks!
    Jeff

    I would say the compiled pl/sql would be faster (it would also depend on whether you compiled to the pl/sql virtual machine code - MP-code or the machine-dependent code of the host's C compiler if you chose native copilation): I am coding a Java version of my GEOM.SDO_CENTROID function so will be in a better position to say, categorically, one way or the other.
    In my free pl/sql packages there are these functions in case anyone is interested:
       --  @function To_2D
       --  @precis   Converts a 3D geometry to a 2D geometry
       --  @version  2.0
       --  @usage    v_2D_geom := geom.To_2D(MDSYS.SDO_Geometry(3001,....)
       --  @history  Albert Godfrind, July 2006, Original Coding
       --  @history  Bryan Hall,      July 2006, Modified to handle points
       --  @history  Simon Greener,   July 2006, Integrated into geom with GF.
       Function To_2D( p_3D_geom IN MDSYS.SDO_Geometry )
         Return MDSYS.SDO_Geometry deterministic;
       --  @function To_3D
       --  @precis   Converts a 2D geometry to a 3D geometry
       --  @version  1.0
       --  @usage    v_3D_geom := geom.To_3D(MDSYS.SDO_Geometry(2001,....),50)
       --  @history  Simon Greener,   May 2007 Original coding
       Function To_3D( p_2D_geom   IN MDSYS.SDO_Geometry,
                       p_default_z IN NUMBER := NULL)
         Return MDSYS.SDO_Geometry deterministic;
       /** @Function : FIX_3D_Z
       **  @Precis   : Checks the Z ordinate in the SDO_GEOMETRY and if NULL changes to p_default_z value
       **  @Note     : Needed as MapServer appears to not handle 3003/3007 polygons with NULL Z values in the sdo_ordinate_array
       **  @History  : Simon Greener  -  JUNE 4th 2007  - Original Coding
       Function Fix_3D_Z( p_3D_geom   IN MDSYS.SDO_Geometry,
                          p_default_z IN NUMBER := -9999 )
                Return MDSYS.SDO_Geometry Deterministic;
      /** Function just to change a single point coded in sdo_ordinates to sdo_point representation
      * @param p_geometry  A sdo_geometry object.
      Function ToSdoPoint ( p_geometry in MDSYS.SDO_Geometry )
        return MDSYS.SDO_Geometry Deterministic;Simon

  • Adding new data row(s) to DataGrid control

    My requirement is to provide the ability to add a new row to
    the datagrid when tabbed out of the (last cell of the last row of
    the datagrid. I have made my datagrid editable and in the
    'itemEditEnd' handler I am adding a new object (with empty values)
    to the data provider for the Grid and setting focus to the Grid and
    then setting the new row index as the Selected Index for the Grid.
    None of this activating itemEditor for the first cell of the new
    row.
    I have seen somewhere that dispatching the itemEditBeginning
    will do this for me. But not sure how to do this. Appreciate if can
    point me to a sample woring example.

    Perfect - Have been looking for a solution since few days.
    You just made my day. Thank you so much.

  • Coredump when adding new data to a document

    Hi,
    I have managed to get a coredump when adding data to a document,
    initially using the Python API but I can reproduce it with a dbxml script.
    I am using dbxml-2.2.13 on RedHat WS 4.0.
    My original application reads XML data from files, and adds them
    one at a time to a DbXML document using XmlModify.addAppendStep
    and XmlModify.execute. At a particular document (call it "GLU.xml") it
    segfaults during the XmlModify.execute call. It is not malformed data in
    the file, because if I remove some files that are loaded at an earlier stage,
    GLU.xml is loaded quite happily and the segfault happens later. Changing
    my application so that it exits just before reading GLU.xml, and loading GLU.xml's
    data into the container file using the dbxml shell's "append" command produces
    the same segfault. The stacktrace is below. Steps #0 to #7 inclusive are the
    same as the stacktrace I got when using the Python API.
    Can anyone give me any suggestions? I could send the dbxml container file and
    dbxml script to anyone who would be prepared to take a look at this problem.
    Regards,
    Peter.
    #0  ~NsEventGenerator (this=0x9ea32f8) at NsEventGenerator.cpp:110
    110                     _freeList = cur->freeNext;
    (gdb) where
    #0  ~NsEventGenerator (this=0x9ea32f8) at NsEventGenerator.cpp:110
    #1  0x009cacef in DbXml::NsPullToPushConverter8::~NsPullToPushConverter8$delete ()
        at /scratch_bernoulli/pkeller/dbxml-2.2.13/install/include/xercesc/framework/XMLRefInfo.hpp:144
    #2  0x00a5d03c in DbXml::NsDocumentDatabase::updateContentAndIndex (this=0x96b7a60,
        new_document=@0x96e3608, context=@0x96a3fc8, stash=@0x96a4098) at ../scoped_ptr.hpp:44
    #3  0x009a71b1 in DbXml::Container::updateDocument (this=0x96a71d0, txn=0x0, new_document=@0x96e3608,
        context=@0x96a3fc8) at shared_ptr.hpp:72
    #4  0x009b8465 in UpdateDocumentFunctor::method (this=0xb7d3a008, container=@0x96a71d0, txn=0x0, flags=0)
        at TransactedContainer.cpp:167
    #5  0x009b70c5 in DbXml::TransactedContainer::transactedMethod (this=0x96a71d0, txn=0x0, flags=0,
        f=@0xbff66500) at TransactedContainer.cpp:217
    #6  0x009b71e4 in DbXml::TransactedContainer::updateDocument (this=0x96a71d0, txn=0x0,
        document=@0x96e3608, context=@0x96a3fc8) at TransactedContainer.cpp:164
    #7  0x009d7616 in DbXml::Modify::updateDocument (this=0x96c1748, txn=0x0, document=@0xbff665b0,
        context=@0xbff669dc, uc=@0xbff669e4)
        at /scratch_bernoulli/pkeller/dbxml-2.2.13/dbxml/build_unix/../dist/../include/dbxml/XmlDocument.hpp:72
    #8  0x009d9c18 in DbXml::Modify::execute (this=0x96c1748, txn=0x0, toModify=@0x96a7280,
        context=@0xbff669dc, uc=@0xbff669e4) at Modify.cpp:743
    #9  0x009c1c35 in DbXml::XmlModify::execute (this=0xbff666c0, toModify=@0x96a7280, context=@0xbff669dc,
        uc=@0xbff669e4) at XmlModify.cpp:128
    #10 0x08066bda in CommandException::~CommandException ()
    #11 0x0805f64e in CommandException::~CommandException ()
    #12 0x08050c82 in ?? ()
    #13 0x00705de3 in __libc_start_main () from /lib/tls/libc.so.6
    #14 0x0804fccd in ?? ()
    Current language:  auto; currently c++

    Hi George,
    I can get the coredump with the following XML data (cut down from its original
    size of around 900Kb):
    <file name="GLU.xml">
    <_StorageUnit time="Wed Apr  5 11:06:49 2006" release="1.0.212"
    packageName="ccp.ChemComp" root="tempData" originator="CCPN Python XmlIO">
    <parent>
      <key1 tag="molType">protein</key1>
      <key2 tag="ccpCode">GLU</key2>
    </parent>
    <StdChemComp ID="1" code1Letter="E" stdChemCompCode="GLU" molType="protein" ccpCode="GLU" code3Letter="GLU" msdCode="GLU_LFOH" cifCode="GLU" merckCode="12,4477">
      <name>GLUTAMIC ACID</name>
      <commonNames>L-glutamic acid</commonNames>
    </_StorageUnit>
    <!--End of Memops Data-->
    </file>This happens when the data from 106 other files have been inserted beforehand
    (ranging in size from 1Kb to 140Kb). If I manipulate the order so that the above data
    is loaded earlier in the sequence, it inserts fine and I get the coredump when
    loading data from a different file.
    The actual XmlModify calls look something like:
      qry = mgr.prepare("/datapkg/dir[@name='dir1']/dir[@name='dir2']", qc)
      mdfy.addAppendStep(qry, XmlModify.Element, "",
                         '<file name='" + fileName + '">' +
                          data[pos:] + "</file>")
      mdfy.execute(XmlValue(doc), qc, uc)where data[pos:] points to the location in the mmap-ed file containing the
    above data just after the <?xml ...?> header.
    If you want to try to reproduce the crash at your end there are a couple of ways
    we could do it. I have just figured out that this forum software doesn't let me
    upload files or reveal my e-mail address in my profile, but you can contact me with
    username: pkeller; domain name: globalphasing.com and I can send the
    data to you.
    Regards,
    Peter.

Maybe you are looking for

  • IE settings when using Oracle Forms

    Just because this information is really useful if you are having problems running forms in IE... 1. In the browser, select Tools > Internet Options > Advanced 2. Uncheck the box labeled "Reuse windows for launching shortcuts" 3. Check the box labeled

  • ISE posture based upon switch user is connected to

    OK, I am a new ISE user and definitely an early beginner on creating ISE policies. I have successfully created a policy that can determine if you are using a corporate asset or not and using 802.1x authentication grant you access to corporate resourc

  • How to promt user to save changes when changing non-database fields?

    Hi, I have a form with two tabs. The datablock Block_1 on tab_2 is based on a database view. But all the displayed items of Block_1 are non-database items. Whenever a user changes some items in Block_1 and presses save button, the values from non_db

  • Cut an object with the knife without adding new segment?

    If I use the knife to cut across a closed object, it creates two closed objects. What I would LIKE is to cut the object and have two open objects touching at the points of the cut. E.g., if I cut a square in half, I want two brackets touching at thei

  • Help! Broadcasting error "page can not be displayed"

    Dear all, I have a problem with our broadcasting in BW7. I've checked all the pameters in ICM, that is correct. I used RSBB_URL_PREFIX_GET to check HTTP server host and port settings, and also check for message server. The port of message server is 8