Skip to Content
0

How to set the height of the box object (or any object) using the formula..

Apr 11 at 01:22 PM

62

avatar image

How to set the box height using formula editor.

String.Join("<br>", saAddress.Where(s => !string.IsNullOrEmpty(s)))
combing all address 1, address 2, address 3 , posttown and post code to a   single line as "27A SPRING GROVE ROAD<br>HOUNSLOW TW34BE" and finally bound it on a parameter field.
boxissue.png (17.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Biswanath Sahu May 03 at 11:23 AM
0

Hello Friends,

Can anyone give the solution for this issue, i was stuck up since last 2 months, please help..

Regards,

Biswanath

Share
10 |10000 characters needed characters left characters exceeded
Ian Waterman May 03 at 01:02 PM
0

Y0u can not control with a formula.

Place the text which can grow in its own section ie if data in details split into two sections. Place Driver and Operator details into top section and other data in lower section.

Drag the bottom of the Box into the top of the lower section, Box will now grow and move your data in section 2 down as it does so.

Ian

Share
10 |10000 characters needed characters left characters exceeded
Biswanath Sahu May 03 at 03:50 PM
0

Hi Ian,
Thanks for your suggestion, but i had already applied same logic and not getting desired output...

I had tried 3 option but no one can give the correct output:
Option-1:

Output-1:

Option-2:

Output-2:

Option-3:

AND

Output-3:


option1.jpg (66.3 kB)
option1-output.png (23.9 kB)
option2.jpg (64.9 kB)
option2-output.png (23.1 kB)
option3.jpg (64.2 kB)
option3.jpg (49.8 kB)
option3-output.png (23.1 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

What is wrong with OPtion 3, have you tried unchecking extend to bottom of section. In my suggestion you do not want box to do that, you want box to close at top of lower section.

Ian

0
Biswanath Sahu May 04 at 12:10 PM
0

Ian Waterman 4 hours ago

What is wrong with OPtion 3, have you tried unchecking extend to bottom of section. In my suggestion you do not want box to do that, you want box to close at top of lower section.

Ian

Hi Lan,

If i will use Option-3 and unchecking extend to bottom of section, then it will treated as Option-1, Please see the output:

Thanks.


Show 4 Share
10 |10000 characters needed characters left characters exceeded

So what is wrong with option 3. Appears to be doing what you want?

0

Second box bottom line should be close to end of address text object, its client requirement.

0

Don't use boxes, construct a box with Vertical and horizontal lines.

To create line at bottom of address, add line to top of section containing Willow Wren wharf

Extend Vertical lines to top of a group Footer to suit your needs (will need to experiment with different ending positions)

Ian

0

In this example (Driver section) date of birth is present below the full address and you know that the full address is not a single line, its multi line so the DOB is overlap with full address.so for this i had done a common function and it will handled all these stuffs.

Please find the method for customize the position of a bottom border lines / any objects.

steps:

1: Find the box object which we needs to be modify.
2: Inside box how many text object or parameter present and add to a dictionary.
3: Identify the how many <br> available and according to br find the no of line and it multiply with 250.
4: If there is any object present in after full address then the code will place the position after the full address bottom line.
5: And finally the box bottom line is calculated after the last posion.

private void FindReportObjectsInsideBox(string BoxName)
 {
 int TopLine = 0, BottomLine = 0, ReserveTopLine = 0, ReserveBottomLine = 0;
 const string SubReportName = "ReportHeader";
 const string FieldAddressName = "FullAddress";
 const int MinBoxHeight = ConfigInfo.MinBoxHeight;
 const int LineHeight = 250;
 const int LineBottomMargin = 100;
 string strFullAddress = null;
 bool ToChange = false;
 
 if (!(BoxName.Equals("boxOperatorDetails")) && !(BoxName.Equals("boxDriverDetails")) && !(BoxName.Equals("boxDestinationDetails")))
 return;
 
 try
 {
 foreach (ReportDocument subrdoc in rptDocs.Subreports)
 {
 if (subrdoc.Name.IndexOf(SubReportName, StringComparison.OrdinalIgnoreCase) >= 0)
 {
 foreach (BoxObject bxObject in subrdoc.ReportDefinition.ReportObjects.OfType<BoxObject>())
 {
 if (bxObject.Name.Equals(BoxName, StringComparison.OrdinalIgnoreCase))//Found Box Object
 {
 var dictFieldObject = new Dictionary<string, int>();
 foreach (ReportObject rpCheckObject in subrdoc.ReportDefinition.Sections[bxObject.EndSectionName].ReportObjects)
 {
 if (((rpCheckObject.Kind == ReportObjectKind.FieldObject) || (rpCheckObject.Kind == ReportObjectKind.TextObject))
 && ((Enumerable.Range(bxObject.Top, (bxObject.Bottom - bxObject.Top)).Contains(rpCheckObject.Top)) && (Enumerable.Range(bxObject.Top, (bxObject.Bottom - bxObject.Top)).Contains(rpCheckObject.Top + rpCheckObject.Height))
 && (Enumerable.Range(bxObject.Left, (bxObject.Right - bxObject.Left)).Contains(rpCheckObject.Left)) && (Enumerable.Range(bxObject.Left, (bxObject.Right - bxObject.Left)).Contains(rpCheckObject.Left + rpCheckObject.Width))))
 {
 dictFieldObject.Add(rpCheckObject.Name, rpCheckObject.Top);
 if (rpCheckObject.Name.IndexOf(FieldAddressName, StringComparison.OrdinalIgnoreCase) >= 0)
 {
 strFullAddress = ((ParameterDiscreteValue)rptDocs.DataDefinition.ParameterFields[rpCheckObject.Name].CurrentValues[0]).Value.ToString();
 TopLine = rpCheckObject.Top;
 BottomLine = rpCheckObject.Top + (CountNoofLines(strFullAddress) * LineHeight);
 }
 }
 }
 
 foreach (var sortItem in dictFieldObject.OrderBy(i => i.Value))
 {
 if (sortItem.Key.IndexOf(FieldAddressName, StringComparison.OrdinalIgnoreCase) >= 0)
 {
 ToChange = true;
 continue;
 }
 if (ToChange)
 {
 foreach (ReportObject rpUpdateObject in subrdoc.ReportDefinition.Sections[bxObject.EndSectionName].ReportObjects)
 {
 if (((rpUpdateObject.Kind == ReportObjectKind.FieldObject) || (rpUpdateObject.Kind == ReportObjectKind.TextObject))
 && ((Enumerable.Range(bxObject.Top, (bxObject.Bottom - bxObject.Top)).Contains(rpUpdateObject.Top)) && (Enumerable.Range(bxObject.Top, (bxObject.Bottom - bxObject.Top)).Contains(rpUpdateObject.Top + rpUpdateObject.Height))
 && (Enumerable.Range(bxObject.Left, (bxObject.Right - bxObject.Left)).Contains(rpUpdateObject.Left)) && (Enumerable.Range(bxObject.Left, (bxObject.Right - bxObject.Left)).Contains(rpUpdateObject.Left + rpUpdateObject.Width))))
 {
 if ((rpUpdateObject.Name.Equals(sortItem.Key, StringComparison.OrdinalIgnoreCase)) && (BottomLine > (rpUpdateObject.Top)))
 {
 if (Enumerable.Range((ReserveTopLine - 120), 241).Contains(rpUpdateObject.Top))
 {
 BottomLine = ReserveBottomLine;
 }
 ReserveTopLine = rpUpdateObject.Top;
 rpUpdateObject.Top = ReserveBottomLine = BottomLine;
 BottomLine = rpUpdateObject.Top + rpUpdateObject.Height;
 }
 }
 
 }
 }
 }
 bxObject.Bottom = (((BottomLine + LineBottomMargin) - bxObject.Top) <= MinBoxHeight) ? (bxObject.Top + MinBoxHeight) : (BottomLine + LineBottomMargin);
 }
 }
 }
 }
 }
 catch (Exception Ex)
 {
 throw;
 }
 finally
 {
 strFullAddress = null;
 }
 }
0