Displaying graphical representation of data in hash tables as bar chart?

I want to be able to display results in my hash table as a bar chart i don't know how to do it could someone help me I've looked through tutorials couldn't find any information that actually helped.
In my program it doesnt allow matching the capital and small letters
so for instance if I already have Mike it allows for me to input mike in again so there are 2 Mikes.
I also want to do a simple user interface the tutorial for it is not simple to understand could any one tell me how to create a simple user interface like putting a button into a place wher i want it to be.
im not asking anyone to do it for me i just want people to show me how to do it
thank you
Edited by: Tek_Hedef on Dec 1, 2007 4:30 AM

Thanks for the ideas pal but I did have a go at it but my bit of code is making it crash but i removed it now so here's what I have so far
import java.io.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
class StudentDetails extends JFrame implements ActionListener
     private JTextField StudentNameTxt, StudentMarkTxt;
    private JButton DeleteStudentDetailsBtn, DisplayAllStudentsBtn, SearchStudentBtn, FailedStudentsBtn, PassedStudentsBtn, DistinctionStudentsBtn, AddStudentDetailsBtn, ExitBtn;
    private JPanel DisplayStudentDetailsPnl;
    private JLabel StudentNameLbl, StudentMarkLbl;
    private JTextArea DisplayResultsTxt;
    private Hashtable StudentDetailsTbl;
    private String StudentName, StudentMark;
    public static void main(String[] args)
        StudentDetails frame = new StudentDetails();
         frame.setSize(600,600);
        frame.createGUI();
        frame.setVisible(true);
    public void display(JPanel DisplayStudentDetailsPnl)
        Graphics paper = DisplayStudentDetailsPnl.getGraphics();
        paper.setColor(Color.white);
        paper.fillRect(0, 0, 500, 500);
        paper.setColor(new Color((int)(Math.random()*255),(int)(Math.random()*255),(int)(Math.random()*255) ));
    private void createGUI()
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        Container window = getContentPane();
        window.setLayout(new FlowLayout());
        StudentDetailsTbl = new Hashtable();
        StudentNameLbl = new JLabel("Student Name");
        window.add(StudentNameLbl);
        StudentNameTxt = new JTextField(15);
        window.add(StudentNameTxt);
        StudentMarkLbl = new JLabel("Student Mark");
        window.add(StudentMarkLbl);
        StudentMarkTxt = new JTextField(3);
        window.add(StudentMarkTxt);
        AddStudentDetailsBtn = new JButton("Add Student and Mark");
        window.add(AddStudentDetailsBtn);
        AddStudentDetailsBtn.addActionListener(this);
        DeleteStudentDetailsBtn = new JButton("Delete Student");
        window.add(DeleteStudentDetailsBtn);
        DeleteStudentDetailsBtn.addActionListener(this);
        DisplayAllStudentsBtn = new JButton("Display all Students and Marks");
        window.add(DisplayAllStudentsBtn);
        DisplayAllStudentsBtn.addActionListener(this);
        SearchStudentBtn = new JButton("Search Student");
        window.add(SearchStudentBtn);
        SearchStudentBtn.addActionListener(this);
        FailedStudentsBtn = new JButton("Students which Failed");
        window.add(FailedStudentsBtn);
        FailedStudentsBtn.addActionListener(this);
        PassedStudentsBtn = new JButton("Students which Passed");
        window.add(PassedStudentsBtn);
        PassedStudentsBtn.addActionListener(this);
        DistinctionStudentsBtn = new JButton("Students with Distinction");
        window.add(DistinctionStudentsBtn);
        DistinctionStudentsBtn.addActionListener(this);
        ExitBtn = new JButton("Exit");
        window.add(ExitBtn);
        ExitBtn.addActionListener(this);
        DisplayResultsTxt = new JTextArea();
        DisplayResultsTxt.setPreferredSize(new Dimension(200, 200));
        DisplayResultsTxt.setBackground(Color.white);
        window.add(DisplayResultsTxt);
        DisplayResultsTxt.enable(false);
    public void actionPerformed (ActionEvent e)
         if (e.getSource()== AddStudentDetailsBtn)
              StudentName = StudentNameTxt.getText();
               StudentMark = StudentMarkTxt.getText();
              DisplayResultsTxt.setText("");
              StudentDetailsTbl.put(StudentName, StudentMark);
            Enumeration enumStudentName = StudentDetailsTbl.keys();
            Enumeration enumStudentMark = StudentDetailsTbl.elements();
            String[] keys = (String[]) StudentDetailsTbl.keySet().toArray(new String[0]);       
            Arrays.sort(keys); 
                for (String key : keys)
                     DisplayResultsTxt.append(key + " : " + StudentDetailsTbl.get(key)+ "\n");
                StudentNameTxt.setText("");
                StudentMarkTxt.setText("");
         if (e.getSource() == DeleteStudentDetailsBtn )
         if (StudentDetailsTbl.containsKey(StudentNameTxt.getText().trim()))
              DisplayResultsTxt.setText("");     
              String txt = StudentNameTxt.getText();
            Enumeration enumStudentName = StudentDetailsTbl.keys()  ;                   
                String currentelement = (String)enumStudentName.nextElement();
                 StudentDetailsTbl.remove(txt);
                 DisplayResultsTxt.append(txt + " has been deleted");  
        if (e.getSource() == SearchStudentBtn)
        if (StudentDetailsTbl.containsKey(StudentNameTxt.getText().trim()))
             String txt = StudentNameTxt.getText();
             String result;
             DisplayResultsTxt.setText("");
             Enumeration enumStudentName = StudentDetailsTbl.keys();
            Enumeration enumStudentMark = StudentDetailsTbl.elements();
               while (enumStudentName.hasMoreElements())
                    String currentelement = (String)enumStudentName.nextElement();
                result = (StudentDetailsTbl.get(currentelement).toString());
                    if (txt.equals(currentelement))
                         DisplayResultsTxt.append(currentelement + " " + result);
                    else JOptionPane.showMessageDialog(null, "Student Name could not be identified");
        if (e.getSource() == DisplayAllStudentsBtn)
              DisplayResultsTxt.setText("");
             Enumeration enumStudentName = StudentDetailsTbl.keys();
            Enumeration enumStudentMark = StudentDetailsTbl.elements();
            while (enumStudentName.hasMoreElements())
            DisplayResultsTxt.append(enumStudentName.nextElement()+ " " + enumStudentMark.nextElement()+ "\n");
        if (e.getSource() == PassedStudentsBtn)
             DisplayResultsTxt.setText("");
             Enumeration enumStudentName = StudentDetailsTbl.keys();
            Enumeration enumStudentMark = StudentDetailsTbl.elements();
            while (enumStudentName.hasMoreElements())
                 int Mark = Integer.parseInt((String)enumStudentMark.nextElement());
                 String Name = (String)enumStudentName.nextElement();
                 if (Mark >=40)
                      DisplayResultsTxt.append(Name + " " + Mark + "\n");
        if (e.getSource() == FailedStudentsBtn)
             DisplayResultsTxt.setText("");
             Enumeration enumStudentName = StudentDetailsTbl.keys();
            Enumeration enumStudentMark = StudentDetailsTbl.elements();
            while (enumStudentName.hasMoreElements())
                 int Mark = Integer.parseInt((String)enumStudentMark.nextElement());
                 String Name = (String)enumStudentName.nextElement();
                 if (Mark <40)
                      DisplayResultsTxt.append(Name + " " + Mark + "\n");
        if (e.getSource() == DistinctionStudentsBtn)
             DisplayResultsTxt.setText("");
             Enumeration enumStudentName = StudentDetailsTbl.keys();
            Enumeration enumStudentMark = StudentDetailsTbl.elements();
            while (enumStudentName.hasMoreElements())
                 int Mark = Integer.parseInt((String)enumStudentMark.nextElement());
                 String Name = (String)enumStudentName.nextElement();
                 if (Mark >=75)
                      DisplayResultsTxt.append(Name + " " + Mark + "\n");
}

