How to make only one column non reorderble

I want to make only one column (Column 0) of my JTable non reorderble.
I also want to make the same column non resizable and I want to give it a specific size.
Please help me on this?

I have implemented a RowHeaderTable class which displays 1, 2, 3, ... in the first column. The column is in the scrollpane's RowHeaderView, so it is not resizable nor reorderable. But its width can be set in your code. Maybe this is what you need.
Use the class the same way you use a JTable, except 3 added methods:
getScrollPane();
setMinRows(int r);
setRowHeaderWidth(int w);
Note: The table works perfectly in skinless L&F, such as the default java L&F. It looks ugly in Liquid L&F because I don't know how to steal column header's UI to use on a JList. If someone can help me on this one, I thank you in advance.
* RowHeaderTable.java
* Created on 2005-3-21
* Copyright (c) 2005 Jing Ding, All Rights Reserved.
* Permission to use, copy, modify, and distribute this software
* and its documentation for NON-COMMERCIAL purposes and without
* fee is hereby granted provided that this copyright notice
* appears in all copies.
* JING DING MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. JING DING
* SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT
* OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
import java.awt.BorderLayout;
import java.awt.Component;
import javax.swing.AbstractListModel;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListCellRenderer;
import javax.swing.UIManager;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
* @author Jing Ding
public class RowHeaderTable extends JTable {
  private int minRows = 10;                         // Minimum size of the row header.
  private static final int DEFAULT_WIDTH = 30;
  private JScrollPane jsp;
  // The row header is a JList with the same appearance as the column header.
  private JList rowHeader;
  // Repaint row header whenever the table inserts or deletes rows.
  private TableModelListener tmListener = new TableModelListener(){
    public void tableChanged(TableModelEvent e){
      if(e.getType() != TableModelEvent.UPDATE)
        rowHeader.repaint();
  /** Create a new instance of RowHeaderTable.
   * @param model
  public RowHeaderTable(TableModel model){
    setModel(model);
    initializeHeader();
    jsp = new JScrollPane(this);
    jsp.setRowHeaderView(rowHeader);
  private void initializeHeader(){
    rowHeader = new JList(new AbstractListModel(){
      public int getSize(){ return Math.max(getModel().getRowCount(), minRows); }
      public Object getElementAt(int index){ return "" + ++index; }
    setRowHeaderWidth(DEFAULT_WIDTH);
    rowHeader.setFixedCellHeight(getRowHeight());
    rowHeader.setCellRenderer(new TableRowHeaderRenderer());
  public void setRowHeaderWidth(int w){
    rowHeader.setFixedCellWidth(w);
  public void setMinRows(int m){ minRows = m; }
  public void setModel(TableModel model){
    super.setModel(model);
    model.addTableModelListener(tmListener);
  /**Use this method to get the scrollPane, instead of new JScrollPane(table).
   * @return
  public JScrollPane getScrollPane(){ return jsp; }
  protected class TableRowHeaderRenderer implements ListCellRenderer{
    TableCellRenderer colHeaderRenderer;
    public TableRowHeaderRenderer(){
      JTableHeader header = getTableHeader();
      TableColumn aColumn = header.getColumnModel().getColumn(0);
      colHeaderRenderer = aColumn.getHeaderRenderer();
      if(colHeaderRenderer == null)
        colHeaderRenderer = header.getDefaultRenderer();
    public Component getListCellRendererComponent(JList list, Object value,
        int index, boolean isSelected, boolean hasFocus){
      return colHeaderRenderer.getTableCellRendererComponent(
          RowHeaderTable.this, value, isSelected, hasFocus, -1, -1);
  public static void main(String[] args){
    try {
      UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");
    }catch (Exception e){ e.printStackTrace(); }
    String[] columnNames = {"First Name",
        "Last Name",
        "Sport",
        "# of Years",
        "Vegetarian"};
          Object[][] data = {
               {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)},
               {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)},
               {"Kathy", "Walrath", "Knitting", new Integer(2), new Boolean(false)},
               {"Sharon", "Zakhour", "Speed reading", new Integer(20), new Boolean(true)},
               {"Philip", "Milne", "Pool", new Integer(10), new Boolean(false)}
    DefaultTableModel dtm = new DefaultTableModel(data, columnNames);
    RowHeaderTable rht = new RowHeaderTable(dtm);
    rht.setMinRows(0);
    JFrame frame = new JFrame("RowHeaderTable Demo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(rht.getScrollPane(), BorderLayout.CENTER);
    frame.pack();
    frame.setVisible(true);
    dtm.addRow(new Object[]{"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)});
    dtm.addRow(new Object[]{"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)});
    dtm.addRow(new Object[]{"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)});
}

Similar Messages

  • How to make only one round corner?

    HI,
    How can I make only one (or 2) round corner on a square using the round corner effect?

    You don't say what version you're using, but I know that in CS3 (and probably CS4), there is a script installed that you can use.
    Draw your frame. Open the Scripts panel. Open the subfolders "Application", then "Samples", then "Javascript". With your Frame selected, double-click the script in the list named "CornerEffects.jsx". You'll be presented with a list of options to control what type of corner; and at the bottom the pop-up menu controls which corners get that type of corner.
    (Names may vary somewhat for CS4.)

  • How to make only one JFrame active at a time !!!

    Hy, I have created a JFrame and I have placed a
    JPanel in it. I also have a JButton "New" on the
    JPanel. When I click on the "New" Button, another JFrame
    appears. But I want ONLY one JFrame to be appeared
    at a time. That is when a JFrame appears on the JPanel,
    I should not be able to add another one.
    If it is not possible to do this with JFrame, then how to do
    it with a JDialog
    How to do this.
    thanks

    You can declare a boolean variable in your class and set it to true if you open a window. Next time when you click the NEW button, check whether that boolean value is true or false. If true then don't open a new window. Also when u close the frame window, set the boolean value to false.

  • How to highlight only one column

    I am trying to highlight and copy one column but the one next to it is also highlighted.  Help!!

    I fear Klaus may be right about the doability of this in Safari.
    How about the following workaround? Don't have a Mac available at the moment, so it's a bit experimental.
    Do a "Paste with current style" in TextEdit of the entire table. (Fingers crossed, that should preserve the tab formatting of the entire table). Now copy the entire-table-stuff from TextEdit into a spreadsheet application like Numbers or Excel. Fingers crossed it'll show up in the spreadsheet as a table. Delete the extra columns from the table in the spreadsheet. Copy the single column back into TextEdit, delete the entire table-stuff. Klunky (assuming it works), but probably quicker than entering cells one at a time from Safari into TextEdit
    Suggesting doing it this way, because if you try copying an entire table directly from Safari into the speadsheet, it's got a nasty habit of stashing all the columns into a single column, which is not immediately helpful. If you're using Numbers on the Mac, it might be worth checking in over at the Numbers community to see if they've got workarounds for converting a "single-column-mess" produced by pasting from Safari into Numbers into a proper table. (I think Yvan might have a script for that, but I'm not sure.)

  • How to make only one row detail disclosed in uix:TableDetail

    I display row details to user with <uix:TableDetail>. I'd like to have only one detail displayed in the same time. When the page first loads, all details should be hidden, but whe user shows one another detail and one is already disclosed, only the new one should be displayed.
    I use <bc4juix:Table> and JDev 9.0.3.2
    Thanks in advance

    Viliam,
    The <table> element has the detailDisclosure complex attribute that you should use to control whether the details for table rows are disclosed. You should databind the detailDisclosure attribute to some DataObjectList that has the "disclosed" key set for each DataObject in the list. Then, when you disclose a new row, you should modify the DataObject for the corresponding row in the DataObjectLlist, and ensure that all other DataObjects set the "disclosed" key to false.
    Hope this helps,
    Ryan

  • How to track only one column updated in SQL Server 2012?

    Is there a way to only track one specific column named Newsletter (bit format) of a table only when any record in that column has been changed from False to True?
    e.g. In SQL Serer 2012, I have a table named tblSignupHistory. so i originally set the query like this:
    ALTER TABLE tblSignupHistory
    ENABLE CHANGE_TRACKING
    WITH(TRACK_COLUMNS_UPDATED = ON)
    and in my stored procedure, if any data is changed, SQL Server will automatically send me an email notification.
    BUT i only want the notification email to be send only when this one specific column's value is changed from 0 to 1 (False to True). Any changes in other columns for the same table can be ignored.
    Thanks.

    Blog on the topic:
    http://www.exacthelp.com/2012/03/send-email-when-data-of-any-columns-of.html
    QUOTE: "Over all idea
    1. Enable the change tracking (CT) in database
    2. Enable the change tracking (CT) in table
    3. Enabled and configure the database mail
    4. Create a stored procedure which will get data change using CT and send an email
    5. Create a sql sever agent job which will execute the procedure in every 10 second.
    Alternate solutions blog on the topic: Get an alert when a certain record changes in SQL Server
    SQL Server UPDATE() function:
    http://technet.microsoft.com/en-us/library/ms177523.aspx
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to make only one colour show.

    Okay so say I take some footage I just shot and I want the colour blue to ONLY show up and all the other colours turn black and white, how would I do this?
    so ONLY blue will be in the footage, the other colours are black and white.
    Thanks

    Welcome to the forum.
    As stated, Leave Color Effect is exactly what you want. I'd like to put in a bit of a plug for Adobe Classroom in a Book Premiere Pro CS5, Adobe Press, out very soon, if not already on shelves where you are. The author covers this very Effect very well. Doubt that you will find a better tutorial on the Effect anywhere else.
    Also, it's great reading, and a book worth every $.
    Good luck,
    Hunt

  • Copy only one column  of the workbook1  and paste it in another workbook 2

    Hello Rishi. Please help me with this how to copy only one column C of the workbook1  and paste it in another workbook 2 in Column D so that When user execute workbook1 . and then execute workbook2 . Column D is automatically populated in Workbook2 based on the data in Column C in workbook 1
    Please help
    Thanks
    Soniya

    Hi Soniya
    As I mentioned earlier, I haven't come across a situation of copying data from one workbook to another. However, for doing some dynamic modifications within the different sheets of the same workbook, you can refer to the following thread:
    Comparing two queries with VBA macro
    Thanks,
    Rishi

  • I want to make only one node draggable in the tree. How?

    I want to make only one node draggable in the tree. How?
    when we have only
    tree.setDragEnable(true)which makes draggable the entire nodes in the tree.
    Thanks -

    Hi Andrea
    Just to clarify things up: is this what you want?
    package treeDnD;
    * DragJustOneNode.java
    import java.awt.*;
    import java.awt.datatransfer.*;
    import java.awt.dnd.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class DragJustOneNode extends JFrame {
        private JTree tree;
        private DefaultTreeModel model;
        private DefaultMutableTreeNode root;
        public DragJustOneNode() {
            super("Only child 1 is draggable!");
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setSize(400,300);
            setLocationRelativeTo(null);
            tree = new JTree();
            tree.setDragEnabled(true);
            getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);
            tree.setTransferHandler(new TreeTransferHandler());
            root = new DefaultMutableTreeNode(new NodeData(0, "root"));
            root.add(new DefaultMutableTreeNode(new NodeData(1, "child 1")));
            root.add(new DefaultMutableTreeNode(new NodeData(2, "child 2")));
            root.add(new DefaultMutableTreeNode(new NodeData(3, "child 3")));
            root.add(new DefaultMutableTreeNode(new NodeData(4, "child 4")));
            model = new DefaultTreeModel(root);
            tree.setModel(model);
        public static void main(final String args[]) {new DragJustOneNode().setVisible(true);}
    class NodeData{
        private int id;
        private String data;
        public NodeData(final int id, final String data){
            this.id = id;
            this.data = data;
        public int getId() {return id;}
        public void setId(final int id) {this.id = id;}
        public String getData() {return data;}
        public void setData(final String data) {this.data = data;}
        public String toString() {return data;}
    class TreeTransferable implements Transferable{
        private NodeData nodeData;
        public TreeTransferable(NodeData nodeData){
            this.nodeData = nodeData;
        public DataFlavor[] getTransferDataFlavors() {
            return new DataFlavor[]{DataFlavor.stringFlavor};
        public boolean isDataFlavorSupported(DataFlavor flavor) {
            return true;
        public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
            return nodeData;
    class TreeTransferHandler extends TransferHandler{
        private DefaultMutableTreeNode sourceNode, targetNode;
        public boolean canImport(final JComponent comp, final DataFlavor[] transferFlavors) {
            NodeData nodeData = (NodeData) (sourceNode).getUserObject();
            if(nodeData.getId() == 1) return true;
            return false;
        protected Transferable createTransferable(final JComponent c) {
            JTree tree = ((JTree)c);
            sourceNode = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
            return new TreeTransferable((NodeData) sourceNode.getUserObject());
        public int getSourceActions(final JComponent c) {return DnDConstants.ACTION_MOVE;}
        public boolean importData(final JComponent comp, final Transferable t) {
            JTree tree = ((JTree)comp);
            DefaultTreeModel model = (DefaultTreeModel)tree.getModel();
            targetNode = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
            DefaultMutableTreeNode parent = (DefaultMutableTreeNode)targetNode.getParent();
            if(parent == null) return false;
            model.removeNodeFromParent(sourceNode);
            model.insertNodeInto(sourceNode, parent, parent.getIndex(targetNode));
            tree.setSelectionPath(new TreePath(model.getPathToRoot(sourceNode)));
            return true;
    }

  • How to make a summary column appear only once (in the first page only) in SSRS 2008?

    Hello Everyone,
    How to make a summary column appear only once (in the first page only) in SSRS 2008?
    Regards
    Gautam S
    Regards

    Hi,
    Assuming you have test data like this ;
    select 'abc'as [GROUP],'NN' name , 1 id
    union all
    select 'abc' as [GROUP] ,'PP' name , 1 id
    union all
    select 'abc'as [GROUP],'RR' name , 2 id
    Step1  : take Tablix with row group as your group Name .
    Step2 : right Click on Row Group Details -> Delete-> Delete Group Only
    Step3 : In Count Cell use below expression ;
    =CountDistinct(Fields!id.Value)
    Follow this link;
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b6b45917-0a26-4d15-be46-2c6a2697d6e9/distinct-rows-sum?forum=sqlreportingservices#5ffdee06-c2c8-44ea-a3a5-b958488bb6b5
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • Pages:  How can I sort one column of words and not have it affect the other columns?

    How can I sort one column of words and not have it affect the other columns?  I have opened the inspector to the edit columns and rows under Table.  It will sort the column, but then it changes the other colums as well.  I know that if I use Numbers, it will work, but I want to know how to do the same thing in Pages.

    Hi Peter,
    Numbers sorts full rows on values in selected column(s). The technique for sorting a single column is essentially the same as Jerry is describing for Pages tables—separate the (data in the) column to be sorted, sort it, return it to the table.
    In Numbers the actual column may be separated from the original table, sorted, then returned. In Pages, the data must be extracted, sorted, then pasted back in, overwriting the unsorted data (if it was left in the original table).
    iWork tables follow a database model in which each row is a Record, and each column holds a Field within the records.
    As evidenced by the current question (and several similar questions arising in the Numbers community) that model doesn't apply to the way some users, especially some who come in from the MS Excel world, use tables.
    With Excels model—islands of data on a single large table, the ability to sort one or a selected few columns of data makes sense. One 'island' may comprise only cells AA21:AH50. Sorting that small 'table' should be possible without disturbing the rest of rows 21-30, which are probably part of one or more other 'data islands' in the sea that is a MS Excel spreadsheet.
    In Numbers, each of those 'islands' would be a separate Table, and that Table would be sortable without disturbing other Tables in the document.
    Regards,
    Barry

  • Set filter for only one column in tableview

    Hi
    i am using in MVC a htmlb:tableview with filter in only one column of 8.
    This is all working fine, except that the user can enter a searchsting in the filterfield for all columns, but in handle_event (of the controller) ; i only react to a text in the filterfield of column 4 and ignore all other filtertext , which were maybe entered in the other columns.
    My question:
    how can i  enter the filter only for one column, in a way that the user cannot enter any text in the filterfield of the other columns, only in column 4 ?
    my view:
    <htmlb:tableView id             = "requirements"
                     table          = "//model/pdst_reqs"
                     filter         = "APPLICATION"                
                     keyColumn       = "EXTID"
                     iterator        = "<%=model%>"
                     footerVisible   = "FALSE"
                     encode          = "TRUE"
                     visibleRowCount = "<%=model->rowcount%>"
                     width           = "100%"/>
    Best Regards
    Britta

    You can disbale the Filter for the particular column by setting the DISABLE_FILTER in the Iterator method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS. Here is the sample code
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .
      CLEAR p_column_definitions.
      CLEAR p_overwrites.
      data tv_column TYPE TABLEVIEWCONTROL.
      tv_column-COLUMNNAME          = 'FLDATE'.
      tv_column-SORT                = 'X'.
      tv_column-EDIT                = 'X'.
      tv_column-ONCELLCLICK         = 'MyCellClick1'.
      tv_column-title               = 'Date '.
      APPEND tv_column TO p_column_definitions.
      CLEAR tv_column.
      tv_column-COLUMNNAME          = 'PRICE'.
      tv_column-horizontalAlignment = 'right'.
      tv_column-verticalAlignment   = 'middle'.
      tv_column-ONCELLCLICK         = 'MyCellClick2'.
      tv_column-title               = 'Currency'. 
      tv_column-EDIT                = 'X'.
      tv_column-DISABLE_FILTER      = 'X'.    " <-------Like this
      APPEND tv_column TO p_column_definitions.
    endmethod.
    Hope this will solve your problem.
    Raja

  • How to export only selected columns of WD ALV to excel

    Hi,
    I have WD ALV report with EXPORT button (since standard button was not working properly i just hide that and added custom one) & standard dropdown to choose layout. Out of 20 columns user may choose n number of columns, the same number of columns i need to transfer to xls. How to export only selected columns to xls. Any method or FM to filter number of columns being transfer to xls. please advise
    Rgds
    sudhanshu

    Hi,
    Where exactly we are (or going to be) using this reference i.e., CL_SALV_WD_CONFIG_TABLE. Im passing contents, filename & MIME type as:
    call function 'SCMS_STRING_TO_XSTRING'
        exporting
          TEXT   = TEXT
        importing
          BUFFER = XTEXT.
    WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(
    **path to the word file
        I_FILENAME = 'WDP.xls'
    String Variable
        I_CONTENT =  XTEXT
    File Type
        I_MIME_TYPE = 'EXCEL' ).
    In CL_SALV_WD_CONFIG_TABLE we have few methods related to column settings however not sure where exactly we will be using this class reference. can you please give some idea so that i can do some r&d in that.
    Rgds
    Sudhanshu

  • How to make every break column on the top of the rows in the same subgroup

    hi, guys:
    I was wondering if anyone could help me on this problem: I need to set up a break column on a classic report (I ma required to use classic report only), and it works, but I do not know how to make every break column on the top of the rows in the same subgroup. The break column only stays on the left to the rest columns as it is the first column. Anyone could help me on this problem? Here is the query:
    select so.doc_number as "DOC Number", so.offender_id as "Offender ID", so.first_name||' '|| so.middle_name||' '||so.last_name as "Offender Name",
    (select sc1.description from sor_code sc1 where sc1.code_id=so.race) as "Race",
    (select sc2.description from sor_code sc2 where sc2.code_id=so.sex) as "Sex",
    replace(replace(nvl2(sl.address1, sl.address1||' '||sl.address2 ||' '||sl.city ||' '||sl.county||' '||(select sc3.description from sor_code sc3 where sc3.code_id=sl.state)||' '||sl.zip, 'No Known Address'),'#'),',') as "Address",
    (select sof.name||'   '||sof.phone1||'   '||sof.link from sor_offices sof where sof.office_id=sl.jurisdiction) as "Jurisidiction",
    decode(rox.habitual, 'Y', 'Habitual', '') as "Habitual",
    decode(rox.aggravated, 'Y', 'Aggravated', '') as "Aggravated",
    floor(to_number(sysdate-so.date_of_birth)/365) as "Age"
    from sor_location sl, sor_offender so, registration_offender_xref rox, sor_last_locn_v sllv
    where rox.offender_id=so.offender_id
    and sllv.offender_id(+)=so.offender_id
    and sl.location_id(+)=sllv.location_id
    and rox.status not in ('Merged')
    and rox.reg_type_id=1
    and upper(rox.status)='ACTIVE'
    and nvl(rox.admin_validated, to_date(1,'J'))>=nvl(rox.entry_date, to_date(1,'J'))
    and ((so.first_name is not null and upper(so.first_name) like '%'||upper(:P5_TF_FIRST_NAME)||'%') or (:P5_TF_FIRST_NAME is null))
    and ((so.last_name is not null and upper(so.last_name) like '%'||upper(:P5_TF_LAST_NAME)||'%') or (:P5_TF_LAST_NAME is null))
    and ((sl.address1||sl.address2 is not null and upper(sl.address1|| sl.address2) like '%'||upper(:P5_TF_ADDRESS)||'%')or (:P5_TF_ADDRESS is null))
    and ((sl.city is not null and upper(sl.city) like '%'||upper(:P5_TF_CITY)||'%')or (:P5_TF_CITY is null))
    and ((sl.county is not null and sl.county =:P5_SL_COUNTY)or (:P5_SL_COUNTY is null))
    and (((select sc5.description from sor_code sc5 where sc5.code_id=sl.state and sc5.description=:P5_SL_STATE) is not null )or (:P5_SL_STATE is null))
    and ((sl.zip is not null and sl.zip =:P5_TF_ZIP_CODE)
    or (:P5_TF_ZIP_CODE is null))
    union
    select so.doc_number as "DOC Number", so.offender_id as "Offender ID", so.first_name||' '|| so.middle_name||' '||so.last_name as "Offender Name",
    (select sc1.description from sor_code sc1 where sc1.code_id=so.race) as "Race",
    (select sc2.description from sor_code sc2 where sc2.code_id=so.sex) as "Sex",
    replace(replace(nvl2(sl.address1, sl.address1||' '||sl.address2 ||' '||sl.city ||' '||sl.county||' '||(select sc3.description from sor_code sc3 where sc3.code_id=sl.state)||' '||sl.zip, 'No Known Address'),'#'),',') as "Address",
    (select sof.name||'   '||sof.phone1||'   '||sof.link from sor_offices sof where sof.office_id=sl.jurisdiction) as "Jurisidiction",
    decode(rox.habitual, 'Y', 'Habitual', '') as "Habitual",
    decode(rox.aggravated, 'Y', 'Aggravated', '') as "Aggravated",
    floor(to_number(sysdate-so.date_of_birth)/365) as "Age"
    from sor_location sl, sor_offender so, registration_offender_xref rox, sor_last_locn_v sllv
    where rox.offender_id=so.offender_id
    and sllv.offender_id(+)=so.offender_id
    and sl.location_id(+)=sllv.location_id
    and rox.status not in ('Merged')
    and rox.reg_type_id=1
    and upper(rox.status)='ACTIVE'
    and nvl(rox.admin_validated, to_date(1,'J'))>=nvl(rox.entry_date, to_date(1,'J'))
    and ((so.first_name is not null and upper(so.first_name) like '%'||upper(:P5_TF_FIRST_NAME)||'%') or (:P5_TF_FIRST_NAME is null))
    and ((so.last_name is not null and upper(so.last_name) like '%'||upper(:P5_TF_LAST_NAME)||'%') or (:P5_TF_LAST_NAME is null))
    and ((sl.physical_address1 is not null and upper(sl.physical_address1) like '%'||upper(:P5_TF_ADDRESS)||'%') or (:P5_TF_ADDRESS is null))
    and ((sl.physical_city is not null and upper(sl.physical_city) like '%'||upper(:P5_TF_CITY)||'%') or (:P5_TF_CITY is null))
    and ((sl.physical_county is not null and sl.physical_county =:P5_SL_COUNTY) or (:P5_SL_COUNTY is null))
    and (((select sc5.description from sor_code sc5 where sc5.code_id=sl.physical_state and sc5.description=:P5_SL_STATE) is not null )or (:P5_SL_STATE is null))
    and ((sl.physical_zip is not null and sl.physical_zip =:P5_TF_ZIP_CODE) or (:P5_TF_ZIP_CODE is null))
    union
    select so.doc_number as "DOC Number", so.offender_id as "Offender ID", so.first_name||' '|| so.middle_name||' '||so.last_name as "Offender Name",
    (select sc1.description from sor_code sc1 where sc1.code_id=so.race) as "Race",
    (select sc2.description from sor_code sc2 where sc2.code_id=so.sex) as "Sex",
    replace(replace(nvl2(sl.address1, sl.address1||' '||sl.address2 ||' '||sl.city ||' '||sl.county||' '||(select sc3.description from sor_code sc3 where sc3.code_id=sl.state)||' '||sl.zip, 'No Known Address'),'#'),',') as "Address",
    (select sof.name||'   '||sof.phone1||'   '||sof.link from sor_offices sof where sof.office_id=sl.jurisdiction) as "Jurisidiction",
    decode(rox.habitual, 'Y', 'Habitual', '') as "Habitual",
    decode(rox.aggravated, 'Y', 'Aggravated', '') as "Aggravated",
    floor(to_number(sysdate-so.date_of_birth)/365) as "Age"
    from sor_location sl, sor_offender so, registration_offender_xref rox, sor_last_locn_v sllv, sor_alias sa
    where rox.offender_id=so.offender_id
    and sa.offender_id=so.offender_id
    and sllv.offender_id(+)=so.offender_id
    and sl.location_id(+)=sllv.location_id
    and rox.status not in ('Merged')
    and rox.reg_type_id=1
    and upper(rox.status)='ACTIVE'
    and nvl(rox.admin_validated, to_date(1,'J'))>=nvl(rox.entry_date, to_date(1,'J'))
    and ((sa.first_name is not null and upper(sa.first_name) like '%'||upper(:P5_TF_FIRST_NAME)||'%') or (:P5_TF_FIRST_NAME is null))
    and ((sa.last_name is not null and upper(sa.last_name) like '%'||upper(:P5_TF_LAST_NAME)||'%') or (:P5_TF_LAST_NAME is null))
    and ((sl.address1||sl.address2 is not null and upper(sl.address1|| sl.address2) like '%'||upper(:P5_TF_ADDRESS)||'%')or (:P5_TF_ADDRESS is null))
    and ((sl.city is not null and upper(sl.city) like '%'||upper(:P5_TF_CITY)||'%')or (:P5_TF_CITY is null))
    and ((sl.county is not null and sl.county =:P5_SL_COUNTY)or (:P5_SL_COUNTY is null))
    and (((select sc5.description from sor_code sc5 where sc5.code_id=sl.state and sc5.description=:P5_SL_STATE) is not null )or (:P5_SL_STATE is null))
    and ((sl.zip is not null and sl.zip =:P5_TF_ZIP_CODE)or (:P5_TF_ZIP_CODE is null))
    union
    select so.doc_number as "DOC Number", so.offender_id as "Offender ID", so.first_name||' '|| so.middle_name||' '||so.last_name as "Offender Name",
    (select sc1.description from sor_code sc1 where sc1.code_id=so.race) as "Race",
    (select sc2.description from sor_code sc2 where sc2.code_id=so.sex) as "Sex",
    replace(replace(nvl2(sl.address1, sl.address1||' '||sl.address2 ||' '||sl.city ||' '||sl.county||' '||(select sc3.description from sor_code sc3 where sc3.code_id=sl.state)||' '||sl.zip, 'No Known Address'),'#'),',') as "Address",
    (select sof.name||'   '||sof.phone1||'   '||sof.link from sor_offices sof where sof.office_id=sl.jurisdiction) as "Jurisidiction",
    decode(rox.habitual, 'Y', 'Habitual', '') as "Habitual",
    decode(rox.aggravated, 'Y', 'Aggravated', '') as "Aggravated",
    floor(to_number(sysdate-so.date_of_birth)/365) as "Age"
    from sor_location sl, sor_offender so, registration_offender_xref rox, sor_last_locn_v sllv, sor_alias sa
    where rox.offender_id=so.offender_id
    and sa.offender_id=so.offender_id
    and sllv.offender_id(+)=so.offender_id
    and sl.location_id(+)=sllv.location_id
    and rox.status not in ('Merged')
    and rox.reg_type_id=1
    and upper(rox.status)='ACTIVE'
    and nvl(rox.admin_validated, to_date(1,'J'))>=nvl(rox.entry_date, to_date(1,'J'))
    and ((sa.first_name is not null and upper(sa.first_name) like '%'||upper(:P5_TF_FIRST_NAME)||'%') or (:P5_TF_FIRST_NAME is null))
    and ((sa.last_name is not null and upper(sa.last_name) like '%'||upper(:P5_TF_LAST_NAME)||'%') or (:P5_TF_LAST_NAME is null))
    and ((sl.physical_address1 is not null and upper(sl.physical_address1) like '%'||upper(:P5_TF_ADDRESS)||'%') or (:P5_TF_ADDRESS is null))
    and ((sl.physical_city is not null and upper(sl.physical_city) like '%'||upper(:P5_TF_CITY)||'%') or (:P5_TF_CITY is null))
    and ((sl.physical_county is not null and sl.physical_county =:P5_SL_COUNTY) or (:P5_SL_COUNTY is null))
    and (((select sc5.description from sor_code sc5 where sc5.code_id=sl.physical_state and sc5.description=:P5_SL_STATE) is not null )or (:P5_SL_STATE is null))
    and ((sl.physical_zip is not null and sl.physical_zip =:P5_TF_ZIP_CODE) or (:P5_TF_ZIP_CODE is null))I set up "Jurisdiction" to be displayed as the first column in report attributes and set up the first column to be break column, under the "When displaying a break column use this format, use #COLUMN_VALUE# subs", I fill in "Jurisdiction".

    lxiscas wrote:
    Hi, fac586:
    I am sorry for not being able to provide project online oracle to ask the question as some of the data needs to be approved to release.You don't need to use the actual data. Create simple test cases using data from Oracle's sample schemas: SCOTT, OE, HR etc.
    I actually want something like this:
    Jurisdiction: Bartlesville Police Department, 918-338-4001, http://www.cityofbartlesville.org/departments/police/
    Smith , Carl Sherman      ......
    Smith , Tommy Nesby .....
    Jurisdiction: Canadian County Sheriff's Office, 405-262-4787, Fax - 405-422-2430
    Smith , Gabriel Ray      ...
    Smith , Michael Bert   ...I omit the sensitive data with ...
    but right now it shows as this way:
    Jurisdiction: Bartlesville Police Department, 918-338-4001, http://www.cityofbartlesville.org/departments/police/  Smith , Carl Sherman      ......
    Smith , Tommy Nesby .....
    Jurisdiction: Canadian County Sheriff's Office, 405-262-4787, Fax - 405-422-2430   Smith , Gabriel Ray      ...
    Smith , Michael Bert   ...Is that possible to show the data as the upper way?The best way to do this is using a report with a custom named column template as in this example. See the following threads for solutions to similar problems:
    <li>{thread:id=2402836}
    <li>{message:id=9816577}

  • Only one column was record on Trigger

    Dear Experts,
    I've created SQL Trigger, it has five column, but only one column was recorded when Trigger's fired, another filled by NULL value
    please your valuable suggestion & helps
    thank you
    warmest regards

    Triggers are fired by INSERT  not matter how many rows it will generate and it is perfectly possible to have NULLs if columns allow it..
    If you want to prevent from entering NULLs, please examine inserted virtual table to filter out the data which contains NULLs.
    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

Maybe you are looking for

  • Start web dispacher on linux

    Hello all, I want to start the WebDispacher ( NW 7.0 EhP3, Java system) The Error is: 3> startsap all X01 Trying to start SID database ... Log file: /home/sidadm/startdb.log Starting Startup Agent sapstartsrv OK Instance Service on host sid started s

  • @ALIAS in FIX Statement

    Hi, Can I use @ALIAS function in FIX statement? When i try to do it it says "Error: 1200315 Error parsing formula for [FIX STATEMENT] (line 1): invalid object type". If not is there any work around for it? Thanks.

  • How do I get Itunes to automatically delete nonexistant songs???

    How do I get Itunes to automatically delete nonexistant songs??? I am referring to the songs that remain on itunes after you change their name or directory or whatever. It takes too long to delete individual songs. Is there some sort of plug-in avail

  • Grace Period before Cancelling and Deleting Email Accounts

    I recently change my phone provider to a VoIP phone, but did not cancel my DSL service.  However, once the porting of my phone number occured, Verizon "suspended " account completely.  I have not access to my email, and according to the agent I spoke

  • Why Does Apple TV3 Slideshow Display iPhotos in Incorrect Order?

    I have an Apple TV3 connected to my Mac running OS X 10.9.3.  The Apple TV3 is connected wirelessly to the Mac.  I have several questions: Why can I not show Slideshows I have created in iPhoto on my Mac on the Apple TV3?  I can only show iPhoto Albu