Posted 9 June 2024, 12:29 pm EST - Updated 9 June 2024, 1:12 pm EST
Using: ActiveReports v16.4.1 / Visual Studio 2022 / .NET Framework v4.8.1 / WinForms / C#
On a code-based SectionReport, I have the following code in the Detail_Format() event to render a paragraph onto the report with appropriate wrapping based on a given width. However, when it renders on the report, it renders on one line and gets cut off at the end of the line (the right page margin). I expect the text to render as a paragraph, wrapping at the set width. The report units are set to Inches in the report settings.
This is my code:
Document.Pages[Document.Pages.Count - 1].Font = new Font(pvFontName, pvSizeofFont, FontStyle.Bold);
pvWidth = 7.8f; // 7.8 inches
SizeF sz = Document.Pages[Document.Pages.Count - 1].MeasureParagraphHeight(pvData, pvWidth);
float intParagraphHeight = sz.Height;
Document.Pages[Document.Pages.Count - 1].DrawText(pvData, pvX, pvY, pvWidth, intParagraphHeight);
Could you please guide me as to what could be wrong and how to resolve this?