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
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
Comments
3 comments
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,
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.
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,
Please sign in to leave a comment.