Report Script: Multi-line text line spacing (19): Difference between revisions

no edit summary
(Created page with "==Introduction== XRLabel control is a text display that does not provide spacing between lines.<br/>However, XRRichText control has the properties to set the text spacing betw...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 12:
{{SourceDownload|link=https://drive.google.com/open?id=1aat9_8TB44qSLo13mPoMlIdoXpf84NPq|remark=(AutoCount Accounting 1.8 / 1.9)|Download Report Template|Invoice (Spacing in Description with RichText)}}
[[File:ReportScript.TextLineSpacing.png|link=]]<br />
<br/>
 
==Report Design==
#Replace the '''Label''' (XRLabel) that is bound to "Description" with '''Rich Text''' (XRRichText) control
#Change the font of XRRichText'''(Name)''' to "TahomaxrRTItemDesc", and font size(in =Property 9Grid)
#AmendChange thefont (Name)of to "xrRTItemDesc"
#*Font Name = "Tahoma"
#*Font size = 9
#In Property Grid, Click [+] button of Scripts to reveal the events of this Rich Text
#Find Before Print, and click into the text box on the right
Line 31 ⟶ 33:
===Add function call in xrRTItemDesc_BeforePrint event===
<syntaxhighlight lang="csharp">
private void richText1_BeforePrintxrRTItemDesc_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
string desc = DetailReport.GetCurrentColumnValue("Description").ToString();
 
//YouLine mayspacing changeis theset valueto of1.5 spacingpt.
//You may change the value of spacing, but always end with letter 'f'.
(sender as XRRichText).Text = FormatLineSpacing(desc, 1.5f);
}