简体   繁体   中英

How to check if text assigned to TextObject grows to next line in Crystal Report

I am using CrystalReportViewer in .aspx page for generating a simple Report liek below:

 ReportClass rpt = new Report();
    CrystalReportViewer1.ReportSource = rpt;
    
    TextObject txtName = (TextObject)rpt.ReportDefinition.ReportObjects["txtName"];
    txtName.Text = GetNameFromDB();

Sometimes the function GetNameFromDB() returns long name and the textObject txtName grows to next line. Is there any way to check if txtName grows to next line or not? How can i check this?

For certain use cases, yes, there is a way. But it requires use of extra code or a Crystal Reports UFL (User Function Library).

But, as suggested by R. McMillan, please explain your use case.

For example, simply placing the objects below the text object in their own section (split section option in Crystal) may offer a simple solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM