How to add a table to my code
I have the following code attached but I am having trouble trying to figure out how to attach a table to it. I would like for my result to give me a graph, as it does, as well as a table. I have been reading a lot and going over many examples but can't seem to figure this one out. Can anyone help? Thanks
Solved!
Go to Solution.
Attachments:
program.doc 33 KB
First, your images are on your hard drive and obviously we have no access to that. Attach them to the post.
Your problem is fairly simple. An XY graph is a bundle of an x array and a y array. A table is a 2D array of strings. You can use the Build Array to create a 2D array from your x and y data and then convert to strings with the Number to Decimal String. In the image below, I also inserted a Transpose 2D array so that the x data would be in one column and the y data in another. If you want it displayed in rows, don't transpose.
Message Edited by Dennis Knutson on 12-12-2008 11:49 AM
Attachments:
Create Table.PNG 3 KB
Similar Messages
-
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 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 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 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 JFramehttp://forum.java.sun.com/faq.jsp#format
-
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 to add a table to pdf file ?
How to add a table to pdf file ?
Not able to use the table component. Its not active.
Any help pls
Thanks
Peter
http://www.ethos.aghttp://forum.java.sun.com/faq.jsp#format
-
How to ADD reference table and make a field as currency field in dictionary
pls render some info on how to add refernce table and ref field if i want to make an added field as a currency or quantity field...
Hi Kiran,
It sounds like you are creating a "Z" table or structure and have defined a quantity (eg MENGE). But when you run the syntax check, the system is saying you need to define a reference table / field.
Well when you are in SE11, click on the "Currency / Quantity Fields" tab. You will see 2 columns called "Reference Table" and "Reference Field". These 2 columns define the unit of measure for the currency / qty.
If you have defined in your table MENGE and MEINS and the MEINS field is the unit of measure for the MENGE field you should define your fields as such (inthe Currency/Quantity Fields" tab:
Table - ZVBAP
MENGE MENGE_D QUAN ZVBAP MEINS
MEINS MEINS UNIT
Hope this makes sense.
Cheers,
Pat.
PS. Kindly assign Reward Points to the posts you find helpful. -
GGB0 for PS (project system) , how to add another table
hi all,
how to set in ggb0 , under Project System-Network activity, we need to add table resbd to check field saknr , how to add the table resbd?1) Using bcdedit.exe /enum
To enable the computer to also boot Windows 7 you again use bcdedit.exe with the following command which will copy the current Windows
Boot Loader details for Windows Server 2008 to Windows 7.
bcdedit.exe /copy
{current} /d "Microsoft Windows 7"
bcdedit.exe will
respond with something like the following.
The
entry was successfully copied to {................................}.
Using
bcdedit.exe /enum to again enumerate through the current entries within the BCD store you'll see the newly added entry.
Before you can use the newly created Windows boot loader configuration, you'll need to change the partition for Windows 7 using
the following two bcdedit.exe commands.
bcdedit.exe /set {.................................} device partition=D:
bcdedit.exe /set {.................................} osdevice partition=D:
If you now reboot the system you should now be able to boot into either Windows Server 2008 or Windows 7. -
How to add hash table values to SQL Table using Powershell
Hi,
I have sharepoint list with four(column1, column2, column3,column4)columns.I am reading the list column values and adding to hashtable. Now I want to add values from hastable to SQL table with four(column1, column2, colum3,column4)columns using powershell.
I have written the following script for single column but I would like to know how to add values for multiple columns.
if(($key -eq "Column1") )
$SqlQuery = "INSERT INTO [TableName] ([Column1]) VALUES ('" + $HashTable.Item($key) +"')"
#Set new object to connect to sql database
$connection = new-object system.data.sqlclient.sqlconnection
$Connection.ConnectionString ="server=SQLServerName;database=SQLDBName;Integrated Security = True;"
$connection #List connection information
$connection.open() #Open Connection
$Cmd = New-Object System.Data.SqlClient.SqlCommand
$Cmd.CommandText = $SqlQuery
$Cmd.Connection = $connection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$SqlAdapter.Fill($DataSet)
$DataSet.Tables[0]
$connection.Close()
Can anybody please help me out to accomplish the task? Any help would be greatly appreciated.
AA.Hi AOk2013,
Not knowledgable on PowercShell, based on my understanding on HashTable in Java, Some modification you can make in your code to achieve your requirement.
If the Keys in HashTable are "Column1","Column2","Column3","Column4", you can reference below.
if(($key -eq "Column1") ) #what is the purposed of this if ?
#$SqlQuery = "INSERT INTO [TableName] ([Term]) VALUES ('" + $HashTable.Item($key) +"')"
#specify the real column names in the table
$SqlQuery = "INSERT INTO [TableName] ([ColumnA],[ColumnB],[ColumnC],[ColumnD]) VALUES ('" + $HashTable.Item("Column1") +"','"+ $HashTable.Item("Column2") +"','"+$HashTable.Item("Column3") +"','"+$HashTable.Item("Column4") +"')"
#Set new object to connect to sql database
$connection = new-object system.data.sqlclient.sqlconnection
$Connection.ConnectionString ="server=SQLServerName;database=SQLDBName;Integrated Security = True;"
$connection #List connection information
$connection.open() #Open Connection
$Cmd = New-Object System.Data.SqlClient.SqlCommand
$Cmd.CommandText = $SqlQuery
$Cmd.Connection = $connection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$SqlAdapter.Fill($DataSet)
$DataSet.Tables[0]
$connection.Close()
Since your question is regarding PowerShell, I would suggest you post it in a dedicated
PowerShell Forum. It is more appropriate and more experts will assist you.
If you have any feedback on our support, you can click
here.
Eric Zhang
TechNet Community Support -
GRCT HOW TO ADD Z TABLES IN REPORT PAINTER
Hi Gurus
Could you please send me information about how to activate z tables in report painter ? someone said me that i can user transaction GRCT to do that...¿ what aspects must I consider to add a table ?
mail: [email protected]
Regards
Andrés Morenohi Andres,
below are the steps for the Report Painter.....
Create a new report.
Menu Path: Information Systems > Ad hoc reports > Report Painter > Report > Create
On the Report Painter: Create Report screen, enter:
Library 1VK
Report RSS-A
Report Description Report w/Total Row
Hit <Create> button to move to the next screen.
Create the Rows of the Report The first four rows are cost element characteristics
Screen: Report Painter: Create Report
Type Cost Elements in the lead column cell
Double click on Row 1
In the Pop-up window 'Element definition: Row1", enter:
Note: If Pop-up window (select element type) appears, choose 'characteristics' and hit <Enter>.
Select 'Cost Element' as the characteristic in the 'Available characteristics' section
Hit <Move selected to left> button to move the characteristic 'Cost element' to the 'Selected characteristics' section
From 430000
Hit <Change short, middle and long texts> icon (at the bottom of the window)
In the Pop-up for Enter Texts, Enter:
Short Description from Table above for this Account
Click on the <Copy short text> button to copy this description to the other fields.
Hit <Confirm> to close the Pop-up
Hit <Confirm/Enter> to check consistency and close.
Repeat the above steps for the other 3 accounts
Create a formula row to calculate the total of the Cost Element rows
Screen: Report Painter: Create Report
Double click on Row 5 or the next empty row.
In the Pop-up for Select Element Type select 'Formula'
Hit <Enter> to close the Pop-up
In the Pop-up 'Enter Formula'
Use the calculator buttons to create the formula Y001 + Y002 + Y003 + Y004
Hit <Enter> to close the Pop-up
In the Pop-up 'Enter Texts'
Short Total
Click on the <Copy short text> button to copy this description to the other fields.
Hit <Enter> to close the Pop-up
Make sure your cursor is in the cell containing the word Total
Follow the Menu Path: Formatting > Row
In the Pop-up 'Row Formatting'
Overscore checked
Underscore checked
Hit <Enter> to close the Pop-up
Create the first column for actual costs
Screen: Report Painter: Create Report
Double click on the Column 1 cell.
In the Pop-up 'Select element type'
Select Predefined Key Figure radio button, and press <Enter>.
In Pop-up 'Choose predefined column'
Select Actual Costs as the predefined column, and press <Enter>.
In the Pop-up 'Element definition: Actual costs'
Press <Confirm> to check consistency and close.
Define the second column for plan costs
Screen: Report Painter: Create Report
Double click on the Column 2 cell.
In the Pop-up 'Select element type'
Select Key Figure with Characteristics as the element type, and press <Enter>.
In the Pop-up 'Element definition: Column 2'
Value Type 01 (Plan)
Version 0 (Actuals)
Valuation 0 (Legal valuation)
Hit <Change short, middle and long texts> icon
In the Pop-up for Enter Texts, Enter:
Short Plan
Click on the <Copy short text> button to copy this description to the other fields.
Hit <Confirm> to close Pop-up.
Hit <Confirm> to check consistency and close.
Create a formula column to calculate the variance between actual and plan costs
Screen: Report Painter: Create Report
Double click on the Column 3 cell
Assign the points....
Ranjit -
How to add a table (J2ME CDC)
Is there a way to add a table?
I am using Eclipse IDE & IBM J9 ( Personal Profile 1.1, FP 1.1, CDC 1.1)
Thanks in advance.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. -
Urgent:how to add two table regions to one query region
hello
In my page a serach region is there and for that region i need to add two tables and two are based on two different view objects.how can i implemnet this thing please let me know.
advance thanksHi Wei Fang,
You can try by creating a 2 line template (1 Template, 2 linetype) under a loop note.
So your smartform tree structure will be shown like this:
LOOP
TEMPLATE1.
On the LOOP part, pass the internal table of your data to the working areas.
On the template put all the data of the summary on your first linetype, and put
the detail data on your second linetype.
Good luck and hopefully this will solve the problem
Edited by: Prawira Fadjar on Oct 22, 2008 10:04 AM -
MASS - how to add more tables to object types
I am setting up a variant in the MASS transaction and I need to add the VBUP / order line item status table to the Object Type BUS2032 - sales orders. How can I add another table to this? Currently VBAK, VBKD and VBAP are available.
Thank you,
Lisa> Hi Lisa,
> I feel you are tyring out something which cannot be
> done.
> MASS will allow you to make a large number of changes
> at one go by creating a BDC.
> Now if you cannot do the change manually then you
> cant do it using MASS.
>
> So trying to maintain VBUP thru MASS will not work.
> You may need to find out the field in VBAP which
> would trigger the VBUP updation in your scenario.
>
> Reward points if this clarifies your question.
> regards
> Biju
Hello Biju,
MASS is doing what I want it to do. I can upload a file of sales orders that have not been delivered. I can then change the line item pricing date using MASS, and that will trigger the Carry Out New Pricing function.
I just wanted to add the delivery-status field to the select options screen in MASS. I don't want to change the delivery-status field value. I know that BUS2032 is SAP-delivered, but it it possible to copy that object to ZBUS2032 and then add the VBUP table for my selection criteria?
Thank you,
Lisa -
How to add a custom PL/SQL code for a button event handler
Hi All,
I am a toddler in using Oracle Portal. So please forgive me for my ignorance.
Q : How do I add a custom PL/SQL code for a button event handler?
Basically, I would like to write MY PL/SQL function and call it. I could see that we can write "CUSTOM" code as "PL/SQL button event handler" in the form design window. But the question is that it expects only a "call" to procedure. But where do I define the procedure then? If I insert the procedure from the backend, it gets flushed the next time I compile my form.
Hope I am able to explain my point.
Thanks in advance,
Abbas.Hi All,
I am a toddler in using Oracle Portal. So please forgive me for my ignorance.
Q : How do I add a custom PL/SQL code for a button event handler?
Basically, I would like to write MY PL/SQL function and call it. I could see that we can write "CUSTOM" code as "PL/SQL button event handler" in the form design window. But the question is that it expects only a "call" to procedure. But where do I define the procedure then? If I insert the procedure from the backend, it gets flushed the next time I compile my form.
Hope I am able to explain my point.
Thanks in advance,
Abbas.
Maybe you are looking for
-
.html appears as .html in browser
My uploaded local index.html file appears as .html rather than as text on two of my Macs X.4 in Safari, IE, Firefox, and iCab. It appears as .html also on Optimum Online who gives me cable and on GoDaddy.com. In Easy-cgi.com however they say it appea
-
Opportunity Status DDLB entries
Hello all, How can the DDLB entries for Oppty status be controlled? When we are doing the upgrade, for same entries in the Oppty Status profile, in 6.0 I end up with 5 values while in 7.0, i have 8 values. Please help. FYI....CRM_STATUS_MAINTAIN_OW s
-
I need some help. I have an iMac 21" (brand new). For some reason the computer goes to sleep and then shuts down completely. I am assuming it has something to do with the UPS setting in the system preferences. My question is 1. how doe I set them cor
-
Hi Experts, I want to call IT 105 subtype 0010 mail id. (which has time constraint 2). When i add this in personal data, i have option to create/change/display. Now my requirement is that this should be only in display mode. I have controlled that th
-
I have Mac OSX Version 10.9.4 - I cannot find an imoive tutorial.
When I go to Help and type in iMovie tutorial I am able to find that, but am "thrown" out of the program when I tap "continue". Are there any tutorials for iMoive? There are several changes in the program from the OSX Lion version 10.6.8. Has an