How to make an alv column required
Hello all,
Is there any way to make a column in an alv table required?
Thanks,
raymond
Hi Saravanan,
I tried your suggestion and at first I thought it should work as I als had used that solution to make fields read only or editable.
However, when I use 'SET_STATE_FIELDNAME' and fill the fields with value '00' or '01' nothing happens.
The technique works fine with 'SET_READ_ONLY_FIELDNAME'.
Any suggestion?
Regards,
Raymond
Similar Messages
-
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} -
How to make the vendor column have figure in GRIR line item with RE document type?
Dear Experts,
Could you tell me how to make the vendor column have figure in GRIR line item whose document type is RE?
Thanks!
Xinling ZhangHi ,
You are using FAGLL03 .
FAGLL03 report vendor code is blank
vendor number in new FAGLL03 tcode (offsetting account information)
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30b96fed-eb5d-2e10-1792-f3ff9f65df8a?QuickLink=index&…
Also check OSS note
Note 112312 - Line item: Display of offsetting a/c information
Note 1034354 - FAGLL03: Display of offsetting account information
Many Thanks -
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
RegardsHi,
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 -
How to make a particular column bold in alv?
Dear Experts,
I have searched many threads on this. I have used control break events to get the subotals and totals. The requirement is to make the text and the figure of subtotal and total bold.
I am still not able to find the thread to make a particular column text in bold. And about colouring, I have used collect statement in my final structure so I am unable to use cellcolor type lvc_t_scol.
Is there any way to make the subtotals and totals in bold? If not able, I may go for coloring.
Regards
ManiHello mani,
Try this:
TYPES : BEGIN OF ty_outtab,
celltab TYPE lvc_t_styl.
INCLUDE STRUCTURE mara.
TYPES END OF ty_outtab.
DATA : gt_outtab TYPE TABLE OF ty_outtab WITH HEADER LINE,
gs_layout TYPE lvc_s_layo,
ls_celltab TYPE lvc_s_styl,
lt_celltab TYPE lvc_t_styl.
SELECT * FROM MARA INTO CORRESPONDIG FIELDS OF TABLE gt_outtab UP TO 20 ROWS.
ls_celltab-style = '00000121'.
INSERT ls_celltab INTO lt_celltab INDEX 1.
READ TABLE gt_outtab INDEX 1.
gt_outtab-celltab = lt_celltab.
INSERT gt_outtab INDEX 1.
gs_layout-stylefname = 'CELLTAB'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_structure_name = 'MARA'
is_layout_lvc = gs_layout
TABLES
t_outtab = gt_outtab
EXCEPTIONS
program_error = 1
OTHERS = 2.
I hope you help. -
How to make OO ALV Grid cell is required on data_changed?
Hi all,
I want to make grid cell is required on data_change method. I have two fields dependent each other, so i insert a value on a field, the other field should be obligatory.
I have tried to solve this with "add_protocol_entry" method. But i don't want to display message log. The second field should be drawn with red border.
My sample code is below:
LOOP AT p_data_changed->mt_good_cells INTO ls_good_cells.
CASE ls_good_cells-fieldname.
WHEN 'FIELD1' .
CASE p_sender.
WHEN g_grid.
CALL METHOD p_data_changed->get_cell_value
EXPORTING
i_row_id = ls_good_cells-row_id
i_fieldname = ls_good_cells-fieldname
IMPORTING
e_value = lv_variable.
*-- On this area the second field should be drawn with red border.
ENDCASE.
ENDCASE.
ENDLOOP.
I'm waiting for your helps.Gutten Tag,
I have an idea, how about that you add one more field in your table structure for obtain information about color about each cell. such as "color TYPE lvc_t_scol " and then in your lvc_s_layo, you should fill CTAB_FNAME = 'COLOR'.
Insert this code into your program. (it's a template)
READ TABLE itab WITH KEY <k1> = ..... ASSIGNING <fs>.
APPEND INITIAL LINE TO <fs>-COLOR ASSIGNING <fs_l>.
<fs_l>-fname = 'XXX' . "字段名
<fs_l>-color-col = 6.
<fs_l>-color-int = 1.
<fs_l>-color-inv = 0 . -
How to make a field as required in Page customization
Hi,
Please help me as how can i make a field on Master agreement as required Field in Page customizations.
I am able to hide the same field, but, I am not able to make it as a required field.
RegarsHello Janaki,
Goto page customization under User Interface in System Setup. Once you are there click the Object Name in the page customization list.
1) Click Edit -> Click add button and click pencil icon just in front of newly created entry. In the Field ID field give the Field ID value per the UI View from the RG (Resource Guide).
2) Select Property from the drop down as "Required".
3) Select Yes radio option under the Value. and click ok and then click save.
Thats it. It should make your field as required field.
I hope this helps.
Regards,
Jagjeet Singh -
How to make newly added columns appear In IR report
Hi.
I am using APEX 4.0.1. I've created an IR report and then, subsequently, needed to add several column sto the underlying SQL query.
When I save the changes, APEX tells me that it will add the new columns and that I need to run the IR report and either click "Reset" or use the Actions menu to make the new columns appear in the report. I did the latter and the new columns do appear just fine.
However, when I then tried to modify the column labels, I am unable to see these in the report "Attributes" section. And so, I can't access their labels.
How do I get the new columns to appear in the Attributes section of the iR report?
Thanks in advance for any help.
ElieHi, LittleFoot (sorry, I don't see your actual name).
Thanks very much for responding.
I've done exactly what you've described.
I added several new column sto the SQL query underlying the IR. I then re-ran the default Primary report, added the new columns via the Actions -> Select menus, and then saved the report.
When I then go into the IR Attributes page, the new columns are not there. I've closed/re-opened my browser. I don't know what the issue is.
I'm wondering ... would the fact that the underlying query is SELECTing from a view rather than a table make any difference? I wouldn't think it would.
Thank you for any help.
Elie -
How to make Default ALV layout
Hi,
I want to make 'STANDARD view' as a default ALV Layout...If anybody execute my ALV Report STARD Layout variant should display by default. Other variant layouts they can select from drill down..
I know class and method but i don't know how to write code for this with paremeters..Can anybody help on code please..
CLASS : CL_SALV_WD_C_TABLE
METHOD : IF_SALV_WD_COMP_TABLE_PERS~SET_STANDARD_VIEW
My current ALV CODE
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
DATA: l_value TYPE REF TO cl_salv_wd_config_table.
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
l_value = l_ref_interfacecontroller->get_model( ).
Thanks.,
SubbaHi sarbjeet singh,
Thanks for your reply...
I didn't understand your answer...Already this view gone to production system and every USER created his own view..
Now how can make default standard view to all users..
If i keep Standard view as Intial view and release transport to production is it effected to all users and display standard view as initial view?
Thanks,
Subba -
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)});
} -
Our WPF application uses DataGrid.
One of request is that first column of DataGrid does not show row separator and also does not show Left column separator. So it looks like the first column does not belong to the DataGrid. However, when select a row, the cell of first column still get selected.
How do we make it? Thx!
JaneCHi Magnus,
Thanks for replying our question and provide your solution!
Your solution works by setting "HorizontalGridLinesBrush" and "VerticalGridLinesBrush" to {x:Null} in the DataGrid style and modify "CellStyle" in first column as following:
<DataGridTextColumn MinWidth="32"
Binding="{Binding CellName}"
CanUserReorder="False"
CanUserSort="False"
Header="Cell}"
IsReadOnly="true" >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="IsEnabled" Value="False"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border BorderThickness="0" BorderBrush="{x:Null}"
Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Margin="-1">
<Grid Background="{TemplateBinding Background}" VerticalAlignment="Center" Height="42">
<ContentPresenter VerticalAlignment="Center"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
We found another way to achieve it by using DataGridRowHeader. The good way to use DataGridRowHeader is that we do not need to make the first column ReadOnly (click on first column does not select whole row anymore). Select RowHeader in a row will select
whole row. Move scroll bar horizontally, the row header still keep in visible area.
<Style TargetType="{x:Type DataGridRowHeader}" x:Key="dataGridRowHeaderStyle">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Height" Value="42" />
<Setter Property="SeparatorBrush" Value="{x:Null}" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRowHeader}">
<Grid>
<Border x:Name="rowHeaderBorder"
BorderThickness="0"
Padding="3,0,3,0"
Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
BorderBrush="{x:Null}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DataGrid>
<DataGrid.RowHeaderStyle>
<Style TargetType="DataGridRowHeader" BasedOn="{StaticResource dataGridRowHeaderStyle}">
<Setter Property="Content" Value="{Binding CellName}" />
<Setter Property="Width" Value="35"/>
</Style>
</DataGrid.RowHeaderStyle>
</<DataGrid>
JaneC -
How to make WD ALV Editable Fields (Cell) Mandatory (Obligatory) ?
Hello Friends,
I have requirement where I need to make WD ALV editable inputfield as Mandatory fields. I found out that there is no method available to do this.
If anybody has any solution then please reply to this thread.
Thanks,
ChandraHello Friends,
Thanks for your reply. I just wanted to elaborate more on this so that others will benefit from this thread.
I used method SET_STATE from class CL_SALV_WD_UIE_A_INPUT which is super class for class CL_SALV_WD_UIE_INPUT_FIELD.
The code looks as below,
Data: lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
CALL METHOD lr_input_field->set_state
EXPORTING
value = cl_wd_abstract_input_field=>e_state-required.
well, I just forgot to check super class and its available methods...But got clear hint from Tulasi.
Thanks to all.
Chandra -
How to Make u0091Contactu0092 Profile a required field in BP Maintenance?
We are using "status" tab in the Tcode: /nBP- BP Maintenance and trying to do following two things:
1. Make Contact filed as REQUIRED fields in BP Master in under Status tab, and
2. Restrict one or more communication method(s) as Disallowed while others remain Allowed. Here is the scenario: BP chooses NOT TO BE CALLED on Phone but agrees to receive Letters and/or Emails.
We believe this would require development, but wonder if there are other options, or if anyone has done something similar and would be willing to share?
Thanks in advance,
Purush ChitkaraHi,
Sort Key can be made as mandatory through SPRO settings.
SPRO > Financial Accounting New > Accounts receivable and accounts payable > vendor accounts > Master Data > Preparations for creating vendor master data > Define Account groups with screen layout > Double click on your account group > Double Click on company code data > Double clcik on account management > Make the field sort key as required entry.
Regards,
Prabu -
How to make a grid column a linked column?
Is there any way to make a grid column a linked column?
I have a cardcode column in a grid, which I want to link with BP master link object. If I try to do it the same way I do for matrix, it gives me 'specific cast not valid' error; whereas the same property works fine with matrix.
help will be appreciated...
BinitaYou need to do the following:
string colUid = "yourUid";
oGrid.Columns.Item(colUid).Type = BoGridColumnType.gct_EditText;
EditTextColumn col = (EditTextColumn)oGrid.Columns.Item(colUid)
col.LinkedObjectType = "2"; //2 = Buisness Partner (The id behind the BoLinkeObjectType as a string) -
How to make a entire column editable in an ALV grid
Hi all,
I am trying to make a column editable in an ALV grid. For that I wrote the following code. In the below code I have set the 'edit' field of ls_fcat to 'X'. But Iam getting Runtime error. Can anyone help in resolving this problem or suggest any method to make a column editable in an ALV grid.
form prepare_fc changing go_fieldcat type lvc_t_fcat.
data: ls_fcat type lvc_s_fcat.
refresh: go_fieldcat.
clear: ls_fcat.
ls_fcat-reptext = ' Safety Stock Figures'.
ls_fcat-coltext = 'Safety Stock Figures'.
ls_fcat-fieldname = 'EISBE'.
ls_fcat-ref_table = 'IMAT'.
ls_fcat-edit = 'X'.
modify go_fieldcat from ls_fcat.
APPEND LS_FCAT TO GO_FIELDCAT.
endform.
Thanks & Regards,
Vishnu Priya.ls_fcat-edit = 'X'.
is correct only.
have a look into this code
struct_grid_lset TYPE lvc_s_layo,
i_grid_fcat TYPE lvc_t_fcat
DATA ls_fcat TYPE lvc_s_fcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'MONTH'.
ls_fcat-ref_table = 'TYPE'.
ls_fcat-ref_field = 'C'.
<b> ls_fcat-edit = 'X'.</b>
ls_fcat-coltext = text-030."Month
ls_fcat-seltext = text-030.
APPEND ls_fcat TO p_i_grid_fcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'YEAR'.
ls_fcat-ref_table = 'TYPE'.
ls_fcat-ref_field = 'C'.
ls_fcat-coltext = text-031."Year
ls_fcat-seltext = text-031.
APPEND ls_fcat TO p_i_grid_fcat.
CALL METHOD o_grid->set_table_for_first_display
EXPORTING
i_bypassing_buffer = space
is_variant = ws_f_grid_disvar
i_save = ws_c_grid_save
is_layout = struct_grid_lset
CHANGING
it_outtab = i_grid_outs[]
<b>it_fieldcatalog = i_grid_fcat[]</b>
it_sort = i_sort_fcat. " Period
Also Check this code.Another way using field symbols.
i_fieldcat TYPE lvc_t_fcat,
w_layout TYPE lvc_s_layo ,
w_variant TYPE disvariant.
FIELD-SYMBOLS : <lfs_fieldcat> TYPE lvc_s_fcat.
*Default display
LOOP AT p_fieldcat ASSIGNING <lfs_fieldcat>.
CASE <lfs_fieldcat>-fieldname.
WHEN 'GL_ACCT'.
<lfs_fieldcat>-coltext = text-050.
<lfs_fieldcat>-no_out = ' '.
<lfs_fieldcat>-scrtext_l = text-050.
<b> <lfs_fieldcat>-edit = 'X'.</b>
WHEN OTHERS.
ENDCASE.
ENDLOOP.
Hope this helps.
Maybe you are looking for
-
WHILE DELETING A SALE ORDER GETTING A RUNTIME ERROR
hi to all experts, whenever i try to delete a particular sale order im getting a runtime error stating that Short text Screen: Illegal message What happened? The current screen processing action was terminated since a situat occurred wher
-
Complete Novice (my personal challenge)
Hi, I am looking to fastrack myself to learn the basics of Oracle to enable me to do a small test Project. The parameters are to give myself 2 weeks to find some free hosted Oracle Area (for thr Project) then somehow create an ERD that can be mapped
-
Dreamweaver CS4 and Coldfusion 8 - help on configuration
Hi Guys, I'm not a Coldfusion user and I cant find anything from the support docs. I hope you can shed some light on my issue. I really need some help on this. Here's my set up: Dreamweaver CS4/CS3 installed on a Win XP Pro SP2 machine Coldfusion 8 i
-
How can I purchase a redemption code for a used Premiere Elements 11?
My wife bought me a used version of Adobe Premiere Elements 11. When I try to enter the redemption code, it says that the code is not valid. How can I purchase another redemption code / serial number? Thanks!
-
Mass creation of Oracle HR Self Service Users (for access to all employees)
Mass creation of Oracle HR Self Service Users (for access to all employees) Hi all, We have Oracle Human Resources 11.5.7 and recently implement Oracle HRMS (Self Service) for the purpose of Online Appraisal System. Is there any fast way to create al