Add an avergae row in a spreadsheet
I would like to add an additional 5th row to a spreadsheet file that contains a row of headers and 3 rows of data. The 5th row will consist on the average values of the 3 corresponding cells above(rows 2, 3 and 4).
See the attached files as example of the initial and final file I would like.
Can this be done with Labview 2011?
Thank you.
Solved!
Go to Solution.
Attachments:
Initial file.xlsx 10 KB
Initial file.xlsx 10 KB
Hi ka_torce,
-Please find the attached vi, you need to again wrtie these data back to same file.
-Apart from that, everything is done (I saved file in csv format and then used).
-Please never ask people in the forum to complete the vi or code, instead ask how to approach or go further.
Thanks
uday,
Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
Certified LabVIEW Associate Developer (CLAD) Using LV13
Attachments:
Averaging.vi 15 KB
Similar Messages
-
Can't add rows to existing spreadsheet Numbers OS X Yosemite
I created a numbers spreadsheet with column filters and also popup menus for some columns I am trying to add additional rows to the spreadsheet I followed instructions from numbers:
Add or delete a row or column at the edge of the table: Click at the bottom or at the top of the table. (Drag the control to add or delete more than one row or column.) You can delete a row or column only if all of its cells are empty.
Insert or delete a row or column within the table: Click the table, move the pointer over a numbered or a lettered bar, click the arrow, then choose a command from the menu that appears.
but the options to add rows are shaded gray so you can't add rows but can add columns. the II for add columns is active but there is a double circle where the = should be at the top of the table.
I am a 20 year windows and excel user but am new to Apple and numbersJust guessing, but have you turned off the filters before trying to add rows? You can uncheck the box shown here:
After clicking the table, you can find this in the Filter panel at the right after choosing Sort & Filter from the toolbar.
SG -
How to add A single row at the middle of the table in a Webi report
Hi,
I created a Webi report using Universe(Created universe using bex query).Now i have a requirement to display a row at the middle of a report. Can you please tell me ,how to add a sigle row at the middle of a Webi report.
Thanks in advance
Regards
MonikaHi Monika,
It is not really possible to add a row (I assume you mean of unrelated data) to the middle of a table in a report. You can add a new table with a single row between two tables. For instance you could add a new one row table, or even single cells which are positioned relatively between two tables. Possibly a block on top of another. But this gets tricky.
Can you explain in more detail what you are trying to do?
Thanks -
Hi for past 3 days i was thinking and breaking my head on how to add entire new at top table created in pdf report from c# windows forms with iTextSharp.
First: I was able to create/export sql server data in form of table in pdf report from c# windows forms. Given below is the code in c#.
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Text;
using System.Data;
using System.IO;
using System.Data.SqlClient;
using System.Windows.Forms;
using iTextSharp.text;
using iTextSharp.text.pdf;
namespace DRRS_CSharp
public partial class frmPDFTechnician : Form
public frmPDFTechnician()
InitializeComponent();
private void btnExport_Click(object sender, EventArgs e)
Document doc = new Document(PageSize.A4.Rotate());
var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
doc.SetMargins(50, 50, 50, 50);
doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
doc.Open();
PdfPTable table = new PdfPTable(7);
table.TotalWidth=585f;
table.LockedWidth = true;
PdfPTable inner = new PdfPTable(1);
inner.WidthPercentage = 115;
PdfPCell celt=new PdfPCell(new Phrase(new Paragraph("Institute/Hospital:AIIMS,NEW DELHI",FontFactory.GetFont("Arial",14,iTextSharp.text.Font.BOLD,BaseColor.BLACK))));
inner.AddCell(celt);
Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
para.Alignment = iTextSharp.text.Element.TITLE;
iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
png.ScaleToFit(95f, 95f);
png.Alignment = Element.ALIGN_RIGHT;
SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
conn.Open();
SqlDataReader dr;
dr = cmd.ExecuteReader();
table.AddCell("ID");
table.AddCell("First Name");
table.AddCell("Middle Name");
table.AddCell("Last Name");
table.AddCell("DOB" );
table.AddCell("Gender");
table.AddCell("Designation");
while (dr.Read())
table.AddCell(dr[0].ToString());
table.AddCell(dr[1].ToString());
table.AddCell(dr[2].ToString());
table.AddCell(dr[3].ToString());
table.AddCell(dr[4].ToString());
table.AddCell(dr[5].ToString());
table.AddCell(dr[6].ToString());
dr.Close();
table.SpacingBefore = 15f;
doc.Add(para);
doc.Add(png);
doc.Add(inner);
doc.Add(table);
doc.Close();
The code executes well with no problem and get all datas from tables into table in PDF report from c# windows forms.
But here is my problem how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
As the problem i am facing is my title or Header(DCS Clinical Report-Technician wise) is at top of my image named:logo5.png and not coming to it's center position of my image.
Second the problem i am facing is how to add new entire row to top of existing table in pdf report from c# windows form using iTextSharp?.
given in below is the row and it's data . So how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
as you can see how i create my columns in table in pdf report and populate it with sql server data. Given the code below:
Document doc = new Document(PageSize.A4.Rotate());
var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
doc.SetMargins(50, 50, 50, 50);
doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
doc.Open();
PdfPTable table = new PdfPTable(7);
table.TotalWidth=585f;
table.LockedWidth = true;
Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
para.Alignment = iTextSharp.text.Element.TITLE;
iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
png.ScaleToFit(95f, 95f);
png.Alignment = Element.ALIGN_RIGHT;
SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
conn.Open();
SqlDataReader dr;
dr = cmd.ExecuteReader();
table.AddCell("ID");
table.AddCell("First Name");
table.AddCell("Middle Name");
table.AddCell("Last Name");
table.AddCell("DOB" );
table.AddCell("Gender");
table.AddCell("Designation");
while (dr.Read())
table.AddCell(dr[0].ToString());
table.AddCell(dr[1].ToString());
table.AddCell(dr[2].ToString());
table.AddCell(dr[3].ToString());
table.AddCell(dr[4].ToString());
table.AddCell(dr[5].ToString());
table.AddCell(dr[6].ToString());
dr.Close();
table.SpacingBefore = 15f;
doc.Add(para);
doc.Add(png);
doc.Add(table);
doc.Close();
So my question is how to make my column headers in bold?
So these are my questions.
1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
3.how to make my column headers in bold?
I know that i have to do some modifications to my code but i dont know how to do it. Can anyone help me please.
Any help or guidance in solving this problem would be greatly appreciated.
vishalHi,
>>1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
3.how to make my column headers in bold?<<
I’m sorry for the issue that you are hitting now.
This itextsharp is third party control, for this issue, I recommended to consult the control provider directly, I think they can give more precise troubleshooting.
http://sourceforge.net/projects/itextsharp/
Thanks for your understanding.
Regards,
Marvin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How do I add a new row to an AbstractTableModel?
I'm having an issue with adding new data to a table row. Every row I add contains the same data which is always the last data I grabbed from my database. I'm not sure if my issue has to do with how I set up the data to be passed or the table itself or both... Any help would be appreciated. It seems like the tablemodel is holding the memory spot ArrayList I'm passing. If I have to set up an arraylist of arraylists, to pass how do I do that?
My output is always:
1,4,Laser,10,120,100
1,4,Laser,10,120,100
1,4,Laser,10,120,100
1,4,Laser,10,120,100
Desired output:
1,1,Beam,10,99,100
1,2,Canon,10,120,100
1,3,Missile,10,66,100
1,4,Laser,10,120,100
* Extract weaponIDs by hullType from weapon database
private void setWeapons(int hullType){
// equpModel is the tableModel
equipModel.clearTable();
Weapon tempWeapon = new Weapon();
ArrayList newData = new ArrayList();
for (Iterator <Weapon> i = dataBaseManager.weaponList.iterator(); i.hasNext(); ){
tempWeapon = i.next();
if (tempWeapon.weaponClass == hullType){
newData.add(0,1);
newData.add(1,tempWeapon.weaponID);
newData.add(2,tempWeapon.weaponName);
newData.add(3,tempWeapon.weaponCps);
newData.add(4,tempWeapon.weaponMass);
newData.add(5,tempWeapon.weaponCost);
equipModel.insertRow(newData);
}Here is a snipet from the table class
public class GenTableModel extends AbstractTableModel {
private ArrayList data; // Holds the table data
private String[] columnNames; // Holds the column names.
* Constructor: Initializes the table structure, including number of columns
* and column headings. Also initializes table data with default values.
* @param columnscolumns[] array of column titles.
* @param defaultvdefaultv array of default value objects, for each column.
* @param rowsrows number of rows initially.
public GenTableModel(String[] columns, Object[] defaultv, int rows) {
// Initialize number of columns and column headings
columnNames = new String[ columns.length ];
for(int i = 0; i < columns.length; i++) {
columnNames [ i ] = new String(columns [ i ]);
// Instantiate Data ArrayList, and fill it up with default values
data = new ArrayList();
for(int i = 0; i < rows; i++) {
ArrayList cols = new ArrayList();
for(int j = 0; j < columns.length; j++) {
cols.add(defaultv [ j ]);
data.add(cols);
* Adds a new row to the table.
* @param newrowArrayList new row data
public void insertRow(ArrayList newrow) {
data.add(newrow);
super.fireTableDataChanged();
* Clears the table data.
public void clearTable() {
data = new ArrayList();
super.fireTableDataChanged();
}Hi thanks again for responding
Here is the Initialization, including the panel and scrollpane it sits on.
// Table attempt
JPanel tablePanel = new JPanel(new BorderLayout());
tablePanel.setBounds(PANEL_X+2*PANEL_DISTANCE, PANEL_Y, PANEL_WIDTH+300, PANEL_HEIGHT);
title = BorderFactory.createTitledBorder(blackLine, "Table List");
tablePanel.setBorder(title);
// This is column tile plus one dummy initilization set.
String[] columnNames = {"DB", "ID", "Name", "CPS", "Energy", "Mass", "Cost"};
Object[] data = {new Integer(0),new Integer(0), "Empty", new Integer(0),
new Integer(0),new Integer(0),new Integer(0)};
// here is the GenTableModel creation
equipModel = new GenTableModel(columnNames, data, 1);
equipmentTable = new JTable(equipModel);
equipmentTable.setRowSelectionAllowed(true);
equipmentTable.setFillsViewportHeight(true);
equipmentTable.setColumnSelectionAllowed(false);
TableColumn column = null;
column = equipmentTable.getColumnModel().getColumn(0);
column.setPreferredWidth(20);
column = equipmentTable.getColumnModel().getColumn(1);
column.setPreferredWidth(20);
JScrollPane scrollPane = new JScrollPane(equipmentTable);
tablePanel.add(scrollPane);
add(tablePanel);
Here is the full code for GenTableModel. It is as you guessed.
public class GenTableModel extends AbstractTableModel {
private ArrayList data; // Holds the table data
private String[] columnNames; // Holds the column names.
public GenTableModel(String[] columns, Object[] defaultv, int rows) {
// Initialize number of columns and column headings
columnNames = new String[ columns.length ];
for(int i = 0; i < columns.length; i++) {
columnNames [ i ] = new String(columns [ i ]);
// Instantiate Data ArrayList, and fill it up with default values
data = new ArrayList();
for(int i = 0; i < rows; i++) {
ArrayList cols = new ArrayList();
for(int j = 0; j < columns.length; j++) {
cols.add(defaultv [ j ]);
data.add(cols);
public int getColumnCount() {
return columnNames.length;
public int getRowCount() {
return data.size();
public String getColumnName(int col) {
return columnNames [ col ];
public Object getValueAt(int row, int col) {
ArrayList colArrayList = (ArrayList) data.get(row);
return colArrayList.get(col);
public Class getColumnClass(int col) {
// If value at given cell is null, return default class-String
return getValueAt(0, col) == null ? String.class
: getValueAt(0, col).getClass();
public void setValueAt(Object obj, int row, int col) {
ArrayList colArrayList = (ArrayList) data.get(row);
colArrayList.set(col, obj);
public void insertRow(ArrayList newrow) {
data.add(newrow);
super.fireTableDataChanged();
public void deleteRow(int row) {
data.remove(row);
super.fireTableDataChanged();
public void deleteAfterSelectedRow(int row) {
int size = this.getRowCount();
int n = size - (row + 1);
for(int i = 1; i <= n; i++) {
data.remove(row + 1);
super.fireTableDataChanged();
public ArrayList getRow(int row) {
return (ArrayList) data.get(row);
public void updateRow(ArrayList updatedRow, int row) {
data.set(row, updatedRow);
super.fireTableDataChanged();
public void clearTable() {
data = new ArrayList();
super.fireTableDataChanged();
} -
How to add a dummy row in the result set of a SELECT statement.
Hello Everyone -
I have requirment to add a dummy row in the result set of a SELECT statement.
For e.g. lets say there is a table Payment having following colums:
Payment_id number
status varchar2(10)
amount number
payment_date date
so here is the data :-
Payment_id Status Amount payment_date
1 Applied 100 12/07/2008
2 Reversed 200 01/ 06/2009
3 Applied 300 01/ 07/2009
Here is my SQL
Select * form payment where payment_date >= 01/01/2009
Output will be
2 Reversed 200 01/ 06/2009
3 Applied 300 01/ 07/2009
My desired output is below
2 Reversed 200 01/ 06/2009
3 Applied 300 01/ 07/2009
2 Reversed -200 01/ 06/2009 ------(Dummy Row)
Thrid row here is the dummy row which I want to add when status is "Reversed"
I would be very thankful for any kind of help in this regard ...
Thanks,
GauravCartesion joining against a dummy table is a useful method of creating a dummy row:
with my_tab as (select 1 cust_id, 1 Payment_id, 'Applied' Status, 100 Amount, to_date('12/07/2008', 'mm/dd/yyyy') payment_date from dual union all
select 1 cust_id, 2 Payment_id, 'Reversed' Status, 200 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
select 1 cust_id, 3 Payment_id, 'Applied' Status, 300 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
select 2 cust_id, 1 Payment_id, 'Applied' Status, 100 Amount, to_date('12/07/2008', 'mm/dd/yyyy') payment_date from dual union all
select 2 cust_id, 2 Payment_id, 'Reversed' Status, 200 Amount, to_date('01/05/2009', 'mm/dd/yyyy') payment_date from dual union all
select 2 cust_id, 3 Payment_id, 'Applied' Status, 300 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
select 2 cust_id, 4 Payment_id, 'Reversed' Status, -400 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
select 2 cust_id, 5 Payment_id, 'Applied' Status, 500 Amount, to_date('01/07/2009', 'mm/dd/yyyy') payment_date from dual),
--- end of mimicking your table
dummy as (select 'Reversed' col1, 1 rn from dual union all
select 'Reversed' col1, 2 rn from dual)
select mt.cust_id,
mt.payment_id,
mt.status,
decode(dummy.rn, 2, -1*mt.amount, mt.amount) amount,
mt.payment_date
from my_tab mt,
dummy
where mt.status = dummy.col1 (+)
order by mt.cust_id, mt.payment_id, dummy.rn nulls first;
CUST_ID PAYMENT_ID STATUS AMOUNT PAYMENT_DATE
1 1 Applied 100 07/12/2008
1 2 Reversed 200 06/01/2009
1 2 Reversed -200 06/01/2009
1 3 Applied 300 06/01/2009
2 1 Applied 100 07/12/2008
2 2 Reversed 200 05/01/2009
2 2 Reversed -200 05/01/2009
2 3 Applied 300 06/01/2009
2 4 Reversed -400 06/01/2009
2 4 Reversed 400 06/01/2009
2 5 Applied 500 07/01/2009Edited by: Boneist on 07-Jan-2009 23:10
NB. You may have to mess around with the ordering if that's not come back in the order you wanted. You didn't mention what the rules were for any expected ordering though, so I've made up my own *{;-)
Also, I added an identifier (cust_id) to differentiate between different sets of payments, since that's usually the case. Remove that if it's not applicable for your case. -
Need to add a new row at the end of the table
Experts,
working jdev 11.1.1.3.0
i am adding row programetically, my requirement need to add the row at after last row.
i tried different ways.
Row newLastRow = getPWBBidLaneVO().last();
int lastRowIndex = getPWBBidLaneVO().getRangeIndexOf(newLastRow);
getPWBBidLaneVO().insertRowAtRangeIndex(lastRowIndex - 1,
laneRow);
this is giving --- java.lang.ArrayIndexOutOfBoundsException: 0
and
http://kohlivikram.blogspot.com/2008/10/add-new-row-in-adf-table-on-button.html --- its giving index out of bound because vo.getRangeSize() is 25. We set this value at vo for performance improment suggestions.
is there a way to add a new row at the end of the table?Add this to the view row impl class
public void insertRow(Row row) {
//go to the end of Rowset if it has rows
Row lastRow = this.last();
if (lastRow !=null){
//insert new row at the end and make it current
int indx = this.getRangeIndexOf(lastRow)+1;
this.insertRowAtRangeIndex(indx,row);
this.setCurrentRow(row);
}else { // empty Rowset
super.insertRow(row);
} -
Add a new row at the top of a table in GUI
Hi,
I am using JDev 11.1.1.1.0. I need to be able to let users add a new row at the top of a table and not anywhere else in the middle of table rows. I cannot seem to find a way to do it. note that it does not matter where a new row gets inserted in the db, i am only concerned about restricting the insert in the GUI to the topmost line/row.
Thanks,
AJHi
Can you try with writing your custom create method in application module and calling same from UI on command button action like
public void createNewRow()
ViewObjectImpl vo = getVO1();
Row newRow= vo.createRow()
vo.insertRowAtRangeIndex(0, newRow);
Vikram -
How can I add a new row in a JTable dynamically?
Dear Sir(s)
I want to add a new row in a Jtable as I press enter key the time focus is on the last cell of the row? pls helpTomDooley wrote:
Hello,
...I write directly to a cvs file ...my loop slows down to 0.2 Hz
Writing a series of 5 values to a file should not take so long. There is probably something wrong in the way you are saving your data. May be you should post a simplified version of your vi, so we could see how to improve your code.
CC
Chilly Charly (aka CC)
E-List Master - Kudos glutton - Press the yellow button on the left... -
UDO: Add and Remove rows to/from Matrix.
Hi all,
Yes, I know there are lots of topics about adding and removing rows but I was having trouble with these and I need some expert's opinion.
I'm working with a Document type UDO, with 1 header table (ADAT_ONR) and 1 child table (ADAT_NR1 - MatrixUID = "mtx_NR").
I add the first row when the user chooses the business partner.
If oMatrix.RowCount = 0 Then
oMatrix.AddRow()
oMatrix.AutoResizeColumns()
oMatrix.Columns.Item("V_LineId").Cells.Item(1).Specific.Value = 1
End If
Then, the user has to press the AddRow button to add new rows, and the user can only add 1 new blank row. Later I'll change the row adding behavior to mimic B1s.
If pVal.BeforeAction = False Then
Select Case pVal.ItemUID
Case "AddRow"
'ItemHandler_Click = AddRow(oCompany, oApplication, oForm, oForm.Items.Item("mtx_NR").Specific.RowCount())
oMatrix = oForm.Items.Item("mtx_NR").Specific
If oMatrix.RowCount > 0 Then
If Trim(oMatrix.Columns.Item("V_PltCode").Cells.Item(oMatrix.RowCount).Specific.Value) = "" Then
oApplication.StatusBar.SetText(TranslateStr(oApplication, MustChoosePallet), BoMessageTime.bmt_Short)
Exit Function
End If
End If
ItemHandler_Click = NewLine(oCompany, oApplication, oForm)
Exit Function
Private Function NewLine(ByRef oCompany As SAPbobsCOM.Company, ByRef oApplication As SAPbouiCOM.Application, _
ByRef oForm As SAPbouiCOM.Form) As Boolean
NewLine = False
Try
oMatrix = oForm.Items.Item("mtx_NR").Specific
Dim Index As Integer = oMatrix.RowCount
With oForm.DataSources.DBDataSources.Item("@ADAT_NR1")
.Clear()
End With
oMatrix.AddRow()
oMatrix.Columns.Item("V_LineId").Cells.Item(Index + 1).Specific.Value = (Index + 1).ToString
oMatrix.FlushToDataSource()
oMatrix.LoadFromDataSource()
oForm.Refresh()
NewLine = True
Catch ex As Exception
oApplication.MessageBox("NewLine(): " & oCompany.GetLastErrorCode.ToString & ", " & ex.Message)
End Try
End Function
When I Add or Update the data, I clear the last blank row, if it exists.
'// In the Click Event
If pVal.BeforeAction = True Then
Select Case pVal.ItemUID
Case "1"
If oForm.Mode <> BoFormMode.fm_FIND_MODE Then
oMatrix = oForm.Items.Item("mtx_NR").Specific
oMatrix.FlushToDataSource()
oMatrix.LoadFromDataSource()
If Trim(oMatrix.Columns.Item("V_PltCode").Cells.Item(oMatrix.RowCount).Specific.Value) = "" Then
oForm.DataSources.DBDataSources.Item("@ADAT_NR1").RemoveRecord(oMatrix.RowCount - 1)
oMatrix.DeleteRow(oMatrix.RowCount)
'oMatrix.FlushToDataSource()
End If
End If
End Select
My question is, Is there an easier way to Add and Delete Rows??
BTW, I still have a problem so solve. With this code, when the user deletes a row the row numbering is incorrect. Example: if I have to rows in a matrix and I delete row nº1, row nº2 will hold the same number...
Any Ideas?
Thanks in advanced,
Vítor VieiraHi Victor,
there is a Form Data event which you ca use in that try to write the code for adding a row after updating and delete a row while inserting and add a row while traversing.
sample code.
Sub FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean)
Try
Select Case BusinessObjectInfo.EventType
Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD, SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE
If BusinessObjectInfo.BeforeAction = True Then
objForm = objMain.objApplication.Forms.Item(BusinessObjectInfo.FormUID)
oDBs_Head = objForm.DataSources.DBDataSources.Item("@Header")
oDBs_Detail= objForm.DataSources.DBDataSources.Item("@Line")
objMatrix = objForm.Items.Item("83").Specific
If objMatrix.VisualRowCount <> 0 Then
objMatrix.DeleteRow(objMatrix.VisualRowCount)
objMatrix.FlushToDataSource()
End If
If BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD Then
End If
ElseIf BusinessObjectInfo.ActionSuccess = True Then
objForm = objMain.objApplication.Forms.Item(BusinessObjectInfo.FormUID)
If BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE Then
objMatrix = objForm.Items.Item("83").Specific
objMatrix.AddRow()
SetNewLineCharge(objForm.UniqueID, objMatrix.VisualRowCount)
objMatrix.FlushToDataSource()
End If
End If
Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD
If BusinessObjectInfo.ActionSuccess = True Then
oDBs_Head = objForm.DataSources.DBDataSources.Item("@Header")
oDBs_Detail = objForm.DataSources.DBDataSources.Item("@Line")
objMatrix = objForm.Items.Item("83").Specific
objMatrix.AddRow()
SetNewLineCharge(objForm.UniqueID, objMatrix.VisualRowCount)
objMatrix.FlushToDataSource()
End If
End Select
End Sub
Hope this helps,
OM Prakash -
Hi,
I have 2 tables, and I needed to add/remove some rows from the first table to the second.
I've followed the tutorial: Link: [Add and Remove from a List|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/927d8c3c-0a01-0010-57b4-e89f505e2bff] and it works great!
But the user can add two or more times the same row, so I need to avoid that. The user should be able to add every row only once!!
I thought about some condition on button Add (for example, disable the ADD button if the same row is present in both tables, but it didnt work).
Any ideas to achieve that?
Thanks in advance!
Best Regards
Marcelo.Hi again Ahmed
I've solved my problem, but now I'm facing a new issue about the same topic.
Following your tips, I've found a solution, but now, I need to copy a complete field of a table to the data store.
For example, my table has 4 field (country, key, name and city), and I need to copy ALL the key values to the data store. So, if I have 4 rows in the table, let's say "key1", "key2", "key3", "key4"
I've reached a solution, but it involves to walk throught the entire table, selecting every row automatically (I use a spinner) and "copying" every key field of every row to the data store. When I say "copying" I mean adding it to the same virtual field of the data store, that is to say, concatenating the key values one after another.
The problem arises when the table has more than 100 records, because 100 is the top value that a spinner can reach.
Any ideas about can bypass that limit?
Thanks in advance, your help is really appreciated.
Best regards
Marcelo -
ADOBE Forms Central - add and remove rows (PDF Form)
Hello, I am currently evaluating ‘ADOBE Forms Central' to set up a form with editable fields. I have set up a test form in ADOBE Forms Central and was unable to insert an option to add and remove rows similar to the print screen attached. Is this possible to do using ADOBE Forms Central or should I be using
a different ADOBE application? Thank you, LizA dynamic XFA PDF form can do this. You can create such forms with LiveCycle Designer, which was included with the Windows version of Acrobat Pro prior to version 11. It is now a separate product.
XFA forms can't be used with FormsCentral, however, only Acroforms can. -
Add a new row in Detail form in MASTER DETAIL FORM
Hello Everyone,
I need help on the following.I have master detail form .In detail form i have Add Row button which adds a new row and i have save button to save the record .But now if i am adding a row its not adding a new row .It says it process but didn't show the new row .
Can somebody help me on this
thanks in advanceHello,
How many records do you show in your detaii region and how many are there for that master? Maybe the new row is in the next set of records - or at the 'bottom' of the last set of records?
Did you check if the row is inserted in the database (and just didn't show up for one reason or another)?
Greetings,
Roel
http://roelhartman.blogspot.com/
http://www.bloggingaboutoracle.org/
http://www.logica.com/ -
Trying to automatically add a new row w/o mutating table error...
I'm using Oracle 10g express. I'm trying to automatically add a new row with the same e_ID, (RDD + 6 months) as the updated row when RC is updated. I'm fairly new to Oracle, so I need some help on creating a trigger. If you need more details let me know. Thanks in advance.
create table E
e_id number(6,0) not null,
constraint e_pk primary key(e_id)
create Table ER
e_Id Number(6,0) Not Null,
SC Date,
RDD Date,
RC Date,
Constraint ER_Fk Foreign Key(E_Id) References E(E_Id)
);mookjais wrote:
I'm using Oracle 10g express. I'm trying to automatically add a new row with the same e_ID, (RDD + 6 months) as the updated row when RC is updated. I'm fairly new to Oracle, so I need some help on creating a trigger. If you need more details let me know. Thanks in advance.
create table E
e_id number(6,0) not null,
constraint e_pk primary key(e_id)
create Table ER
e_Id Number(6,0) Not Null,
SC Date,
RDD Date,
RC Date,
Constraint ER_Fk Foreign Key(E_Id) References E(E_Id)
);Do you mean following(example)?
create trigger after_insert_e
after
insert
on e /*This is table name*/
referencing new as new old as old
for each row
begin
insert into ER(e_Id,SC,rdd,rc)
values(:new.ed_id,sysdate,sysdate,sysdate);
end; -
ALV report-Add a count row at teh botttom.
Hi!
I would like to adda row to my ALV report at the bottom of the report which will show me the count of number of billing documents existing in the repport. Even when the report is fileterd on certain conditions , the total at teh bottom should change as per the records showing. basically I need to add a total row at teh bottom of my report which will give the number of billintg documents that show up in the report.
Is it possible ? If so how do I go about please.
ThanksI have this , but not sure where to insert the line count in this .
*& Form CALL_ALV
Call the ALV Grid function.
FORM call_alv .
SORT it_extract BY vbeln.
repid is necessary since the ALV F.M. does not work properly with
sy-repid.
repid = sy-repid.
alv_variant-variant = pa_vari.
alv_variant-report = sy-repid.
alv_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repid
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = t_fieldcat[]
it_sort = gt_sort[]
i_default = 'X'
i_save = 'A'
is_variant = alv_variant
it_events = gt_events[]
is_print = tp_print
TABLES
t_outtab = it_extract2
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE w000 WITH text-004 ' ' ' ' ' '.
ENDIF.
ENDFORM. " CALL_ALV
*& Form alv_eventtab_build
Pass list of events to be triggered by the ALV function module
FORM alv_eventtab_build USING u_name TYPE slis_alv_event-name
u_form TYPE slis_alv_event-form
alv_lt_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event. " structure for event handling
ls_event-name = u_name.
ls_event-form = u_form.
APPEND ls_event TO alv_lt_events.
ENDFORM. " alv_eventtab_build
FORM TOP_OF_PAGE *
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'NEWALTA_LOGO'
it_list_commentary = gt_list_top_of_page.
ENDFORM. " TOP_OF_PAGE
You said the count will show along with or below the LOGO on top , but how do I incorporate the line count ihn it?
Maybe you are looking for
-
Solution Manager 4.0/When accessing services as ex. showing graphic in Proj
Hi, We have just upgraded from Solution Manager 3.1 to 4.0. When accessing services as ex. showing graphic in Projects, tab graphics shows: " Service cannot be reached. What has happened? URL http://dnismpa.danisco.com:1080/sap/bc/solman/defaultUser/
-
Developing an Add-in for Adobe Reader to insert the PDF into Lotus Notes
Hi We currently have a document management solution in MS Word & Excel, where by you can open/create a document click a button that is linked to a macro and it brings a Document Management screen up and allows you to save the file into a new Lotus No
-
Installed QT 7.3 - now nothing works
Hello, I've been reading some of the posts and am having similar problems with QuickTime 7.3. Unfortunately, I upgraded to 7.3 and now nothing is working. I'm having issues with playback of QT videos, FCP exports and so on. A common error message has
-
Gantt in Visual Composer?
Hi experts, Is it possible a graphic grantt in visual composer? Thanks in advance, Regards,
-
HT201274 how do i reset a passcode i forgot. I cant access my phone
i need to know how to reset my information/password for my new iphone that i already forgot the password to