How to add a table(from TableRenderDemo) to a JFrame?
Hello:
Please run my coding first, and get some idea what's going on for my coding.
At the movement, I got a problem, I have not idea how to add a table(it is from TableRenderDemo) to JFrame when I click on the button(from DrawCalendar) of the numer 20, and I want the table disply under the buttons(from DrawCalendar).
Please help me to solve this problem, thanks.
/* this program for adding some Button to JPanel, and also adding some listeners to each button
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.GridLayout;
public class DrawCalendar extends JPanel {
private static DrawCalendar dC;
private static GridLayout gL;
private static Container c;
private static String names[]={"1","2","3","4","5","6","7","8","9","10","11","12","13","14",
"15","16","17","18","19","20","21","22","23","24","25","26",
"27","28","29","30","31","32","33","34","35"};
private static String num;
private static JButton buttons[];
public DrawCalendar(){
gL=new GridLayout(5,7,0,0);
setLayout(gL);
addJButton(); //add buttons to Panel
registerListener();//add Listener to buttons
//add Buttons to JButtons and put the label for each button
private void addJButton(){
buttons=new JButton[names.length];
for (int i=0; i<names.length; i++){
buttons=new JButton(names);
buttons.setBorder(null);
buttons.setBackground(Color.white);
buttons.setFont(new Font ("Palatino", 0,8));
add(buttons);
private void registerListener(){
for(int i=0; i<35; i++)
buttons.addActionListener(new EventHandler());//add EventHandler to each button
private class EventHandler implements ActionListener{
public void actionPerformed(ActionEvent e){
for(int i=0; i<35; i++){
if(e.getSource()==buttons){
System.out.println("testing " + names);
break;
/*The program for adding a table to JPanel
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableColumn;
import javax.swing.DefaultCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.JScrollPane;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;
public class TableRenderDemo extends JScrollPane {
private boolean DEBUG = true;
public TableRenderDemo() {
// super("TableRenderDemo");
MyTableModel myModel = new MyTableModel();
JTable table = new JTable(myModel);
table.setPreferredScrollableViewportSize(new Dimension(700, 70));//500,70
//Create the scroll pane and add the table to it.
//JScrollPane scrollPane = new JScrollPane(table);
setViewportView(table);
//Set up column sizes.
initColumnSizes(table, myModel);
//Fiddle with the Sport column's cell editors/renderers.
setUpSportColumn(table.getColumnModel().getColumn(2));
//Add the scroll pane to this window.
//getContentPane().add(scrollPane, BorderLayout.CENTER);
// addWindowListener(new WindowAdapter() {
// public void windowClosing(WindowEvent e) {
// System.exit(0);
* This method picks good column sizes.
* If all column heads are wider than the column's cells'
* contents, then you can just use column.sizeWidthToFit().
private void initColumnSizes(JTable table, MyTableModel model) {
TableColumn column = null;
Component comp = null;
int headerWidth = 0;
int cellWidth = 0;
Object[] longValues = model.longValues;
for (int i = 0; i < 5; i++) {
column = table.getColumnModel().getColumn(i);
try {
comp = column.getHeaderRenderer().
getTableCellRendererComponent(
null, column.getHeaderValue(),
false, false, 0, 0);
headerWidth = comp.getPreferredSize().width;
} catch (NullPointerException e) {
System.err.println("Null pointer exception!");
System.err.println(" getHeaderRenderer returns null in 1.3.");
System.err.println(" The replacement is getDefaultRenderer.");
comp = table.getDefaultRenderer(model.getColumnClass(i)).
getTableCellRendererComponent(
table, longValues,
false, false, 0, i);
cellWidth = comp.getPreferredSize().width;
if (DEBUG) {
System.out.println("Initializing width of column "
+ i + ". "
+ "headerWidth = " + headerWidth
+ "; cellWidth = " + cellWidth);
//XXX: Before Swing 1.1 Beta 2, use setMinWidth instead.
column.setPreferredWidth(Math.max(headerWidth, cellWidth));
public void setUpSportColumn(TableColumn sportColumn) {
//Set up the editor for the sport cells.
JComboBox comboBox = new JComboBox();
comboBox.addItem("Snowboarding");
comboBox.addItem("Rowing");
comboBox.addItem("Chasing toddlers");
comboBox.addItem("Speed reading");
comboBox.addItem("Teaching high school");
comboBox.addItem("None");
sportColumn.setCellEditor(new DefaultCellEditor(comboBox));
//Set up tool tips for the sport cells.
DefaultTableCellRenderer renderer =
new DefaultTableCellRenderer();
renderer.setToolTipText("Click for combo box");
sportColumn.setCellRenderer(renderer);
//Set up tool tip for the sport column header.
TableCellRenderer headerRenderer = sportColumn.getHeaderRenderer();
if (headerRenderer instanceof DefaultTableCellRenderer) {
((DefaultTableCellRenderer)headerRenderer).setToolTipText(
"Click the sport to see a list of choices");
class MyTableModel extends AbstractTableModel {
final String[] columnNames = {"First Name",
"Last Name",
"Sport",
"# of Years",
"Vegetarian"};
final Object[][] data = {
{"Mary ", "Campione",
"Snowboarding", new Integer(5), new Boolean(false)},
{"Alison", "Huml",
"Rowing", new Integer(3), new Boolean(true)},
{"Kathy", "Walrath",
"Chasing toddlers", new Integer(2), new Boolean(false)},
{"Sharon", "Zakhour",
"Speed reading", new Integer(20), new Boolean(true)},
{"Angela", "Lih",
"Teaching high school", new Integer(4), new Boolean(false)}
public final Object[] longValues = {"Angela", "Andrews",
"Teaching high school",
new Integer(20), Boolean.TRUE};
public int getColumnCount() {
return columnNames.length;
public int getRowCount() {
return data.length;
public String getColumnName(int col) {
return columnNames[col];
public Object getValueAt(int row, int col) {
return data[row][col];
* JTable uses this method to determine the default renderer/
* editor for each cell. If we didn't implement this method,
* then the last column would contain text ("true"/"false"),
* rather than a check box.
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
* Don't need to implement this method unless your table's
* editable.
public boolean isCellEditable(int row, int col) {
//Note that the data/cell address is constant,
//no matter where the cell appears onscreen.
if (col < 2) {
return false;
} else {
return true;
* Don't need to implement this method unless your table's
* data can change.
public void setValueAt(Object value, int row, int col) {
if (DEBUG) {
System.out.println("Setting value at " + row + "," + col
+ " to " + value
+ " (an instance of "
+ value.getClass() + ")");
if (data[0][col] instanceof Integer
&& !(value instanceof Integer)) {
//With JFC/Swing 1.1 and JDK 1.2, we need to create
//an Integer from the value; otherwise, the column
//switches to contain Strings. Starting with v 1.3,
//the table automatically converts value to an Integer,
//so you only need the code in the 'else' part of this
//'if' block.
try {
data[row][col] = new Integer(value.toString());
fireTableCellUpdated(row, col);
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(TableRenderDemo.this,
"The \"" + getColumnName(col)
+ "\" column accepts only integer values.");
} else {
data[row][col] = value;
fireTableCellUpdated(row, col);
if (DEBUG) {
System.out.println("New value of data:");
printDebugData();
private void printDebugData() {
int numRows = getRowCount();
int numCols = getColumnCount();
for (int i=0; i < numRows; i++) {
System.out.print(" row " + i + ":");
for (int j=0; j < numCols; j++) {
System.out.print(" " + data[j]);
System.out.println();
System.out.println("--------------------------");
*This is a main progarm, it is for adding some buttons to Frame
import java.awt.*;
import javax.swing.*;
public class TestMain extends JFrame{
private static TableRenderDemo tRD;
private static TestMain tM;
private static Container c;
private static DrawCalendar dC;
public static void main(String[] args){
tM = new TestMain();
tM.setVisible(true);
public TestMain(){
super(" Test");
setSize(800,600);
//set up layoutManager
c=getContentPane();
c.setLayout ( new GridLayout(3,1));
tRD=new TableRenderDemo();
dC=new DrawCalendar();
addItems();//add Buttons to JFrame
private void addItems(){
//c.add(dC); //add Buttons to JFrame
c.add(tRD); //add Table to JFrame
http://forum.java.sun.com/faq.jsp#format
Similar Messages
-
How to add a table(from TableRenderDemo) to a JFrame again
Hello again:
Thanks for stephen andrews's adivice, I follow your adivice to add code (it is in
EventHandeler of DrawCalendar class, and they indicated by ???????????), but it still not work, please check for me why, Thanks.
My problem
Please run my coding first, and get some view from my coding.
At the movement, I got a problem, I have not idea how to add a table(it is from TableRenderDemo) to JFrame when I click on the button(from DrawCalendar) of the numer 20, and I want the table disply under the buttons(from DrawCalendar).
Please help me to solve this problem, thanks.
*This program for add some buttons and a table on JFrame
import java.awt.*;
import javax.swing.*;public class TestMain extends JFrame{
private static TableRenderDemo tRD;
private static TestMain tM;
protected static Container c;
private static DrawCalendar dC;
public static void main(String[] args){
tM = new TestMain();
tM.setVisible(true);
public TestMain(){
super(" Test");
setSize(800,600);
//set up layoutManager
c=getContentPane();
c.setLayout ( new GridLayout(3,1));
tRD=new TableRenderDemo();
dC=new DrawCalendar();
addItems();//add Buttons to JFrame
private void addItems(){
c.add(dC); //add Buttons to JFrame
//c.add(tRD); //add Table to JFrame
*This program for add some buttons to JPanel
*and add listeners to each button
*I want to display myTable under the buttons,
*when I click on number 20, but why it doesn't
*work, The coding for these part are indicated by ??????????????
[import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.GridLayout;
public class DrawCalendar extends JPanel {
private static DrawCalendar dC;
private static TestMain tM;
private static TableRenderDemo myTable;
private static GridLayout gL;
private static final int nlen = 35;
private static String names[] = new String[nlen];
private static JButton buttons[] = new JButton[nlen];
public DrawCalendar(){
gL=new GridLayout(5,7,0,0);
setLayout(gL);
assignValues();
addJButton();
registerListener();
//assign values to each button
private void assignValues(){
names = new String[35];
for(int i = 0; i < names.length; i++)
names[i] = Integer.toString(i + 1);
//create buttons and add them to Jpanel
private void addJButton(){
buttons=new JButton[names.length];
for (int i=0; i<names.length; i++){
buttons=new JButton(names[i]);
buttons[i].setBorder(null);
buttons[i].setBackground(Color.white);
buttons[i].setFont(new Font ("Palatino", 0,8));
add(buttons[i]);
//add listeners to each button
private void registerListener(){
for(int i=0; i<35; i++)
buttons[i].addActionListener(new EventHandler());
//I want to display myTable under the buttons,
//when I click on number 20, but why it doesn't
//work
private class EventHandler implements ActionListener{
public void actionPerformed(ActionEvent e){
for(int i=0; i<35; i++){
if(i==20){ //????????????????????
tM=new TestMain(); //I want to display myTable under the buttons,
tM.c.removeAll(); //when I click on number 20, but why it doesn't
tM.c.add(dC); //work
tM.c.add(myTable); //???????????????????????????????????????
tM.validate();
if(e.getSource()==buttons[i]){
System.out.println("testing " + names[i]);
break;
*This program create a table with some data
[import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableColumn;
import javax.swing.DefaultCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TableRenderDemo extends JScrollPane {
private boolean DEBUG = true;
public TableRenderDemo() {
// super("TableRenderDemo");
MyTableModel myModel = new MyTableModel();
JTable table = new JTable(myModel);
table.setPreferredScrollableViewportSize(new Dimension(700, 70));//500,70
//Create the scroll pane and add the table to it.
setViewportView(table);
//Set up column sizes.
initColumnSizes(table, myModel);
//Fiddle with the Sport column's cell editors/renderers.
setUpSportColumn(table.getColumnModel().getColumn(2));
* This method picks good column sizes.
* If all column heads are wider than the column's cells'
* contents, then you can just use column.sizeWidthToFit().
private void initColumnSizes(JTable table, MyTableModel model) {
TableColumn column = null;
Component comp = null;
int headerWidth = 0;
int cellWidth = 0;
Object[] longValues = model.longValues;
for (int i = 0; i < 5; i++) {
column = table.getColumnModel().getColumn(i);
try {
comp = column.getHeaderRenderer().
getTableCellRendererComponent(
null, column.getHeaderValue(),
false, false, 0, 0);
headerWidth = comp.getPreferredSize().width;
} catch (NullPointerException e) {
System.err.println("Null pointer exception!");
System.err.println(" getHeaderRenderer returns null in 1.3.");
System.err.println(" The replacement is getDefaultRenderer.");
comp = table.getDefaultRenderer(model.getColumnClass(i)).
getTableCellRendererComponent(
table, longValues[i],
false, false, 0, i);
cellWidth = comp.getPreferredSize().width;
if (DEBUG) {
System.out.println("Initializing width of column "
+ i + ". "
+ "headerWidth = " + headerWidth
+ "; cellWidth = " + cellWidth);
//XXX: Before Swing 1.1 Beta 2, use setMinWidth instead.
column.setPreferredWidth(Math.max(headerWidth, cellWidth));
public void setUpSportColumn(TableColumn sportColumn) {
//Set up the editor for the sport cells.
JComboBox comboBox = new JComboBox();
comboBox.addItem("Snowboarding");
comboBox.addItem("Rowing");
comboBox.addItem("Chasing toddlers");
comboBox.addItem("Speed reading");
comboBox.addItem("Teaching high school");
comboBox.addItem("None");
sportColumn.setCellEditor(new DefaultCellEditor(comboBox));
//Set up tool tips for the sport cells.
DefaultTableCellRenderer renderer =
new DefaultTableCellRenderer();
renderer.setToolTipText("Click for combo box");
sportColumn.setCellRenderer(renderer);
//Set up tool tip for the sport column header.
TableCellRenderer headerRenderer = sportColumn.getHeaderRenderer();
if (headerRenderer instanceof DefaultTableCellRenderer) {
((DefaultTableCellRenderer)headerRenderer).setToolTipText(
"Click the sport to see a list of choices");
class MyTableModel extends AbstractTableModel {
final String[] columnNames = {"First Name",
"Last Name",
"Sport",
"# of Years",
"Vegetarian"};
final Object[][] data = {
{"Mary ", "Campione",
"Snowboarding", new Integer(5), new Boolean(false)},
{"Alison", "Huml",
"Rowing", new Integer(3), new Boolean(true)},
{"Kathy", "Walrath",
"Chasing toddlers", new Integer(2), new Boolean(false)},
{"Sharon", "Zakhour",
"Speed reading", new Integer(20), new Boolean(true)},
{"Angela", "Lih",
"Teaching high school", new Integer(4), new Boolean(false)}
public final Object[] longValues = {"Angela", "Andrews",
"Teaching high school",
new Integer(20), Boolean.TRUE};
public int getColumnCount() {
return columnNames.length;
public int getRowCount() {
return data.length;
public String getColumnName(int col) {
return columnNames[col];
public Object getValueAt(int row, int col) {
return data[row][col];
* JTable uses this method to determine the default renderer/
* editor for each cell. If we didn't implement this method,
* then the last column would contain text ("true"/"false"),
* rather than a check box.
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
* Don't need to implement this method unless your table's
* editable.
public boolean isCellEditable(int row, int col) {
//Note that the data/cell address is constant,
//no matter where the cell appears onscreen.
if (col < 2) {
return false;
} else {
return true;
* Don't need to implement this method unless your table's
* data can change.
public void setValueAt(Object value, int row, int col) {
if (DEBUG) {
System.out.println("Setting value at " + row + "," + col
+ " to " + value
+ " (an instance of "
+ value.getClass() + ")");
if (data[0][col] instanceof Integer
&& !(value instanceof Integer)) {
//With JFC/Swing 1.1 and JDK 1.2, we need to create
//an Integer from the value; otherwise, the column
//switches to contain Strings. Starting with v 1.3,
//the table automatically converts value to an Integer,
//so you only need the code in the 'else' part of this
//'if' block.
try {
data[row][col] = new Integer(value.toString());
fireTableCellUpdated(row, col);
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(TableRenderDemo.this,
"The \"" + getColumnName(col)
+ "\" column accepts only integer values.");
} else {
data[row][col] = value;
fireTableCellUpdated(row, col);
if (DEBUG) {
System.out.println("New value of data:");
printDebugData();
private void printDebugData() {
int numRows = getRowCount();
int numCols = getColumnCount();
for (int i=0; i < numRows; i++) {
System.out.print(" row " + i + ":");
for (int j=0; j < numCols; j++) {
System.out.print(" " + data[i][j]);
System.out.println();
System.out.println("--------------------------");http://forum.java.sun.com/faq.jsp#format
-
how can i import tables from a different schema into the existing relational model... to add these tables in the existing relational/logical model? plss help
note; I already have the relational/logical model ready from one schema... and I need to add few more tables to this relational/logical model
can I import the same way as I did previously??
but even if I do the same how can I add it in the model?? as the logical model has already been engineered..
please help ...
thanksHi,
Before you start, you should probably take a backup copy of your design (the .dmd file and associated folder), in case the update does not work out as you had hoped.
You need to use Import > Data Dictionary again, to start the Data Dictionary Import Wizard.
In step 1 use a suitable database connection that can access the relevant table definitions.
In step 2 select the schema (or schemas) to import. The "Import to" field in the lower left part of the main panel allows you to select which existing Relational Model to import into (or to specify that a new Relational Model is to be created).
In step 3 select the tables to import. (Note that if there are an Foreign Key constraints between the new tables and any tables you had previously imported, you should also include the previous tables, otherwise the Foreign Key constraints will not be imported.)
After the import itself has completed, the "Compare Models" dialog is displayed. This shows the differences between the model being imported and the previous state of the model, and allows you to select which changes are to be applied.
Just selecting the Merge button should apply all the additions and changes in the new import.
Having updated your Relational Model, you can then update your Logical Model. To do this you repeat the "Engineer to Logical Model". This displays the "Engineer to Logical Model" dialog, which shows the changes which will be applied to the Logical Model, and allows you to select which changes are to be applied.
Just selecting the Engineer button should apply all the additions and changes.
I hope this helps you achieve what you want.
David -
i am using numbers in the new iWork. Just bought it 10 days back. I am not able to figure out how to add serial umbers from 1 to 100( for example) also i need to freeze the top header like in windows so that we can browse down without the heading going off. Can some one help?
Hi Jay,
Be aware that "Freeze Header Rows" and "Freeze Header Columns" apply only to rows and columns that are Header rows or Header columns. You can have up to five Header rows, Five Header Columns (and five Footer rows) on a Numbers Table.
"Header rows" is a special designation. Besides being able to be frozen, Header and Footer rows are not included in formulas referencing whole columns, making it possible to place formulas such as =SUM(B) at the top (or bottom) of column B without causing a self-reference error, These designated rows are also not included in sorts of the rows in a table.
Regards,
Barry -
How to add internal table fileds in Text module in smart forms
Hi Friends,
How to add internal table fileds in Text module in smart forms?
Thanks & Regards,
Vallamuthu.MHi Vallamuthu ,
how did you solve your problem?
thanks, -
How can we copy table from one schema to other schema
Hi,
I have create one table in one schema and i want to copy it to other schema.How we can copy table from one schema to other schemaHi,
You can try something like this :-
SQL> CONNECT SYS/SYS123@SERVER AS SYSDBA
Connected.
SQL> CREATE USER TEST_1 IDENTIFIED BY TEST_1;
User created.
SQL> CREATE USER TEST_2 IDENTIFIED BY TEST_2;
User created.
SQL> GRANT CONNECT,RESOURCE,DBA TO TEST_1;
Grant succeeded.
SQL> GRANT CONNECT,RESOURCE,DBA TO TEST_2;
Grant succeeded.
SQL> CONNECT TEST_1/TEST_1@SERVER
Connected.
SQL> CREATE TABLE TEST_COPY ( TEST_COL NUMBER );
Table created.
SQL> INSERT INTO TEST_COPY VALUES ( 1 );
1 row created.
SQL> INSERT INTO TEST_COPY VALUES ( 2 );
1 row created.
SQL> COMMIT;
Commit complete.
SQL> GRANT ALL ON TEST_COPY TO TEST_2;
Grant succeeded.
SQL> CONNECT TEST_2/TEST_2@SERVER
Connected.
SQL> CREATE TABLE TEST_COPY AS SELECT * FROM TEST_1.TEST_COPY;
Table created.
SQL> SELECT * FROM TEST_COPY;
TEST_COL
1
2Regards,
Sandeep -
How to add a table layout in CRM Sales order?
dear all ,
anyone know how to add a table layout in CRM sales order customer tab that using the EEWB added?
can EEWB do this? i didn't find the appropriate business object......Hi , Swapna
is you mail address right? can not send out.
first , you should have added one field using EEWB , then to EEWB , find the extension , double click on the task, there you will find a "object list" on the right, the list will give you many many very important information , you should look through .
then double click on the "screen: ..........EEW......." , layout , there you will find the field you have added in . and you can draw anything you want there , then back to the screen flow , write you flow logic in PBO and PAI .
about the global data definition, again to the "object list", you will find a "Report source code: ......................TOP". in there ,you can define all you data .
another thing if you want to save your input field to database tables that you draw (not by EEWB added)
two ways:
1. write update table directly in PAI module .
2. you can use this BADI : ORDER_SAVE , this is when you save the order to trigger the save action. -
How to get internal table from SAP Data Provider C#
Hello.
ABAP:
DATA: lt_t001 TYPE TABLE OF t001.
DATA: url(1000) TYPE c.
SELECT * INTO TABLE lt_t001 FROM t001.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'APPLICATION'
subtype = 'X-R3TABLE'
TABLES
data = lt_t001
CHANGING
url = url
EXCEPTIONS
OTHERS = 4.
C#:
using SAPDataProvider;
using SAPTableFactoryCtrl;
public void SetDataFromUrl(string url)
SAPDataProviderClass p = new SAPDataProviderClass();
p.SetDataFromURL("APPLICATION", "X-R3TABLE", url);
ISapDPR3Table tbl = p.GetDataAsR3Table("APPLICATION", "X-R3TABLE");
SAPTableFactoryClass tf = new SAPTableFactoryClass();
Table tb = (Table)tf.NewTable();
tb.ISAPrfcITab = tbl.DataTable; // Exception !!!!!!
How to get internal table from SAP Data Provider ?Hi Sergey,
I'm trying to do the same, have you found a solution to solved it?
thanks for your help.
Regards.
Jonathan -
How to add multiple table when creating add on using b1de
Hi all,
Plz help me
How to add multiple table when creating add on using b1de.
ThanksHi dns_sap,
Can you explain a little better what you are trying to accomplish? Is it to create UserTables and UserFields in the database, when the addon runs the first time?
If so, you can use the following code
Add User Table
Try
Dim lRetCode As Long
Dim oUDT As SAPbobsCOM.UserTablesMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
oUDT.TableName = TableName
oUDT.TableDescription = TableDescription
oUDT.TableType = TableType
lRetCode = oUDT.Add
'// Check for error when adding the Table: if lRetCode = 0 the table was created; if lRetCode = -2035 the table already exisits
If lRetCode <> 0 Then
oApplication.MessageBox("Error: " & lRetCode.ToString & ", " & oCompany.GetLastErrorDescription)
End If
Catch ex As Exception
oApplication.MessageBox(oCompany.GetLastErrorDescription)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDT)
oUDT = Nothing
lRetCode = Nothing
GC.Collect()
End Try
Add User Field
Try
Dim lRetCode As Long
Dim oUDF As SAPbobsCOM.UserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
oUDF.TableName = TableName
oUDF.Name = FieldName
oUDF.Description = FieldDescription
oUDF.Type = FieldType
lRetCode = oUDF.Add
'// Check for error when adding the field: if lRetCode = 0 the field was created; if lRetCode = -2035, the field already exists
If lRetCode <> 0 Then
oApplication.MessageBox("Error: " & oCompany.GetLastErrorCode & ", " & oCompany.GetLastErrorDescription)
End If
Catch ex As Exception
oApplication.MessageBox(oCompany.GetLastErrorDescription)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDF)
oUDF = Nothing
lRetCode = Nothing
GC.Collect()
End Try
Regards,
Vítor Vieira -
How to add a photo from a collection to a book in Lightroom 4.1?
How to add a photo from a collection to a book in Lightroom 4.1?
Save the book, then go back to Library and add the photos there.
-
How can I copy tables from Numbers to Pages without formula?
hi everyone
i need help
How can I copy tables from Numbers to Pages without formula in the cells?Ok... I see your problem... when pasting into Pages, the formulas from Numbers are included. Perhaps this is really more of a Pages question (in which case I'm far from expert). A couple of ideas:
• In Pages, try "Edit"/"Paste and Match Style", which may insert tab delimited cell values (no formulas). Then, if you want the table format back, select these newly pasted tabbed values and use Page's "Format"/"Table"/"Convert Text to Table"/
• In Numbers, before copying, make a temporary table of the plain values first, then copy and paste that into Pages. To do this, select the range of cells you desire in the Numbers and "Edit"/"Copy". Then "Edit"/"Deselect All" and "Edit"/"Paste Values" and "Edit"/"Cut". Now just a table of values is on the clipboard and you can head over to Pages to paste. -
How to read a table from one host to other host
Hi Everybody,
How to read a table from one host to other host.
For Example,
a/a@abcd - host 1
b/b@xyz - host 2
suppose im having a table called emp in a/a@abcd
i want to read the table emp in b/b@xyz
how to do this.??
I know that we have to create a dblink...after that how to proceed.
Plz help..
Thanks in Advance,
Gitaconnected as scott/tiger@test
SQL>
CREATE DATABASE LINK local
CONNECT TO admin IDENTIFIED BY pinnet
USING 'pinnet';
Database link created.
sql>
select count(*) from
users@local;
COUNT(*)
16
Message was edited by:
jeneesh -
How to add a tone from computer
how to add a tone from computer
Create the tone.
Sync the tone as you would sync anything else. -
How to add a song from my PC to iphone 5s
How to add a song from my PC to iphone 5s
Sync it via iTunes as described in the User Guide.
-
How to add a movie from dvd to ipad?
how to add a movie from dvd to ipad?
Ripping commercial DVDs is against the DMCA in the US, we can't tell you how to do it.
Use handbrake for DVDs with your home movies on it.
Maybe you are looking for
-
First off, I am going to say that I think it is ridiculous that you can get NO phone support from adobe if you aren't a CC member???? So existing CS6 and LR5 users have to just use the forum?? Honestly, that is the worst customer service possible. I
-
How to read the BDB log ... and other questions
I am using a bdb database interface in the application openldap. When the bdb database there is established it creates, in addition to the data storage diles, a log file (log.0000000001). "file log.0000000001" reports that to be a binary file. How do
-
Forcing a disk to format.
I have a Flip video camera, and I have contacted support about this many times, however have not received a satisfactory answer as of yet. I plug it in, and it takes forever to mount, over 5 minutes sometimes, I then get this message once it has moun
-
Importing a model from a configurator to a custom table
Hi, I'm new to Configurator. Can someone please advice in detail how to import all possible combinations from a model in the configurator to a custom table? I have created a custom table based on the items in the model. I have also written a CIO whic
-
How do i update to snow leopard or yosemite from macintosh
How do i update to snow leopard or yosemite from macintosh