Cell with boolean value not rendering properly in Swing (custom renderer)

Hello All,
I have a problem rendenring boolean values when using a custom cell renderer inside a JTable; I managed to reproduce the issue with a dummy application. The application code follows:
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
* Simple GUI that uses custom cell rendering
* @author josevnz
public final class SimpleGui extends JFrame {
     private static final long serialVersionUID = 1L;
     private Logger log = Logger.getLogger(SimpleGui.class.getName());
     private JTable simpleTable;
     public SimpleGui() {
          super("Simple GUI");
          setPreferredSize(new Dimension(500, 500));
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setLayout(new BorderLayout());
     public void constructGui() {
          simpleTable = new JTable(new SimpleTableModel());
          simpleTable.getColumnModel().getColumn(2).setCellRenderer(new HasItCellRenderer());
          SpecialCellRenderer specRen = new SpecialCellRenderer(log);
          simpleTable.setDefaultRenderer(Double.class, specRen);
          simpleTable.setDefaultRenderer(String.class, specRen);
          simpleTable.setDefaultRenderer(Date.class, specRen);
          //simpleTable.setDefaultRenderer(Boolean.class, specRen);
          add(new JScrollPane(simpleTable), BorderLayout.CENTER);          
          pack();
          setVisible(true);
     private void populate() {
          List <List<Object>>people = new ArrayList<List<Object>>();
          List <Object>people1 = new ArrayList<Object>();
          people1.add(0, "Jose");
          people1.add(1, 500.333333567);
          people1.add(2, Boolean.TRUE);
          people1.add(3, new Date());
          people.add(people1);
          List <Object>people2 = new ArrayList<Object>();
          people2.add(0, "Yes, you!");
          people2.add(1, 100.522222);
          people2.add(2, Boolean.FALSE);
          people2.add(3, new Date());
          people.add(people2);
          List <Object>people3 = new ArrayList<Object>();
          people3.add(0, "Who, me?");
          people3.add(1, 0.00001);
          people3.add(2, Boolean.TRUE);
          people3.add(3, new Date());
          people.add(people3);
          List <Object>people4 = new ArrayList<Object>();
          people4.add(0, "Peter Parker");
          people4.add(1, 11.567444444);
          people4.add(2, Boolean.FALSE);
          people4.add(3, new Date());
          people.add(people4);
          ((SimpleTableModel) simpleTable.getModel()).addAll(people);
      * @param args
      * @throws InvocationTargetException
      * @throws InterruptedException
     public static void main(String[] args) throws InterruptedException, InvocationTargetException {
          final SimpleGui instance = new SimpleGui();
          SwingUtilities.invokeAndWait(new Runnable() {
               @Override
               public void run() {
                    instance.constructGui();
          instance.populate();
}I decided to write a more specific renderer just for that column:
import java.awt.Color;
import java.awt.Component;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.table.DefaultTableCellRenderer;
* Cell renderer used only by the DividendElement table
* @author josevnz
final class HasItCellRenderer extends DefaultTableCellRenderer {
     protected static final long serialVersionUID = 2596173912618784286L;
     private Color hasIt = new Color(255, 225, 0);
     public HasItCellRenderer() {
          super();
          setOpaque(true);
     @Override
     public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
          Component comp = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
          int desCol = table.convertColumnIndexToView(1);
          if (! isSelected && value instanceof Boolean && column == desCol) {
               if (((Boolean) value).booleanValue()) {
                    comp.setForeground(hasIt);     
               } else {
                    comp.setForeground(UIManager.getColor("table.foreground"));
          return comp;
      * Override for performance reasons
     @Override
     public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {
          // EMPTY
     @Override
     protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
          // EMPTY
     @Override
     public void revalidate() {
          // EMPTY
     @Override
     public void validate() {
          // EMPTY
} // end classBut the rendering comes all wrong (a String saying true or false, not the expected checkbox from the default renderer) and also there is a weird flickring effect as this particular boolean column is editable (per table model, not show here)...
I can post the table model and the other renderer if needed (didn't want to put too much code on the question, at least initiallty).
Should I render a checkbox myself for this cell in the custom renderer? I'm puzzled as I expected the default renderer part of the code to do this for me instead.
Thanks!
Edited by: josevnz on Apr 14, 2009 12:35 PM
Edited by: josevnz on Apr 14, 2009 12:37 PM

camickr
Thats because the default render is a JLabel and it just displays the text from the toString() method of the Object in the table model.What I meant to say is that I expected the JCheckbox not a String representation of the boolean value.
Thats because a different renderer is used depending on the Class of data in the column. Look at the source code for the JTable class to see what the "default >renderer for the Boolean class" is. Then you can extend that or if its a private class then you will need to copy all the code and customize it.At the end I looked at the code and replicated the functionality I needed. I thought than maybe there was a way to avoid replicating the same logic all over again in order to implement this functionality. Good advice, though.
see you learned nothing from your last posting. This is NOT a SSCCE. 90% of the code you posted is completely irrelevant for the described problem. There is abosutelly no need to post the custom TableModel, because there is no need to use a custom TableModel for this problem. The TableModel has nothing to do with how a column is rendererd.The custom table model returns the type of the column (giving a hint to the renderer on what to expect, right?) and for the one that had a problem it says than the class is Boolean. That's why I mentioned it:
public Class getColumnClass(int columnIndex) {
    // Code omited....
You also posted data for 4 columns worth of data. Again, irrelevant. Your question is about a single column containing Boolean data, so forget about the other columns.
When creating a SSCCE you don't start with your existing code and "remove" code. You start with a brand new class and only add in what is important. That way hopefully if you made a mistake the first time you don't repeat it the second time.That's what I did, is not the real application. I copy & pasted code in a haste from this dummy program on this forum, not the best approach as it gave the wrong impression.
Learn how to write a proper SSCCE if you want help in the future. Point taken, but there is NO need for you to be rude. Your help is appreciated.
Regards,
Jose.

Similar Messages

  • HT1338 has anyone else had problems with their mail not loading properly and the multi gestures stopped working on their mac pro after new updates?

    has anyone else had problems with their mail not loading properly and the multi gestures stopped working on their mac pro after new updates?

    Have you tried calling Apple tech support?
    http://www.apple.com/contact/

  • Pick List Value Not Working Properly

    Hi Oracle Framework Gurus,
    I have a strange Issue in which one of my cusom page is working properly in Jdev and not working Properly when deployed in the apps instance.
    There are two custom pages with the same VO.
    What I do is have a picklist from one of the custom page and depending on the value of the picklist and I navigate to the other custom page.
    This is working properly in the JDev,But for some reasons it works properly in apps instance, when I try to run the first time(ie) when I run page A and pick 'X' from the picklist the Page 'B' is coming properly as per the controller code and when i pick 'Y' from the picklist in Page B, it is navigating to Page A as per the controller code.
    This works fine for the first time,But when i again select 'X' from the picklist the proper value from the Picklist is not getting selected and passed to the custom package and so I get wrong values in Page 'B'
    What could be the reason for it as it working fine in Jdev,I can navigate from Page A to Page B and Page B to Page A as many times possible.

    Hi Anand,
    Controller1 :
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    //int intPersonId = pageContext.getEmployeeId();
    int intPersonId; // = pageContext.getEmployeeId();
    String strPersonId = Integer.toString(277671);
    //String strPersonId = Integer.toString(intPersonId);
    java.util.Date sysdate = pageContext.getCurrentUserDate();
    String convSysDate = pageContext.getOANLSServices().dateToString(sysdate);
    // Date testdate = (Date)sysdate.dateValue();
    // get the Application Module
    OAApplicationModule oaAM = pageContext.getApplicationModule(webBean);
    Serializable parameters[] = { strPersonId,convSysDate };
    Serializable param[] = { strPersonId };
    System.out.println("The Sysdate PF "+convSysDate);
    //pass parameters to Application Module
    oaAM.invokeMethod("insertLovRow", param);
    if ((String)pageContext.getSessionValue("PFlag1") != null)
    String PFlag1 =(String)pageContext.getSessionValue("PFlag1");
    String SDate1 =(String)pageContext.getSessionValue("SDateSession1");
    Serializable param1[] = { SDate1 };
    oaAM.invokeMethod("insertLovRow", param);
    oaAM.invokeMethod("initEmpLovQuery1",param1);
    oaAM.invokeMethod("initEmpTransLovQuery1");
    OAMessageChoiceBean orgMesgChoiceBean = (OAMessageChoiceBean)webBean.findChildRecursive("Year");
    orgMesgChoiceBean.setPickListViewObjectDefinitionName("EmployeeTest.oracle.apps.per.server.EmpTransDateLov");
    orgMesgChoiceBean.setListValueAttribute("StartDate");
    orgMesgChoiceBean.setListDisplayAttribute("DateRange" );
    orgMesgChoiceBean.setPickListCacheEnabled(false);
    else
    oaAM.invokeMethod("insertRow", parameters);
    oaAM.invokeMethod("initQuery", param);
    oaAM.invokeMethod("execQuery");
    oaAM.invokeMethod("totexecQuery");
    OAMessageChoiceBean orgMesgChoiceBean = (OAMessageChoiceBean)webBean.findChildRecursive("Year");
    orgMesgChoiceBean.setPickListViewObjectDefinitionName("EmployeeTest.oracle.apps.per.server.EmployeeDateLovVO");
    orgMesgChoiceBean.setListValueAttribute("StartDate");
    orgMesgChoiceBean.setListDisplayAttribute("DateRange" );
    orgMesgChoiceBean.setPickListCacheEnabled(false);
    oaAM.invokeMethod("initEmpLovQuery");
    OAViewObject oaviewobject1 =(OAViewObject)oaAM.findViewObject("EmployeeUtilVO1");
    oaviewobject1.reset();
    if (oaviewobject1 != null)
    do
    if(!oaviewobject1.hasNext())
    break;
    oaviewobject1.next();
    OARow row = (OARow)oaviewobject1.getCurrentRow();
    String fullName = (String)row.getAttribute("EmpDep");
    System.out.println("The Name is "+fullName);
    } while(true);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    //int intPersonId = pageContext.getEmployeeId();
    //String strPersonId = Integer.toString(intPersonId);
    int intPersonId; // = pageContext.getEmployeeId();
    String strPersonId = Integer.toString(277671);
    OAApplicationModule oaAM = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("ViewDetails") != null)
    pageContext.putSessionValue("strPersonId", strPersonId);
    pageContext.setForwardURL("OA.jsp?page=/EmployeeTest/oracle/apps/per/webui/EmployeePanelIB",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    System.out.println("strPersonId "+strPersonId);
    String strEvent= pageContext.getParameter(EVENT_PARAM) ;
    if ( strEvent.equals("update"))
    OAMessageChoiceBean DepStatus1 = (OAMessageChoiceBean) webBean.findIndexedChildRecursive("Year");
    String sDate = DepStatus1.getSelectionValue(pageContext);
    //String sDate = DepStatus1.getValue(pageContext).toString();
    //Serializable parameters[] = { strPersonId,sDate };
    Serializable parameters[] = { strPersonId,sDate };
    Serializable param[] = { strPersonId };
    System.out.println("The PersonId "+strPersonId);
    System.out.println("The Controller Date passed is IBUtil "+sDate);
    oaAM.invokeMethod("insertRow", parameters);
    oaAM.invokeMethod("initQuery", param);
    oaAM.invokeMethod("execQuery");
    String flag = "1";
    //pageContext.putSessionValue("strPersonId", strPersonId);
    pageContext.putSessionValue("PFlag", flag);
    pageContext.putSessionValue("SDateSession", sDate);
    pageContext.setForwardURL("OA.jsp?page=/EmployeeTest/oracle/apps/per/webui/EmpTestPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    Controller 2:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    //int intPersonId = pageContext.getEmployeeId();
    int intPersonId; // = pageContext.getEmployeeId();
    String strPersonId = Integer.toString(277671);
    //String strPersonId = Integer.toString(intPersonId);
    java.util.Date sysdate = pageContext.getCurrentUserDate();
    String convSysDate = pageContext.getOANLSServices().dateToString(sysdate);
    // get the Application Module
    OAApplicationModule oaAM = pageContext.getApplicationModule(webBean);
    Serializable parameters[] = { strPersonId,convSysDate };
    Serializable param[] = { strPersonId };
    System.out.println("The Sysdate PF "+convSysDate);
    //pass parameters to Application Module
    oaAM.invokeMethod("insertLovRow", param);
    if ((String)pageContext.getSessionValue("PFlag") != null)
    String PFlag1 =(String)pageContext.getSessionValue("PFlag");
    String SDate1 =(String)pageContext.getSessionValue("SDateSession");
    Serializable param2[] = { strPersonId, SDate1 };
    Serializable param1[] = { SDate1 };
    oaAM.invokeMethod("insertLovRow", param);
    oaAM.invokeMethod("initEmpLovQuery1",param1);
    oaAM.invokeMethod("initEmpTransLovQuery1");
    OAMessageChoiceBean orgMesgChoiceBean = (OAMessageChoiceBean)webBean.findChildRecursive("Year");
    orgMesgChoiceBean.setPickListViewObjectDefinitionName("EmployeeTest.oracle.apps.per.server.EmpTransDateLov");
    orgMesgChoiceBean.setListValueAttribute("StartDate");
    orgMesgChoiceBean.setListDisplayAttribute("DateRange" );
    orgMesgChoiceBean.setPickListCacheEnabled(false);
    else
    oaAM.invokeMethod("insertRow", parameters);
    oaAM.invokeMethod("initQuery", param);
    oaAM.invokeMethod("execQuery");
    oaAM.invokeMethod("totexecQuery");
    OAMessageChoiceBean orgMesgChoiceBean = (OAMessageChoiceBean)webBean.findChildRecursive("Year");
    orgMesgChoiceBean.setPickListViewObjectDefinitionName("EmployeeTest.oracle.apps.per.server.EmployeeDateLovVO");
    orgMesgChoiceBean.setListValueAttribute("StartDate");
    orgMesgChoiceBean.setListDisplayAttribute("DateRange" );
    orgMesgChoiceBean.setPickListCacheEnabled(false);
    oaAM.invokeMethod("initEmpLovQuery");
    OAViewObject oaviewobject1 =(OAViewObject)oaAM.findViewObject("EmployeeUtilVO1");
    oaviewobject1.reset();
    if (oaviewobject1 != null)
    do
    if(!oaviewobject1.hasNext())
    break;
    oaviewobject1.next();
    OARow row = (OARow)oaviewobject1.getCurrentRow();
    String fullName = (String)row.getAttribute("EmpDep");
    System.out.println("The Name is "+fullName);
    } while(true);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule oaAM = pageContext.getApplicationModule(webBean);
    //int intPersonId = pageContext.getEmployeeId();
    //String strPersonId = Integer.toString(intPersonId);
    int intPersonId; // = pageContext.getEmployeeId();
    String strPersonId = Integer.toString(277671);
    if (pageContext.getParameter("ViewDetails") != null)
    pageContext.setForwardURL("OA.jsp?page=/EmployeeTest/oracle/apps/per/webui/EmpPanelPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    pageContext.putSessionValue("strPersonId", strPersonId);
    String strEvent= pageContext.getParameter(EVENT_PARAM) ;
    if ( strEvent.equals("update"))
    OAMessageChoiceBean DepStatus1 = (OAMessageChoiceBean) webBean.findIndexedChildRecursive("Year");
    String sDate = DepStatus1.getSelectionValue(pageContext);
    //String sDate = DepStatus1.getValue(pageContext).toString();
    Serializable parameters[] = { strPersonId,sDate };
    Serializable param[] = { strPersonId };
    System.out.println("The Controller Date passed is CBUtil "+sDate);
    System.out.println("The PersonId "+strPersonId);
    oaAM.invokeMethod("insertRow", parameters);
    oaAM.invokeMethod("initQuery", param);
    oaAM.invokeMethod("execQuery");
    String flag = "2";
    //pageContext.putSessionValue("strPersonId", strPersonId);
    pageContext.putSessionValue("PFlag1", flag);
    pageContext.putSessionValue("SDateSession1", sDate);
    pageContext.setForwardURL("OA.jsp?page=/EmployeeTest/oracle/apps/per/webui/EmpIBUtilPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    Hi Above two are the controller codes forget the rest of the codes,Concentrate on the PFR code, Just want to know what I am doing is correct or not.
    First time when I select the Picklist value,the value gets passed as a parameter to the custom package and the page gets displayed properly and vice versa,But I am not able to do the same cycle again for some reasons.
    Please get back to me ASAP.
    Regards,
    Magesh.M.K.
    Edited by: user1393742 on Oct 19, 2010 11:58 PM

  • How to fill an empty cell with the value above

    Hello,
    Please help me on the following issue related to BEx query and it's output in BEx analyzer as well as on Web.
    I am trying to modify a query output where the empty cells are to be filled with the value in the above cell.
    e.g. there is a column for transaction number, and this transaction number is the same for three rows, so it turns out to be two empty cells and only appears as if the transaction number applies to the first row only.
    not sure how to paste screenshot or attach document but would love to provide more information if the above isn't suffice.
    Please advise on what and where to modify in BEx designer.
    Thank you for your help!

    Thanks a lot...yes, now it works in BEx Analyzer but for some reason doesn't work in the Web view.
    Any ideas why is that?
    Thanks again for your prompt help.
    Edited by: One Idea on Jan 15, 2009 12:17 AM

  • JXPath with boolean value

    Hi,
    I want to know if JXPath support boolean value or not, and how to do.Because if i try to get the value of a bollean attribute with the getValue(..) method, it does'nt work..
    Thanks

    Hi,
    This forum is dedicated to JMX.
    You're asking a question about JXPath, which is not even closely related to the technology this forum is about.
    Maybe someone reading your post will have an answer for you, but it would be sheer luck.
    Maybe this link will have the answer you're looking for:
    http://today.java.net/pub/a/today/2006/08/03/java-object-querying-using-jxpath.html
    If not you could try to google search for JXPath, or try to find a better suited forum here:
    http://forum.java.sun.com/index.jspa?tab=java
    Hope this helps,
    -- daniel
    http://blogs.sun.com/jmxetc

  • Have cell equal the value not the formula

    Hi there, I have the below formula which calculates the check digit on a UPC from another cell. Is it possible to have a cell reference this formula, without showing the formula, and only show the answer? IE. I only want the result in the cell as though
    it was keyed in there manually, as I want to be able to double click and copy the actual number. Thank you for any help.
    =A41000&RIGHT(10-MOD(SUMPRODUCT(MID(A41000,{1,2,3,4,5,6,7,8,9,10,11},1)*{3,1,3,1,3,1,3,1,3,1,3}),10))

    Hi Jim,
    Thank you for the reply. 
    Do I just put this number in VB on the corresponding tab and it should work?  I'm not sure how to get it to work. 
    Also, in case I need to give more info, the column on the left is the number without the check digit, the number on the right is the cell with the check digit produced by the formula.  As I go down the list, I go to the next row when needed
    using the corner of the cell (fill).  Hopefully I can get it so that the column on the right is not the formula, rather the actual value. 
    12345654329
    123456543294
    12345654330
    123456543300
    12345654331
    123456543317
    12345654332
    123456543324
    12345654333
    123456543331
    12345654334
    123456543348
    12345654335
    123456543355
    12345654336
    12345654337
    12345654338
    12345654339
    12345654340

  • Request failed with SID value not found

    Hi Gurus, I have this error message "No SID found for value '15.00' of charateristic 0CURKEY_TC" and similar message with "10.00" and "*0.0" value, when trying to activate data in standard DSO in BI7.0.
    This is a Dev system just setup for traning purposes so I do not have any Master data to load. I am only loading transactional data from DataSource 0PU_IS_PS_32
    I tried searching for the answer and did the following
    1) Transfer Global Settings from the source system (which solved other problems but not this one)
    2) In RSRV, I do not see any errors for this InfoObject
    3) I am not sure how I can update table T006 and or TCURC with these values?
    I also tried following the Note: 619987 and does not know how I can implement this function module "If you nevertheless receive this error message for the initial value, this means that there is an inconsistency in the SID table for the 0UNIT or 0CURRENCY characteristic. You can eliminate this inconsistency by calling the RSDMD_INITIAL_LINE_INSERT function module with I_CHABASNM = 0UNIT or 0CURRENCY"
    Is there any help that anybody can extend, it will be greatly appreciated.

    Dear,
    SID error comes during activation of ODS because the related MD is not available for assigning SIDs.
    So as a first step ensure that the related master data is loaded and Attribute change run has been triggered.
    Or Load the MD and Activate the MD (Modeling > InfoObject > Search the Infoobject > Right click > Activate Master Data)
    Once you perform this you can retrigger the activation. It should work fine.
    Else as a workaround you can blank out these particular values and activate.
    There is also one more workaround wherein you can create the Master data entries directly in BW itself. But both the above step should be done after consulting Business and considering data volume that needs to be edited/created.
    In most case once you perform the loading and activation of MD your activation should work fine when repeated.
    There are cases where it failed again with the same error. In that case try this also (ensure that PSA is there).
    Delete the request in red.
    Go to monitor
    Edit > Setting for further update > Packet should be processed in the background.
    Edit > Update Reversal > Read everything manually > Yes
    Background processing successfully scheduled
    Then you can see the Load running again.
    Once this is done perform activation again
    Hope it helps
    Regards
    Bala

  • Numbers 3 summing cells with negative values

    I am trying to sum a column of cells with postive and negatve numbers but the result does not consider the the negative sign.  It just adss absolute values

    There is something else going on.  I can clearly sum positive and negative numbers:
    Please use this note to post a screenshot of the data in question:
    https://discussions.apple.com/docs/DOC-6591

  • Text item of varchar2(2000) with vertical scrollbar not displaying properly

    Hi,
    I have a text item of varchar2(2000) with a vertical scroll bar.
    I am populating data into the text item using a forms procedure.
    (Look at the sample code below)
    The problem is the rpadding is NOT displayed properly. I mean
    the detail records are NOT shown straight below their respective column heading
    in the text item. (BUT if I cut this stuff from the text item and paste it in a
    notepad, then the alignment is correct and the data is shown below their
    respective column headings)
    My code is something like below ...
    CURSOR c_get_lab_client_results
    IS
    SELECT res.lr_id lr_id, org.short_name org_name, TO_CHAR(res.specimen_taken_date,'DD-MON-YYYY') std, substr(res.accession_number,1,20) acc_num, res.lr_type lrtype, res.hdc_id hdcid
    FROM bc_organisations org,
    cq_laboratory_results res
    WHERE cli_id = :clients.cli_id
    AND lr_id = :results.lr_id
    AND res.org_id = org.org_id
    ORDER BY lr_id;
    Begin
    -- Header
    SELECT :TRFRDTLS.TRANSFER_DETAILS||RPAD('ORGANISATION',16,' ')||' '||RPAD('SPECIMEN DATE',15,' ')||' '||RPAD('ACCESSION NUMBER',20)||' '||RPAD('RESULTS',16,' ')||chr(10)||chr(10)
    INTO :TRFRDTLS.TRANSFER_DETAILS FROM DUAL;
    -- Detail
    FOR c1 IN c_get_lab_client_results LOOP
    ls_results := RPAD('XXXX',16,' '); -- Just for example
    SELECT :TRFRDTLS.TRANSFER_DETAILS||RPAD(TO_CHAR(c1.org_name),16,' ')||' '||RPAD(c1.std,15,' ')||' '||RPAD(c1.acc_num,20)||' '||ls_results||chr(10)
    INTO :TRFRDTLS.TRANSFER_DETAILS FROM DUAL;
    END LOOP;
    End;
    Thanks in advance.
    Cheers

    Try using a monospace font such as Courier New for the text item.

  • Is there a way to fill a cell with a value based on the selection from another cell?

    For example: If have a drop down menu created for Cell A1 with options (Dog 1, Cat 2, Bird 3). Is there a way to fill cell A2 automatically when I select from the drop down menu.
    So if I selected 'Cat' in A1, cell A2 would automatically input the 2.

    I suggest an extensible method that allows you to add other animals:
    This method adds a small table called "Animal Lookup" that matches names (same as in the pop-up menu) with a value.
    The table on the left uses this table to retrieve the value based on the animal:
    B2=VLOOKUP(A2, Animal Lookup :: A:B, 2, 0)
    select B2 and fill down

  • Average of a set of numbers, excluding empty cells (but including cells with a value of zero)

    Hi, I have two tables in my spreadsheet (a personal budget) showing all my expenses spread over time.  In the first table, each column is a month and year, each row is a type of expense (gas, rent, groceries, etc).
    October 2013
    November 2013
    December 2013
    February 2014
    Income
    3000.00
    3200.00
    2800.00
    Gas
    85.00
    95.00
    75.00
    Rent
    1200.00
    1200.00
    1200.00
    Groceries
    110.00
    130.00
    150.00
    Eating Out
    92.00
    76.00
    80.00
    Clothes
    0.00
    90.00
    30.00
    The second table is this month's expenses so far (I enter the figures for "X Month, So Far" in a third table, which doesn't factor in here).
    December 2013, So Far
    Average +/-
    Income
    2800.00
    -200.00
    Gas
    75.00
    -15.00
    Rent
    1200.00
    0
    Groceries
    150.00
    +30.00
    Eating Out
    80.00
    -4.00
    Clothes
    30.00
    -15.00
    I want the correct formula for the Average +/- column.  I want it to calculate the monthly average for that particular type of expense, and then calculate the difference from this month's expenses so far.  The key is that I want it to add all the sums from a particular row with any value in their cells, even if it's zero. For instance, all of the examples above would divide the sums by two - even the row for Clothes, which has a cell with 0.00, but I would need that to count as a value. 
    Also, when calculating the average, I would want the formula to exclude the current month, which is entered automatically in the next column.
    I would need a formula I wouldn't have to change every month.  Can you help?

    Hi sk,
    "The key is that I want it to add all the sums from a particular row with any value in their cells, even if it's zero. For instance, all of the examples above would divide the sums by two - even the row for Clothes, which has a cell with 0.00, but I would need that to count as a value."
    What you've described is the default condition for AVERAGE over a range of cells—any cell containing a numerical value is included, and cell that is empty or contains a text value is ignored. Here are some examples:
    Creating a constant formula that will ignore the current (and future) month(s) can be done by ensuring that the amounts in the current month are seen as Text, rather than as numbers, as I've done in column C of row 6.
    This can be done using a formula to transfer amounts from the 'third table' you mention to the first table in your example (showing monthly expenses for earlier months and partial totals for the current month). The formula would use IF to add text to the begining or end of the totals IF the column was for the current month, but to transfer of=nly the monthly totals for previous months.
    =IF(earlier-month,"xx"&formula,formula)
    Both instances of formula are the same—whatever formula you are currently using to transfer the amounts to this tabe.
    An alternate method would be to add a second header row to the top of the forst table, and place checkboxes into thoes cells. Check the box when you want to incude that column's values in the averages.
    For this method, AVERAGE would be replaced with AVERAGEIF, with the 'IF' condition a simple reference to the row of checkbox cells. As each month passed, the only change needed would be to check the box in the just-passed month's column.
    Regards,
    Barry

  • After the download of the new version of numbers the cells with formulars are not updated automatically after changing values in cells in the formular. In the previous version this was done automatically. How to make it work again?

    Downloaded new version of Numbers last night. Formulars in excisting spreadsheets are not working anymore.
    Pls. Help.

    You need to give a lot more information if you are to grt help. What are the formulas and how are you using them?

  • Problem with lookup xref not happening Properly

    Hi All,
    we are facing an issue in lookup xref.
    Sometimes the lookup xref happens correctly and sometimes we get empty value from lookup xref even if the xref table has data properly populated.
    Check the below 2 cases.
    CASE-A:
    This mainly happens in the following scenario:
    BPEL A (Populate xref with itemid)------------> ESB ---------->BPEL B (lookup the itemid from the same xref)
    1)     The xref table is populated in a BPEL process A.
    2)     Payload passes through ESB and reaches BPEL B.
    3)     In Process B, we try to look up the same value populated in BPEL A, although the data is inserted in lookup table, it did not get committed to DB as it is a single flow.
    This issue is occuring intermittently due to which the entire process is failing.
    Hence , Request you to let us know how can this issue will be resolved.
    CASE-B:
    Where as Lookup works properly in the following scenario:
    BPEL C (Populate xref with itemid)<---> BPEL A----------> ESB ---------->BPEL B (lookup the itemid from the same xref)
    1)     BPEL A calls BPEL C.
    2)     The xref table is populated in a BPEL process C.
    3)     Control comes back to BPEL A.
    4)     Payload passes through ESB and reaches BPEL B.
    5)     In Process B, we try to look up the same value populated in BPEL C, now the data gets committed.
    We are facing issue with Case-A due to which the entire process is failing. Hence, Request you to let us know how can it will get resolved.
    Thanks
    Narendra
    Mailto: [email protected]

    Hi Narendra,
    Are you still having this problem?
    Just in case you are:
    Please check the descriptor properties of the ABCS processes
    Are they async or sync? If 'sync' make them transaction 'required'.
    Cause: The lookup fails at Provider because there is no data in the XREF_DATA (or ur custom xref table).
    The ReqABCS is inserting data into the table but actually will not Commit it until the Provider has successfully completed.
    If the processes are async or have a savepoint then you should be able to see the data in the xref even before the ProvABCS call and the problem shouldnt occur; however if its sync then all the processes must be in a single transaction for xref data to be "visible" at ProvABCS.
    --thanks
    debashis

  • ABAP WebDynpro: Table cells with different values.

    Hello,
    I am not sure how the following can be achieved.
    I have a table with 10 rows in it. First column should have different values in cells (static value that do not come from anywhere). For example, colors: black, green, yellow, etc.
    I inserted a table column. In that column I inserted a Cell Editor of type TextView. If I define a 'text' property of this element than it marks all cells in this column with this text. I need to assign different values to each cell.
    How can this be done?
    Thank you.

    Probably you should post this the Web Dynpro Forum
    Web Dynpro Java
    Regards,
    Ravi
    Note : Please close this thread.

  • Mouse over values not displaying properly for the Combination Chart

    Hi All,
    A Combination Chart has the following details:
    Primary Y Axis has Revenue in mn $.
    Secondary Y Axis has %.
    When the mouse over is being done, 4% is being displayed as .04
    It should be displayed 4% & not as .04
    The Mouse over values has the Number format as u201CNumericu201D.
    Sometimes, it works in u201CGeneralu201D format. (%)
    However, there is no control on the no of decimal places displayed for the value of Revenue (Primary Y Axis value).
    Whereas, in Numeric format, decimal places can be adjusted.
    Secondary vertical(value) Axis Labels has "Percent" as the Number format.
    Please suggest a solution.
    Thanks,
    Raghu Ram

    Hello.
    Look I have an idea, I donu2019t know if you already try it.
    Please give the format that you want percentage, decimals etc...
    In the Excel where the charts are being directed
    Then redirect de chart to the same cells, these with the porpoise of refreshing
    Now each serie have the format.
    Please let me now what happen with these

Maybe you are looking for