cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.
Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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;
 }
 }

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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