Similar Messages

  • How can I show a 0% range in the data value label on a bar chart thanks?

    How can I show a 0% range in the data value label on a bar chart thanks?

    I'm not sure what the question is. 
    I know that if you have a bar chart and one of the categories (X-axis) has bar (Y value) equal to 0%, no bar is plotted for that category. Even the addition of a stroke (line) around the bars doesn't make one appear for 0%.  The only automatic way I know of to make it look like there is data in that category is to add the value labels to the bars. Inspector/Chart/Series, select one of the bars on the chart, click on "value labels". Another method that is a workaround is to fudge the number a little in your table so that instead of 0% it is a very small %.  This will get you a thin line on the chart.
    But if your question is about the value labels (the numbers that display on or in the bars) and you are not getting one for a bar that is supposed to be 0%, it probably means your table doesn't actually have a 0% in the corresponding cell. A blank cell in the table will not get a value label.

  • Display ISO week number instead of date on x axis in Bar Chart

    Hi,
    I've created a simple SSRS report based on bar chart that shows several milestones. Everything works fine for me except I’m not able to convert the date into ISO week number format.
    I played around with different approaches. I was able to convert the date into an ISO week Format directly on the SQL Server. That
    wasn't a problem.
    But unfortunately I’m not able to display the week number on the horizontal axis in my Bar Chart. I tried both fields: TaskFinishDate and TaskFinishDateMS...
    I would like to show the ISO week number instead of the date within the Bar Chart on the horizontal axis.
    Any ideas/hints/help is really appreciated!
    Thanks,
    Mike

    Hi Mike,
    Per my understanding that you want to get the week number of the year based on the field "TaskFinishDate" which is datetime type and display the week number in the x-axis instead of the field "TaskFinishDate", right?
    I have check the snapshot you have provided and it seems you have change the format of the datetime field in the x-axis like "dd.MM.YYYY", If you can't make the week number to display correctly in the x-axis, the issue can be caused by you haven't
    change the format to Number in the category.
    Details information below for you reference:
    I assume you have use expression in the Label like below to convert the datatime TaskFinishDate in to ISO week number like below:
    =DatePart(DateInterval.WeekOfYear,Fields!TaskFinishDate.Value)
    or
    =DatePart("ww",Fields!TaskFinishDate.Value)
    Right click the X-axis and select the "Horizontal Axis Properties", then click the Number to change the format to "Number" as below:
    Preview you will get the weeknumber display in the x-axis correctly.
    If you still have any problem, please feel to ask.
    Regards,
    Vicky Liu
    If you have any feedback on our support, please click
    here.
    Vicky Liu
    TechNet Community Support

  • Suppress zero values for data labels in a stacked bar chart.

    I've seen this question asked before, but I can't seem to find anyone who knows how to do this.  I've made a stacked bar chart from a crosstab result, and I don't want to show labels that have a zero value.  This seems like others would have this same issue as it can really clutter up a chart.  The link below shows my chart.  I am trying to remove the labels that say "On-PW 0"
    http://i1199.photobucket.com/albums/aa472/gno722/question%20examples/crystalquestion.jpg

    the steps below will work on a regular chart..not sure about stacked...
    1) in Preview mode of the report click on a Y axis value and go to Data Y Axis Options
    2) go to Scale and set  a Minimum Value of .001
    3) check the Don't Draw Out Of Scale Values
    cheers,
    jamie

  • Aspx not displaying graphics, report missing data

    Post Author: Lokiarmos
    CA Forum: .NET
    I have a aspx application that loads a report and filters the report based on some paramaters pass to it. Now i my development library (WinXP SP2) it works fine but when i publish it to the webserver that is hosting it (Server2K3 SP2) i get a issue where none of the icons for the crystal report viewer are visible (it works under development fine) as well as only a portion of the report is visible.
    Any Suggestions or solutions to fix this.

    Post Author: dml256
    CA Forum: .NET
    have you done the merge utility to get the keycodev2.dll and everything in synch? When we "try/catch" everything for gracefull error handling, it can be very hard to debug. Capture those error messages, and i think you will see somthing about keycodev2.dll. See the deployment whitepaper.
    http://support.businessobjects.com/communityCS/TechnicalPapers/crnet_deployment.pdf

  • How to create hashed table in runtime

    hi experts
    how to create hashed table in runtime, please give me the coading style.
    please help me.
    regards
    subhasis

    Hi,
    Have alook at the code, and pls reward points.
    Use Hashed Tables to Improve Performance :
    report zuseofhashedtables.
    Program: ZUseOfHashedTables                                        **
    Author: XXXXXXXXXXXXXXXXXX                                 **
    Versions: 4.6b - 4.6c                                              **
    Notes:                                                             **
        this program shows how we can use hashed tables to improve     **
        the responce time.                                             **
        It shows,                                                      **
           1. how to declare hashed tables                             **
           2. a cache-like technique to improve access to master data  **
           3. how to collect data using hashed tables                  **
           4. how to avoid deletions of unwanted data                  **
    Results: the test we run read about 31000 rows from mkpf, 150000   **
             rows from mseg, 500 rows from makt and 400 from lfa1.     **
             it filled ht_lst with 24500 rows and displayed them in    **
             alv grid format.                                          **
             It needed about 65 seconds to perform this task (with     **
             all the db buffers empty)                                 **
             The same program with standard tables needed 140 seconds  **
             to run with the same recordset and with buffers filled in **
    Objetive: show a list that consists of  all the material movements **
             '101' - '901' for a certain range of dates in mkpf-budat. **
    the columns to be displayed are:                                   **
             mkpf-budat,                                               **
             mkpf-mblnr,                                               **
             mseg-lifnr,                                               **
             lfa1-name1,                                               **
             mkpf-xblnr,                                               **
             mseg-zeile                                                **
             mseg-charg,                                               **
             mseg-matnr,                                               **
             makt-maktx,                                               **
             mseg-erfmg,                                               **
             mseg-erfme.                                               **
    or show a sumary list by matnr - menge                             **
    You'll have to create a pf-status called vista -                   **
    See form set_pf_status for details                                 **
    tables used -
    tables: mkpf,
            mseg,
            lfa1,
            makt.
    global hashed tables used
    data: begin of wa_mkpf, "header
          mblnr like mkpf-mblnr,
          mjahr like mkpf-mjahr,
          budat like mkpf-budat,
          xblnr like mkpf-xblnr,
          end of wa_mkpf.
    data: ht_mkpf like hashed table of wa_mkpf
          with unique key mblnr mjahr
          with header line.
    data: begin of wa_mseg, " line items
          mblnr like mseg-mblnr,
          mjahr like mseg-mjahr,
          zeile like mseg-zeile,
          bwart like mseg-bwart,
          charg like mseg-charg,
          matnr like mseg-matnr,
          lifnr like mseg-lifnr,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          end of wa_mseg.
    data ht_mseg like hashed table of wa_mseg
          with unique key mblnr mjahr zeile
          with header line.
    cache structure for lfa1 records
    data: begin of wa_lfa1,
          lifnr like lfa1-lifnr,
          name1 like lfa1-name1,
          end of wa_lfa1.
    data ht_lfa1 like hashed table of wa_lfa1
          with unique key lifnr
          with header line.
    cache structure for material related data
    data: begin of wa_material,
          matnr like makt-matnr,
          maktx like makt-maktx,
          end of wa_material.
    data: ht_material like hashed table of wa_material
            with unique key matnr
            with header line.
    result table
    data: begin of wa_lst, "
          budat like mkpf-budat,
          mblnr like mseg-mblnr,
          lifnr like mseg-lifnr,
          name1 like lfa1-name1,   
          xblnr like mkpf-xblnr,
          zeile like mseg-zeile,
          charg like mseg-charg,
          matnr like mseg-matnr,
          maktx like makt-maktx,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          mjahr like mseg-mjahr,
          end of wa_lst.
    data: ht_lst like hashed table of wa_lst
            with unique key mblnr mjahr zeile
            with header line.
    data: begin of wa_lst1, " sumary by material
          matnr like mseg-matnr,
          maktx like makt-maktx,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          end of wa_lst1.
    data: ht_lst1 like hashed table of wa_lst1
            with unique key matnr
            with header line.
    structures for alv grid display.
    itabs
    type-pools: slis.
    data: it_lst            like standard table of wa_lst with header line,
          it_fieldcat_lst   type slis_t_fieldcat_alv with header line,
          it_sort_lst       type slis_t_sortinfo_alv,
          it_lst1           like standard table of wa_lst1 with header line,
          it_fieldcat_lst1  type slis_t_fieldcat_alv with header line,
          it_sort_lst1      type slis_t_sortinfo_alv.
    structures
    data: wa_sort         type slis_sortinfo_alv,
          ls_layout       type slis_layout_alv.
    global varialbes
    data: g_lines type i.
    data: g_repid like sy-repid,
          ok_code       like sy-ucomm.
    selection-screen
    "text: Dates:
    select-options: so_budat for mkpf-budat default sy-datum.
    "text: Material numbers.
    select-options: so_matnr for mseg-matnr.
    selection-screen uline.
    selection-screen skip 1.
    "Text: show summary by material.
    parameters: gp_bymat as checkbox default ''.
    start-of-selection.
      perform get_data.
      perform show_data.
    end-of-selection.
          FORM get_data                                                 *
    form get_data.
            select mblnr mjahr budat xblnr
                into table ht_mkpf
               from mkpf
              where budat in so_budat. " make use of std index.
    have we retrieved data from mkpf?
      describe table ht_mkpf lines g_lines.
      if g_lines > 0.
    if true then retrieve all related records from mseg.
    Doing this way we make sure that the access is by primary key
    of mseg.
    The reason is that is faster to filter them in memory
    than to allow the db server to do it.
        select mblnr mjahr zeile bwart charg
                 matnr lifnr erfmg erfme
          into table ht_mseg
          from mseg
            for all entries in ht_mkpf
         where mblnr = ht_mkpf-mblnr
           and mjahr = ht_mkpf-mjahr.
      endif.
    fill t_lst or t_lst1 according to user's choice.
      if gp_bymat = ' '.
        perform fill_ht_lst.
      else.
        perform fill_ht_lst1.
      endif.
    endform.
    form fill_ht_lst.
      refresh ht_lst.
    Example: how to discard unwanted data in an efficient way.
      loop at ht_mseg.
      filter unwanted data
        check ht_mseg-bwart = '101' or ht_mseg-bwart = '901'.
        check ht_mseg-matnr in so_matnr.
      read header line.
        read table ht_mkpf with table key mblnr = ht_mseg-mblnr
        mjahr = ht_mseg-mjahr.
        clear ht_lst.
    * note : this may be faster if you specify field by field.
        move-corresponding ht_mkpf to ht_lst.
        move-corresponding ht_mseg to ht_lst.
        perform read_lfa1 using ht_mseg-lifnr changing ht_lst-name1.
        perform read_material using ht_mseg-matnr changing ht_lst-maktx.
        insert table ht_lst.
      endloop.
    endform.
    form fill_ht_lst1.
      refresh ht_lst1.
    Example: how to discard unwanted data in an efficient way.
             hot to simulate a collect in a faster way
      loop at ht_mseg.
      filter unwanted data
        check ht_mseg-bwart = '101' or ht_mseg-bwart = '901'.
        check ht_mseg-matnr in so_matnr.
    * note : this may be faster if you specify field by field.
        read table ht_lst1 with table key matnr = ht_mseg-matnr
        transporting erfmg.
        if sy-subrc <> 0. " if matnr doesn't exist in sumary table
        " insert a new record
          ht_lst1-matnr = ht_mseg-matnr.
          perform read_material using ht_mseg-matnr changing ht_lst1-maktx.
          ht_lst1-erfmg = ht_mseg-erfmg.
          ht_lst1-erfme = ht_mseg-erfme.
          insert table ht_lst1.
        else." a record was found.
        " collect erfmg.  To do so, fill in the unique key and add
        " the numeric fields.
          ht_lst1-matnr = ht_mseg-matnr.
          add ht_mseg-erfmg to ht_lst1-erfmg.
          modify table ht_lst1 transporting erfmg.
        endif.
      endloop.
    endform.
    implementation of cache for lfa1.
    form read_lfa1 using p_lifnr changing p_name1.
            read table ht_lfa1 with table key lifnr = p_lifnr
            transporting name1.
      if sy-subrc <> 0.
        clear ht_lfa1.
        ht_lfa1-lifnr = p_lifnr.
        select single name1
           into ht_lfa1-name1
          from lfa1
        where lifnr = p_lifnr.
        if sy-subrc <> 0. ht_lfa1-name1 = 'n/a in lfa1'. endif.
        insert table ht_lfa1.
      endif.
      p_name1 = ht_lfa1-name1.
    endform.
    implementation of cache for material data
    form read_material using p_matnr changing p_maktx.
      read table ht_material with table key matnr = p_matnr
      transporting maktx.
      if sy-subrc <> 0.
        ht_material-matnr = p_matnr.
        select single maktx into  ht_material-maktx
          from makt
         where spras = sy-langu
           and matnr = p_matnr.
        if sy-subrc <> 0. ht_material-maktx = 'n/a in makt'. endif.
        insert table ht_material.
      endif.
      p_maktx = ht_material-maktx.
    endform.
    form show_data.
      if gp_bymat = ' '.
        perform show_ht_lst.
      else.
        perform show_ht_lst1.
      endif.
    endform.
    form show_ht_lst.
      "needed because the FM can't use a hashed table.
      it_lst[] = ht_lst[].
      perform fill_layout using 'full display'
                           changing ls_layout.
      perform fill_columns_lst.
    perform sort_lst.
      g_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = g_repid
                i_callback_pf_status_set = 'SET_PF_STATUS'
                is_layout                = ls_layout
                it_fieldcat              = it_fieldcat_lst[]
               it_sort                  = it_sort_lst
           tables
                t_outtab                 = it_lst
           exceptions
                program_error            = 1
                others                   = 2.
    endform.
    form show_ht_lst1.
      "needed because the FM can't use a hashed table.
      it_lst1[] = ht_lst1[].
      perform fill_layout using 'Sumary by matnr'
                           changing ls_layout.
      perform fill_columns_lst1.
    perform sort_lst.
      g_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = g_repid
                i_callback_pf_status_set = 'SET_PF_STATUS'
                is_layout                = ls_layout
                it_fieldcat              = it_fieldcat_lst1[]
               it_sort                  = it_sort_lst
           tables
                t_outtab                 = it_lst1
           exceptions
                program_error            = 1
                others                   = 2.
    endform.
    form fill_layout using p_window_titlebar
                   changing cs_layo type slis_layout_alv.
      clear cs_layo.
      cs_layo-window_titlebar        = p_window_titlebar.
      cs_layo-edit                   = 'X'.
      cs_layo-edit_mode              = space.
    endform.                    " armar_layout_stock
    form set_pf_status using rt_extab type slis_t_extab.
    create a new status
    and then select extras -> adjust template -> listviewer
      set pf-status 'VISTA'.
    endform.        "set_pf_status
    define add_lst.
      clear it_fieldcat_lst.
      it_fieldcat_lst-fieldname     = &1.
      it_fieldcat_lst-outputlen     = &2.
      it_fieldcat_lst-ddictxt       = 'L'.
      it_fieldcat_lst-seltext_l       = &1.
      it_fieldcat_lst-seltext_m       = &1.
      it_fieldcat_lst-seltext_m       = &1.
      if &1 = 'MATNR'.
        it_fieldcat_lst-emphasize = 'C111'.
      endif.
      append it_fieldcat_lst.
    end-of-definition.
    define add_lst1.
      clear it_fieldcat_lst.
      it_fieldcat_lst1-fieldname     = &1.
      it_fieldcat_lst1-outputlen     = &2.
      it_fieldcat_lst1-ddictxt       = 'L'.
      it_fieldcat_lst1-seltext_l       = &1.
      it_fieldcat_lst1-seltext_m       = &1.
      it_fieldcat_lst1-seltext_m       = &1.
      append it_fieldcat_lst1.
    end-of-definition.
    form fill_columns_lst.
    set columns for output.
      refresh it_fieldcat_lst.
      add_lst 'BUDAT' 10.
      add_lst   'MBLNR' 10.
      add_lst  'LIFNR' 10.
      add_lst  'NAME1' 35.
      add_lst  'XBLNR' 15.
      add_lst    'ZEILE' 5.
      add_lst    'CHARG' 10.
      add_lst   'MATNR' 18.
      add_lst   'MAKTX' 30.
      add_lst   'ERFMG' 17.
      add_lst   'ERFME' 5.
      add_lst   'MJAHR' 4.
    endform.
    form fill_columns_lst1.
    set columns for output.
      refresh it_fieldcat_lst1.
      add_lst1 'MATNR' 18.
      add_lst1 'MAKTX' 30.
      add_lst1 'ERFMG' 17.
      add_lst1 'ERFME' 5..
    endform.
    Regards,
    Ameet

  • OBIEE: How to sort a bar chart by a measure not displayed in the chart?

    I have a table with OEM sales volume comparisons between two periods, current year and previous year. I have calculated a "VOLUME CHANGE" measure by subtracting last year's volume total column from this year's volume total column, and would like to display the resulting VOLUME CHANGE column in a horizontal bar chart.
    However, I want the bar chart sorted in descending order by the sales volume total column rather than the value of the calculated "VOLUME CHANGE" that is displayed.
    Can someone help me make this happen?
    In Answers I can make a bar chart sort according to any sort applied to a measure IF YOU INCLUDE THE SORTED MEASURE IN THE CHART, but I can't readily see how to do this if you wish to only include one measure in the chart but sort it by another measure from the same table.
    Help would be appreciated.
    Thanks.

    Well, we have some kind of disconnect.
    I see that the first value on the horizontal axis will supply the sort. The sort depends on the default, or whatever sort you have set on the column in the Criteria tab.
    But if I remove that measure from the chart, I lose the sort and it defaults back to sorting by BRAND, alphabetically.
    I can't see any options for hiding the measure in the chart itself and preserving the sort by the hidden measure. I know how to do that quite easily in Tableau, but I can't find it here. In the Criteria tab when I go to "column properties" the only option tabs I see are "Style", "Column Format", "Data Format", "Conditional Format" and "Interaction" and none of those offer any option for hiding the column.
    When you go to the results tab and then edit the layout of the resulting data table, you do get options to hide columns in the results table. But they still show up by default when you create a chart based on the table. From the editing options for the chart itself I see no option for hiding any of the measures, only the option to drop the measures down to the "Excluded" box, at which point they a cleared from the chart along with any associated sort settings.
    Is there any way to include a screen shot with the post?
    Can someone be more specific about where the menus and options are to make this happen?

  • Data values on Bar Chart in a BI Publisher report (11g)

    I have a bar chart that I created via the layout editor in BI Publisher 11g, and I'm displaying the data values on the chart. That part works great. However, we're noticing that the chart adds zeros to the end of the data values depending on the length of the number being passed to the chart. My data item is a number that is 5 bytes in total, with 2 decimals. If the data value is *10.10*, the data displayed on the bar chart shows *10.10*. But when my data value is *1.10*, the data displayed on the bar chart is *1.100*. And if my data value is *.10*, the bar chart displays *0.1000*. The bar chart adds zeros to the end as the number of characters to the left of the decimal decreases.
    I don't see a way to make it not do that. Has anyone else run into this, and been able to change it?

    Basically what are you trying to do :
    Attaching Mutiple Data Definition to a XML Program and deciding which one to call ased on parameter.Sorry you can not do that one Data DEfinition per Report.
    ut there is one way of doing that.
    Create multiple data defintion( mutiple programs) and then a master program something like
    IF Master Program Param1 = 'X'
    call BI Program 1
    ELSIF Master Program Param1 = 'Y'
    call I Program 2....
    End IF;

  • Show Data labels on stacked bar chart

    Hi All:
    I am trying to show an inside data label on a stacked bar chart.  For some reason Flex 4 does not like labelPosition="inside" in the mx below.   Thanks  Bob
    <mx:BarChart 
    id="ProxChart" x="85" y="76" height="192" width="630" type="stacked">
    <mx:horizontalAxis>  
    <mx:LinearAxis maximum="20"/>  
    </mx:horizontalAxis>
    <mx:series>
    <mx:BarSeries id="MySeries" displayName="Test" xField="" labelPosition="inside"/>

    This will do it.
    import mx.charts.*;
    private function myLabelFunction(element:ChartItem, series:BarSeries):String
      return(element.item.toFixed(1));
    <mx:series>
      <mx:BarSeries id="MySeries" displayName="Test" xField="" labelPosition="inside" labelFunction="myLabelFunction"/>

  • Display data from diferent tables

    My requirement is to display data from diferent tables supose tables likeVBAK and VBAP.it will allow for all entries concept oops abap?.
    how to write code for display data from diferent tables .
    method WDDOINIT.
    data:
    node_sflight type  ref to if_wd_context_node,
    Itab_sflight type standard table of SFLIGHT.
    select * from SFLIGHT into table Itab_sflight.
    node_sflight = wd_context->get_child_node( name = 'SFLIGHT_NODE' ).
    node_sflight->bind_table( itab_sflight ).
    endmethod.
    Thanks,
    Rama

    HI,
    IS IT CORRECT WAY OF DONIG CODING?
    IF I AM WORNG PLEASE SUGEST ME.
    method WDDOINIT.
    data:
    node_sflight type ref to if_wd_context_node,
    final type standard table of vbap.
    types: begin of t_vbak,
    vbeln type vbak-vbeln,
    end of t_vbak.
    endmethod.
    data wa_vbak type t_vbak.
    data i_vbak type standard table of t_vbak.
    types: begin of t_vbap,
    vbeln type vbap-vbeln,
    posnr type vbap-posnr,
    matnr type vbap-matnr,
    end of t_vbap.
    data wa_vbap type t_vbap.
    data i_vbap type standard table of t_vbap.
    select vbeln from vbak into table I_vbak.
    select vbeln posnr matnr from vbap into table I_vbap
    for all entries in I_vbak
    where vbeln = i_vbak-vbeln.
    loop at I_vbak.
    read table i_vbap with key vbeln = I_vbak-vbeln.
    final-vbeln = I_vbap-vbeln.
    final-posnr = I_vbap-posnr .
    final-matnr = I_vbap-matnr .
    append final.
    clear final.
    endloop.
    node_sflight = wd_context->get_child_node( name = 'NODE_VBAP' ).
    node_sflight->bind_table( final ).
    endmethod.
    Thanks,
    rama

  • How to display multiple data from different table in one table? please help

    Hi
    I got sun java studio creator 2(the separate installation not the one in the net beans)....
    My question is about displaying data that have been taken from the database.... I know how to display data in a table(just click on the table "bind data" )... but my question is that:
    when i want to use a sql statement that taken the data from different table...
    how can i display that data in the table(that will be shown in the web) ??? when i click bind data on the table i can only select one table i can't select more than one....
    Note:
    1) i'm using the rowset for displaying the data in the table, since the sql statement is depending on a condition(i.e. select a from b where c= ? )...
    2) i mean by different table is that( i.e. select a from table1,table2 )..
    thanks in advance...

    Hi,
    937440 wrote:
    Hi every one, this is my first post in this portal. Welcome to the forum!
    Be sure to read the forum FAQ {message:id=9360002}
    I want display the details of emp table.. for that I am using this SQL statement.
    select * from emp where mgr=nvl(:mgr,mgr);
    when I give the input as 7698 it is displaying the corresponding records... and also when I won't give any input then it is displaying all the records except the mgr with null values.
    1)I want to display all the records when I won't give any input including nulls
    2)I want to display all the records who's mgr is null
    Is there any way to incorporate to include all these in a single query..It's a little unclear what you're asking.
    The following query always includes rows where mgr is NULL, and when the bind variable :mgr is NULL, it displays all rows:
    SELECT  *
    FROM     emp
    WHERE     LNNVL (mgr != :mgr)
    ;That is, when :mgr = 7698, it displays 6 rows, and when :mgr is NULL it displays 14 rows (assuming you're using the Oracle-supplied scott.emp table).
    The following query includes rows where mgr is NULL only when the bind variable :mgr is NULL, in which case it displays all rows:
    SELECT     *
    FROM     emp
    WHERE     :mgr     = mgr
    OR       :mgr       IS NULL
    ;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL it displays 14 rows.
    The following query includes rows where mgr is NULL only when the bind variab;e :mgr is NULL, in which case it displays only the rows where mgr is NULL. That is, it treats NULL as a value:
    SELECT     *
    FROM     emp
    WHERE     DECODE ( mgr
                , :mgr, 'OK'
                )     = 'OK'
    ;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL, it displays 1 row.

  • Insert record via data tab of table detail display

    I am using SQL Developer 3.0.04
    When I tries to insert more than 200 rows into a table via data tab of table detail display, it takes more than 8 minutes. It takes more than 19 minutes for 400+ rows. It is slow and it is not so slow in previous version (e.g. 1.5.4)
    Had anyone experienced the same issue and is there any workaround (other than loading data via SQL loader and stop using SQL Developer)?
    [Timer of SQL Developer 3.0| http://i.imgur.com/KVAdI.png]

    I've seen this also sometimes but i rarely load large amount of data using SQLDeveloper anyway.
    Please make sure you have patch1 installed and provide information on the database used.
    You can check if patch1 is installed at the
    Help -> About -> Extensionyou should find a "SQL Developer Patch" entry there.

  • Hash tables in combination with data references to the line type.

    I'm having an issue with hash tables - in combination with reference variables.
    Consider the following:  (Which is part of a class)  -  it attempts to see if a particular id exists in a table; if not add it; if yes change it.   
      types: BEGIN OF TY_MEASUREMENT,
               perfid      TYPE zgz_perf_metric_id,
               rtime       TYPE zgz_perf_runtime,
               execount    TYPE zgz_perf_execount,
               last_start  TYPE timestampl,
             END OF TY_MEASUREMENT.
    METHOD START.
      DATA:  ls_measurement TYPE REF TO ty_measurement.
      READ TABLE gt_measurements WITH TABLE KEY perfid = i_perfid reference into ls_measurement.
      if sy-subrc <> 0.
        "Didn't find it.
        create data ls_measurement.
        ls_measurement->perfid = i_perfid.
        insert ls_measurement->* into gt_measurements.
      endif.
      GET TIME STAMP FIELD ls_measurements-last_start.
      ls_measurement->execount = ls_measurement->execount + 1.
    ENDMETHOD.
    I get compile errors on the insert statement - either "You cannot use explicit index operations on tables with types HASHED TABLE" or "ANY TABLE".      It is possible that.
    If I don't dereference the type then I get the error  LS_MEASUREMENT cannot be converted to the line type of GT_MEASUREMENTS.
    I'm not looking to solve this with a combination of references and work ares - want a reference solution.   
    Thanks!
    _Ryan
    Moderator message - Moved to the correct forum
    Edited by: Rob Burbank on Apr 22, 2010 4:43 PM

    I think it might work when you change it for
    insert ls_measurement->* into TABLE gt_measurements.
    For hashed table a new line here will be inserted according to given table key.
    Regards
    Marcin

  • How to Fetch Data From Standard Table MARA and Display using BOPF ?

    Hello All,
    In BOPF creation of Quey to a node fetches data from the Data Base Table attached to that Node,
    But in my requirement I have to fetch data Present in a Standard table and Display it in the FPM List Using FBI.
    **  Can we Fetch the data From Standard Table and fill the Node in BOPF, Is this possible as the standard Table do not contain KEY field which BOPF uses for Data Fetching ?
    Kindly share your Idea's .
    Thanks in Adv.

    Hi Dhivya,
    Thanks For your Response.
    In my Requirement I want to make ROOT Node as Transient Node.
    When I create a Sub Node to a Root Node, I am able to get this option to make this sub node as a Transient Node .
    By selecting   'Standard<-->Extended' option in the Menu item 'GoTo' I am able to get this Transient Node check box field for the Sub Nodes.
    I want to make a ROOT Node as a Transient Node.
    (Which Version you are using, and which transaction you are using to create BO . we are using BOBX Transaction, Version Ehp 6 )
    Kindly Guide me .
    Thanks,
    Kranthi Kumar.

  • Hideing a Column in ALV Table which is Displaying the POWL Query data

    Hi SDNers,
    I want to hide a column of ALV Table which is displaying my POWL Query data in it and hideing should be based on the Role as well. i.e few of the role the column shoudl be hidden and few of the roles should have the Column visible.
    waiting for the Valueble Answers.
    Thanks & Regards,
    Govindu

    Hai Kris,
        I took help from ur link and i declared a global attribute request_number.
    and i created an event handler ON_ALV_INSERT and did the follwing coding for giving default value wen ever am inserting new row.
    FIELD-SYMBOLS: <wa_row> LIKE LINE OF r_param->t_inserted_rows.
      DATA bill_details TYPE REF TO zdom_bill_detail.
      LOOP AT r_param->t_inserted_rows ASSIGNING <wa_row>.
        bill_details ?= <wa_row>-r_value.
        IF bill_details->REQ_NUMBER IS INITIAL.
      DATA lo_nd_bill_detail TYPE REF TO if_wd_context_node.
      DATA lo_el_bill_detail TYPE REF TO if_wd_context_element.
      DATA ls_bill_detail TYPE wd_this->Element_bill_detail.
    navigate from <CONTEXT> to <BILL_DETAIL> via lead selection
      lo_nd_bill_detail = wd_context->get_child_node( name = wd_this->wdctx_bill_detail ).
    lo_el_bill_detail = lo_nd_bill_detail->get_element( index = <wa_row>-index ).
          lo_el_bill_detail->set_attribute(
            EXPORTING
              name  = 'REQ_NUMBER'
              value = wd_comp_controller->request_number
    Wen am  setting the value of wd_comp_controller->request_number to my context attribute am getting NULL object ref error.
    lo_el_bill_detail->set_attribute(
        name =  `REQ_NUMBER`
        value = wd_comp_controller->request_number ).
    Pls give some suggestions,
    Thanks in Advance,
    Nalla.B

Maybe you are looking for