Delete first empty row in a table
Hi,
Can you please provide the script for the below requirement.
Need to delete First empty row in all the tables. (Tables having more number of empty rows. i need to delete first empty row only)
Regards,
Velu
@Velu – the following blog post by Jongware might get you started:
Tackling Tables through Scripting
by: Jongware | April 8, 2013
http://indesignsecrets.com/tackling-tables-through-scripting.php
Document Object (DOM) documentation:
Indesign JavaScript Help
InDesign ExtendScript API (10.0)
Table Row specifics:
Adobe InDesign CS6 (8.0) Object Model JS: Row
InDesign ExtendScript API (10.0)
Uwe
Similar Messages
-
Button to delete all empty rows
I am in the process of creating an interactive form that has a button that add rows for the user to input issues and another button to add follow-ups to those instances. There are 3 different sets of these. However, we do not want to add a delete button to all rows, to allow for accidental deletion of already inputted data. I would like to create a button that will delete all empty rows, including all subforms. Either that, or upon saving the document, all empty rows would be deleted - whichever would be easier. Please help! This seems like it will be a complicated task and I am not that well versed in LiveCycle to be able to figure this out on my own.
Thank you!There is no doubt that looping through nested repeating objects is more complex:
Here is the script for the first table with follow-up rows:
// Technical
var nCount3 = VitalsSubform.Technical._Instance1.count;
for (var k=0; k<nCount3; k++)
// this is script to remove the follow-up rows in the first table only
var nCount6 = xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.count;
// loop through the rows in the follow-up table
for (var i=0; i<nCount6; i++)
if (xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "].Table1.Row1[" + i + "]").Cell4.rawValue == null)
// remove null row
xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.removeInstance(i);
// recount nCount in case a row has been deleted
nCount6 =xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.count;
// account for the row that is now deleted
i = i-1;
// now remove null statements
if (xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1.Statement.Statement.rawValue == null)
VitalsSubform.Technical._Instance1.removeInstance(k);
var nCount3 = VitalsSubform.Technical._Instance1.count;
k = k-1;
It is by no means tested and could still be flaky.
Have you considered a manual 'x'/delete button for the follow-up rows?
Here is the form: https://acrobat.com/#d=JMGUKXNQ*qMD18S3W5VxSQ
Niall -
Urgent - Deletion of duplicate rows in a table - Help me
Hi friends,
Here is my purchase_order_line table desc,
SQL> desc purchase_order_line;
Name Null? Type
PURCHASE_ORDER_LINE_ID NOT NULL NUMBER
DESTINATION_ID NOT NULL NUMBER
PURCHASE_ORDER_ID NOT NULL NUMBER
LINE_NO NOT NULL NUMBER
PART_NO VARCHAR2(10)
PART_DESC NOT NULL VARCHAR2(100)
ORDER_QTY NOT NULL NUMBER
ORDER_DATE NOT NULL DATE
DUE_DATE DATE
VERSION_NO NOT NULL NUMBER
VERSION_DATE NOT NULL DATE
purchase_order_line_id is a primary key.
If you ignore the primary key column temporarily,
for the rest of 2 to 11 columns, i have a duplicate data in this table.
I want to clear out all duplicates.
Suppose if I have 3 similar rows(exclude primarykey), then delete first two rows and leave the last one.
OR delete last two rows and leave the first one.
What is the best solution for this ?
thanks for help.
Sridharhere is some example that might be of help.
SQL> select case_number, case_status_desc status, case_ownr owner,
2 case_yr year, doc_id
3 from wrt_case
4 order by doc_id;
CASE_NUMBER STATUS OWNER YEAR DOC_ID
2006-786 ACTIVE E 2006 22072734
2006-786 ACTIVE E 2006 22072734
2006-786 ACTIVE E 2006 22081673
2006-786 ACTIVE E 2006 22081673
2006-786 ACTIVE E 2006 22143005
2006-786 ACTIVE E 2006 22143005
2006-786 ACTIVE E 2006 22243094
2006-786 ACTIVE E 2006 22243094
8 rows selected.
SQL> Select case_number, case_status_desc status, case_ownr owner,
2 case_yr year, doc_id, rowid,
3 row_number() over (partition by doc_id order by doc_id) as rn
4 From wrt_case;
CASE_NUMBER STATUS OWNER YEAR DOC_ID ROWID RN
2006-786 ACTIVE E 2006 22072734 AAD8bTAAJAAAJ4nAAA 1
2006-786 ACTIVE E 2006 22072734 AAD8bTAAJAAAJ4nAAC 2
2006-786 ACTIVE E 2006 22081673 AAD8bTAAJAAAJ4nAAB 1
2006-786 ACTIVE E 2006 22081673 AAD8bTAAJAAAJ4nAAD 2
2006-786 ACTIVE E 2006 22143005 AAD8bTAAJAAAJ4nAAE 1
2006-786 ACTIVE E 2006 22143005 AAD8bTAAJAAAJ4nAAF 2
2006-786 ACTIVE E 2006 22243094 AAD8bTAAJAAAJ4nAAG 1
2006-786 ACTIVE E 2006 22243094 AAD8bTAAJAAAJ4nAAH 2
8 rows selected.
SQL> Delete From wrt_case
2 Where rowid in (Select t.rid
3 From (Select case_number, case_status_desc status, case_ownr owner,
4 case_yr year, doc_id, rowid as rid,
5 row_number() over (partition by doc_id order by doc_id) as rn
6 From wrt_case) t
7 Where t.rn > 1);
4 rows deleted.
SQL> select case_number, case_status_desc status, case_ownr owner,
2 case_yr year, doc_id, rowid
3 from wrt_case
4 order by doc_id;
CASE_NUMBER STATUS OWNER YEAR DOC_ID ROWID
2006-786 ACTIVE E 2006 22072734 AAD8bTAAJAAAJ4nAAA
2006-786 ACTIVE E 2006 22081673 AAD8bTAAJAAAJ4nAAB
2006-786 ACTIVE E 2006 22143005 AAD8bTAAJAAAJ4nAAE
2006-786 ACTIVE E 2006 22243094 AAD8bTAAJAAAJ4nAAG
SQL> -
How to delete a particular row in ALV table
Hi,
How to delete a particular row in ALV table based on some condition(by checking value for one of the columns in a row)
Thanks
Bala DuvvuriHello Bala,
Can you please be a bit more clear as to how you intend to delete the rows from your ALV? By the way deleting rows from an ALV is no different from deleting rows from a normal table. Suppose you have enabled selection property in ALV & then select multiple rows and click up on a button to delete the rows then below would be the coding: (Also keep in mind that you would have to maintain the Selection property of the context node that you are binding to your ALV to 0..n)
data : lr_table_settings TYPE REF TO if_salv_wd_table_settings,
lr_config TYPE REF TO cl_salv_wd_config_table.
lr_table_settings ?= lr_config.
** Setting the ALV selection to multiple selection with no lead selection
lr_table_settings->set_selection_mode( value = cl_wd_table=>e_selection_mode-multi_no_lead ).
Next delete the selected rows in the action triggered by the button:
METHOD onactiondelete_rows .
DATA: wd_node TYPE REF TO if_wd_context_node,
lt_node1 TYPE ig_componentcontroller=>elements_node,
wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set,
row_number TYPE i VALUE 0.
wd_node = wd_context->get_child_node( name = 'NODE' ).
CALL METHOD wd_node->get_selected_elements
RECEIVING
set = lt_temp.
LOOP AT lt_temp INTO wa_temp.
wd_node->remove_element( EXPORTING element = wa_temp ).
ENDLOOP.
CALL METHOD wd_node->get_static_attributes_table
EXPORTING
from = 1
to = 2147483647
IMPORTING
table = lt_node1.
wd_node->bind_table( new_items = lt_node1 ).
ENDMETHOD.
If in case this isn't your requirement please do let me know so that I can try come up with another analysis.
Regards,
Uday -
Count of non-empty rows of a table
How to I get the number of non-empty rows of a table ?
ThanksYou can loops through the rows and check whether any cell is empty or not? Use a counter variable to increment the same.
Thanks,
Bibhu -
Appending empty rows in internal table
Hi,
i am using table control, where there is a condition, some row may left empty. end if i press enter button the empty row is filled by the next available record. My need is to pick the records in the table control to the internal table including the empty rows as it is.Hi Karthikeyan,
By default with user pressinng enter, empty rows will get deleted.
How are you populating your table control? Is it from standard transaction or your internal table?
If it is from your internal table, you can add anothe flag field for empty row.
Whenever row is empty in your internal table, mark flag field as 'X', so in the table control you these entries will not get vanished with pressing of enter.
This is one idea and you can build on this. You can make this flag column as non editable so that no one can change these.
hope this helps,
ags. -
How to avoid displaying empty rows in a table?
The situation is as follows:
I have got a set of questions under a particular category say marketing category.
The user will be displayed with a table consisting of a set of questions from a particular category with four radio buttons for each question.
Now once he is done with all the set of questions under a particular category, he will be navigated to the next set of questions under some other category say 'xyz'
Now instead of creating seperate view objects for each category, we have created a view object which will hold all the set of questions from all the category but will display only the set of questions under a particular category by declaring a variable in the backing bean and setting the question rendering to the value in the variable. the value to the variable will be changed once the user is done with answering all the set of questions under a particular category.
Now the problem that i am facing is:
Because of the rendering condition that i have used, it displays only those rows that have the rendering condition set to the variable in the backing and displays all other empty rows overlapped.
How do i avoid this situation ??Seems odd, but you could use COALESCE to achieve this.
ME_XE?create table all_nullz (col1 number, col2 number, col3 number);
Table created.
Elapsed: 00:00:00.20
ME_XE?
ME_XE?insert into all_nullz values (1,2,3);
1 row created.
Elapsed: 00:00:00.12
ME_XE?insert into all_nullz values (null, null, null);
1 row created.
Elapsed: 00:00:00.06
ME_XE?
ME_XE?delete from all_nullz where coalesce(col1,col2,col3) is null;
1 row deleted.
Elapsed: 00:00:00.26
ME_XE? -
How to remove an empty row after a table anchor?
We are using FrameMaker 12 on a Windows 7 (64 bit) platform.
I am working my way down a chapter of training content. I am halfway down the chapter, and—as fate would have it—I need to start a table at the top of a page.
When I insert a table (with a caption/title at the top), FM creates an anchor at the top of the page. The space to the right of the anchor is a blank line. I actually want the table to start at the top of the page without the blank line to the right of the anchor.
This is what I tried, with the results:
I put the cursor after the anchor, and press Delete.
Result: The text *below* the table is brought up above the table.
I put the cursor after the last bit of text on the previous page, and press Delete.
Result: The paragraph on the previous page moves down to the next page on top of the table, leaving a large blank space on the previous page.
I change the Start option (on Table Designer) to Top of Column (or Top of Page).
Result: FM leaves the anchor where it was, moves the table down to the next page, and leaves a totally empty page where the table used to be.
Is there any way to just move the table up so that it is on the same line as the anchor?
(And as a tool design issue, is there EVER a reason why a content developer would want an entire blank line above of a table?)
Thank you in advance,
TimI've always thought it strange that FrameMaker doesn't properly butt
tables against the top of a column by default. Here's how to make tables
do it.
1. First, in the Table Designer, on the Basic tab, set Spacing Above to
a negative number, such as -2.0 pt, for the table. (You probably want to
update all of your table styles to use this number by default.)
2. Create an anchor paragraph style to hold tables, perhaps naming it
TableAnchor. In the Paragraph Designer, on the Basic tab, set Spacing
Below Pgf to the same negative number, such as -2.0 pt, for this
paragraph style and select the "Fixed" checkbox. On the Default Font
tab, set the font to the same number, but positive-- such as 2.0 pt.
3. Now, whenever you want to insert a table, first insert a TableAnchor
paragraph to hold the table, then insert your table. The table will not
only fit properly against the top of a column, but should also look
better when it follows text in a column.
NOTE: Anywhere I've used 2.0 or -2.0, you can use any number you want,
just be sure to get the signs right and use the same number in all three
places. Some people use 12.0 pt and -12.0 pt, for example. -
Hi Experts,
In an interface i'm uploading a spread sheet data into the program's internal table. I dont want the first 2 rows of the spreadsheet in the internal table as they are just the headings.
plz advise me.
thank you.
venudata: begin of itab occurs 0,
name1 type c,
name2 type c,
end of itab.
data: t_filedata like alsmex_tabline occurs 0 with header line.
start-of-selection.
clear itab.
refresh itab.
*---Upload Spreadsheet.
perform read_file using p_xlfile.
*---Process data into formatted internal table.
perform format_data.
form read_file using p_filename like rlgrap-filename.
*---Upload spreadsheet.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_filename
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 256
I_END_ROW = 65536
TABLES
INTERN = t_filedata
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF t_filedata[] is initial.
message i009 with 'NO DATA FOUND IN FILE' p_filename.
stop.
ENDIF.
sort t_filedata by row col.
endform. "READ_FILE
form format_data.
data: l_index type i.
field-symbols: <fs1>.
loop at t_filedata.
can i write that like this, here?????????
1method:
<b>delete t_filedata index 1.
delete t_filedata index 2.</b>
2nd method:
or
<b>check sy-tabix > 2.</b>
l_index = t_filedata-col.
assign component l_index of structure t_sheet to <fs1>.
<fs1> = t_filedata-value.
at end of row.
append itab.
clear itab.
endat.
endloop.
refresh t_filedata.
free t_filedata.
endform. "FORMAT_DATA
Message was edited by: venu gopal -
How to delete the duplicate rows from the table
Hi,
I have 2 tbales namely component, component_audit
For each record in component table there are multiple entries in component_audit table.
I need to keep the first record and delete the others from the component_audit table
say for example
select a.component_id,a.dt_ti_stamp,a.component_name,a.column_before,b.comments from component_audit a,component b where a.component_id=b.component_id
( on the above result set only I shold apply the actual delete query )
PLease help me in this regards.
Thanks.delete from component_audit a where dt_ti_stamp not in (select
min(b.dt_ti_stamp)
from
component_audit b
where
a.component_id = b.component_id) -
Can we delete a single row in SID table?
I am having a problem with conversion exit in SID table.
These are the error messages.
Value in SID table is TPV; correct value is TPV; SID in SID table is 875
Message no. RSRV200
Diagnosis
The following data record either has an incorrect internal format or the characteristic value that is in the correct format appears as a corrected value of another incorrect value:
· Characteristic value: TPV
· SID: 875
· Correct characteristic value: (see below) TPV
· SID after correction: 875
Value in SID table is TPV 2008; correct value is TPV; SID in SID table is 2887
Message no. RSRV200
Diagnosis
The following data record either has an incorrect internal format or the characteristic value that is in the correct format appears as a corrected value of another incorrect value:
· Characteristic value: TPV 2008
· SID: 2887
· Correct characteristic value: (see below) TPV
· SID after correction: 875
Now the row with SID 875 is causing the problem. Is it possible that I can delete only this row in the SID table.
Thanks for your help
SubraHi.....
Procedure :
RSA1>>>InfoObjects >>Right Click on InfoObject >>delete Master Data >> u can see the option of deleting SIDs............
Otherwise........u can delete value from a SID table......u can use tcode SE14...........to delete the entries.........
Check this......
deleting contents of SID table.
But still I will suggest u not to delete SID...........it may lead to inconsistency of data.........
Try to repair SId using the program : RSDMD_CHECKPRG_ALL or RSRV...........
Regards,
Debjani...... -
Hi there,
In my advanced table with multiple selection check box, I have the logic to insert 10 rows into the view object before the table is rendered. So my table display 10 new blank rows.
Assume user only enter 3 rows and I don't want to save those 7 empty rows. How can I recognize the 7 empty rows and remove them from the VO?
Please advise.
thanks,
CharlesHi Charles,
You may be dispalying some columns on OAF page, check all thos for null, if every field is Null then it is unused and you can remove it.
This is sample code:
public void deleteUnusedLines()
XXEGASRLinesVOImpl pervo = getXXEGASRLinesVO1();
if(pervo==null)
Row row[] = pervo.getAllRowsInRange();
System.out.println("No of items "+row.length);
for (int i=0;i<row.length;i++)
XXEGASRLinesVORowImpl rowi = (XXEGASRLinesVORowImpl)row;
if((rowi.getItemDescription()==null)||("".equals(rowi.getItemDescription().trim())))//add more conditions here to locate empty rows.
rowi.remove();
Regards,
Reetesh Sharma -
Empty rows in a table should not be displayed
Hi,
I have an ADF table which contains 10 rows and 5 columsns,
in which i have rendered all the values in 5 columns of 5 rows to false.
But when displaying the table,the empty rows are displaying by overlapping..
I do not want to display those empty rows.
Thank u
BhanuDuplicate of How to make some rows of a table invisible
Frank -
Hi,
I have an Advanced Table "DelegatedRN" in which the where clause is set pragmatically in the processRequest by
OAAdvancedTableBean table =
*(OAAdvancedTableBean)webBean.findChildRecursive("DelegatedRN");*
table.queryData(pageContext, false);
, and it is fetching the correct records, but it is adding an empty record where ever the page in rendered.
Please advise how i can remove the empty record from the table.
Thanks in advance to all.
Regards...AshrafHi Ashraf,
Do a sanity check to see if a new row is being created(in Process Request) for the vo attached to the table.
Thanks -
How to delete and add rows in a table control
Hi
how to delete rows and add new rows in a tbale control
SathyaHi,
In the PAI write this code
PROCESS AFTER INPUT.
LOOP AT itab.
ENDLOOP.
MODULE MODIFY_TC.
MODULE MODIFY_TC.
To add a row
DESCRIBE TABLE itab LINES tc_tab-lines.
tc_tab-lines = tc_tab-lines + 1.
To delete a row if check box is ticked
DELETE itab WHERE check = c_x.
To delete a row depending on tabix
DELETE itab index l_tabix.
ENDMODULE.
Make sure that you put a if condition in the above module inorder to ensure addition or deletion of a row.
Best regards,
Prashant
Maybe you are looking for
-
Unable to open pdfs after downgrade from PS CC 2014
Greetings. Our office has several seats of Creative Cloud, and our workstations are all Macs. When InDesign and Photoshop upgrades to version 2014 were released, I installed them on our computers; only to discover that the upgrade is not compatible
-
Hello, I have the problem with lightroom 4. In lighroom 3.6 it worked well making a profile with xrite and then automatically you could find the made profile in Camera Calibration and profile. You make a photo with the xrite profile. Then export it
-
How do get airplay from my mac to the Apple TV
Where can i find airplay on my Mac
-
Incorrect daylight saving change for Brazil, 2008
Leopard is still using outdated (2007) timezone rules for Brazil, where DST starts Oct 14 and ends on Feb 17. This is wrong for 2008. On Sep 8 this year a new decree was passed regarding DST changes. It should start on every third sunday in October,
-
Problem of displaying data using the two RFMs
Hi All, I have an application: a) Displaying of table using BAPI1 b) Updating the same table and returning the status whether the updation was successful or not. for this we have two BAPIs: 1. BAPI 1: Two import parameters are imported and some exp