How to handle variable width FieldObjects in Crystal Reports

I have a Crystal report that is being viewed using the CrystalReportViewer control on an .aspx page (using VS2008).

The report has two data-driven FieldObjects (which can contain a variable number of characters) that I would like to display on the same line next to each other.

The problem is that the text in the first FieldObject is too long that it overlaps the text in the second FieldObject.

I tried setting “CanGrow = True” and “MaxNumberOfLines = 1” in the first field object to “click” the second FieldObject on the right, but that did not work.

How to get the second FieldObject that will be displayed immediately after the first FieldObject regardless of the length of the text in the first?

We welcome any knowledge that you can drop.

+3
source share
2 answers

You can add a text object to the report. And, while editing the text of the text object, drag the field that you want to show from the object explorer into the text field. Then press the spacebar, then drag the second field into the same text field. Your two fields will always be a part. You could, of course, add more spaces or any other text that you want.

+5
source

Or you can create a function that returns field1 + "" + field2 and adds the function to the report.

+1
source

Source: https://habr.com/ru/post/1696584/


All Articles