Community

How to merge a cell of the table when it is divided into two pages

Hello

As the screenshots, It is a muti-pages and non-traditional table. So I use a repeat group table to capture each item respectively.
But there are some cell of item's description will separate to next page in sometimes. How can I detect this problem and generate two cells to capture(region of red border) even I can merge it. Or there are another way can solve it.

Merry X'mas in advance.

Was this article helpful?

0 out of 0 found this helpful

Comments

15 comments

  • Avatar
    Timur
    Hello,

    Easiest approach to merge such rows would be to use script stage in your FlexiCapture project. You can see that items that are sometimes split and contnued on the next page refer to the same item number, and such consequetive entries should be merged.

    In order to do this you will need to use advanced workflow in your project settings and create custom processing stage for document processing.

    In this stage it will be possible to loop through document table entries and merge any entries that have same item number, by using Rows.AddNew, Rows.Delete methods

    You can find detailed information on workflow settings in the following section of the help filerogram Settings-Set up ABBYY FlexiCapture Complex-Workflow setup

    Detailed information about using scripts in FlexiCapture projects:Appendix-Using Scripts in ABBYY FlexiCapture


    0
  • Avatar
    Ivan
    Hi Timur

    Thanks for your suggestion first. Maybe I will use script to merge when table's quantity is empty.
    So, If I need to capture the table of the red border region at least, exclude merging problem in advance.

    I search for table in each region element as enclosed images. But it will let table can't found between two pages.
    If I use "tobecontinued".IsFound then above:"tobecontinued", it will stop searching next sub-table. Is there any tip can solve it?

    My problem is how can I capture the each item as table correctly in this situation. Thanks again!
    0
  • Avatar
    Timur
    Hello,

    The problem is that not in all cases items are separated.

    In order to tell if item was splitted into two and continued on the next page you need to check recognized item codes, such approach requires complex scripts and is not realiable since recognitions results very much depend on image quality. In most cases it will not be possible to identify if item is split or not.

    It is better to solve such tasks using script stages in abbyy FlexiCapture project once verification operators have confirmed all recognized data.



    0
  • Avatar
    Ivan
    Hi timur,

    Thanks for your suggestion. I use paragraph to get the rest part of description finally when I find element with static word "commercial invoice".
    But now, I encounter new problem in FC11 export. As 1st and 2nd images, I can get index of elements in sequence. Because I want the each cell I can match or merge SCNo,PONo and item of sub table in after work.
    After export result as 3rd and 4th images, why the ROW_INDEX always "1"? I want to save the index of elements in sequence to .xls. For example: 1-2.2-3.6-1...and so on. How can I solve this problem? Use export scripts? How can I start with export script? I'm very appreciative of all the ​support you've given me.
    0
  • Avatar
    Timur
    Hello,

    EDAC_Invoice is probably the document definition name,and in the xls file it states section number. When you use standard export options you can only export table columns or any other fields from the document.
    Since there are no index fields on the documents that can be captured, in order to create such indexes you will need to use an export script. FlexiCapture supports programming languages such as C#.NET, VB, Jscript which offer more flexibility than standard export options.

    You can begin with export scripts by checking examples in Help file:Using Scripts in ABBYY FlexiCapture-scripts for customizing processing-sample scripts-sample scripts describing export

    Help file also contains a full description of the object model:Using Scripts in ABBYY FlexiCapture->scripts for customizing processing->object
    IDocument and IField objects are used in most export scripts.

    If you choose to export to an excel file using scripts, you will also need to get aqainted with Microsoft.Office.Interop.Excel assembly which is needed to work with excel files.




    0
  • Avatar
    Ivan
    Hi Timur,

    If I add a empty block in FLS first, retrieve the index value and assign the value to a block in FC11 scripts(Hypothesis: the index value can retrieve in FC11 and has same value with FLS).
    Can I get a same result without Microsoft.Office.Interop.Excel assembly in standard export?
    If the above method is feasible, I will try it first. Thanks!
    0
  • Avatar
    Timur
    As an alternative you can add an additional column in FLS project and then fill in the values in FlexiCapture automatically using a script stage or manually during verification.
    0
  • Avatar
    Ivan
    Hi Timur,

    I added a additional column in FLS, and set their filling type to "Do not Recognize". I am studying in IField now.
    Here are my test codes only in one line:

    1.Context.Field("TableIndex").Items[1].Text = "Test";
    2.Context.Field("TableIndex").Items[0].Text = "Test";

    It's a basic operation in script, but I get this message as following screenshot...
    Because I should learn how to assign a value to element before retrieving the index of order.Thanks!

    3.Context.Field("TableIndex").Text = "Test" is work but it assign all cell
    0
  • Avatar
    TripleD
    Hi Ivan,
    The message you are receiving is due to where you created the rule. You cannot run a rule in the repeatable group that will populate the TableIndex fields with numbers as this field is within the repeatable group and therefore can't recognize which instance of the rule it should be running.

    I would suggest creating an independent hidden text field, or using an existing field that's not in a repeating group, and creating your rule in that something like:

    if(Context.Field("TableIndex").Items.Count > 0) // no point in running rule if it's empty
    {
    for(int i = 0; i < context.field("tableindex").items.count;="">
    {
    Context.Field("TableIndex").Items.Value = i + 1; // Or just i if you want the TableIndex to start from 0 instead of 1
    }
    }


    Hope this helps
    0
  • Avatar
    Ivan
    Hi TripleD,

    Thanks for your reply in advance. But, if I use a independent field, can I get a right index to match one by one in export result?
    Assume a document has table amount "x", each table row amount "y", I want each item has index as "x-y".

    Is there has any nest scripts expression like two-dimensions array?
    Context.Field("Fieldname").Items[x].Context.Field("Fieldname").Items[y].Value
    0
  • Avatar
    Aleksey Nikitin
    Hi Ivan,

    IField.Items is flat collection and each Items instance doesn't have access to child fields.

    I think you should create script in "RepeatSubTableGroup2" field and use
    Context.Field("TableAmountFieldName").Value - Context.Field("TableColumnAmountFieldName").Items[y].Value
    0
  • Avatar
    Aleksey Nikitin
    Hi Ivan,

    IField.Items is flat collection and each Items instance doesn't have access to only child fields.

    I think you should create script in "RepeatSubTableGroup2" field and use
    Context.Field("TableAmountFieldName").Value - Context.Field("TableColumnAmountFieldName").Items[y].Value

    0
  • Avatar
    Ivan
    Hi Aleks,

    Thank for your explanation. But I can't retrieve table counts and rows of each table now, I need to solve this first. And then assign the value to TableIndex finally.
    0
  • Avatar
    Timur
    Hello Ivan!

    In order to modify a certain row in a table you need to use a script stage with a batch processing script or a document processing script and then use the following method to modify data:

    Batch.Documents.Field("").Rows[j].Children[z].Text="test";

    or if it's a document processing script:

    Document.Field("").Rows[j].Children[z].Text="test";

    Children refer to columns.

    regards,
    Tim
    0
  • Avatar
    Ivan
    Hi Timur,

    I use the script in event handler instead of rule script finally and assign the index number to cell well. Thanks for your help.
    0

Please sign in to leave a comment.