コミュニティ

Add field region

Hi,

Following code is use to add region of field1 to field2 in FC11 -
field2.AddRegion( field1.Regions[0].Page, field1.Regions[0].SurroundingRect.ToString() );

I have a scenario where field1 has more than 1 region on multiple pages, then with above code only one region of page 1 gets added, how to add the others? Is it possible?
Secondly, when I change field1 region then field2 region should also get changed. How to do this?

NOTE - field2 is picture field. I need to export picture of invoice based on particular field(field1 here)
Other approach/solution if any are welcome!

Thanks,
Kalyani


この記事は役に立ちましたか?

0人中0人がこの記事が役に立ったと言っています

コメント

3件のコメント

  • Avatar
    Alberto Torino
    Hello Kalyani:
    Regions is an array of field regions. Using the above code you're only adding the first field1 region to field 2. You should iterate through all the array using Field1.IFieldRegions.Count.
    Through the IFieldRegion you can access the page that contains the region and the Rects the region consists in.
    Hope this helps.
    Regards,
    0
  • Avatar
    Permanently deleted user
    Hi,

    I wrote following code -
    for (int i = 0; i < context.field("field1").regions.count="" ;="">
    {
    Context.Field("field2").AddRegion(Context.Field("field1").Regions.Page, Context.Field("field1").Regions.SurroundingRect.ToString());
    }

    But its not working, throwing an error.
    0
  • Avatar
    Alberto Torino
    Hi Kalyani:
    First of all, make sure both Fields(field1 & field2) are included as available fields for the rule and that Field2 is not marked as read only. And then check if you have a space between the f and the i in the AddRegion(Context.Field("f ield1").Regions.Page , as it is shown in the code you included.
    Regards,
    0

サインインしてコメントを残してください。