Report Script: Multi-line text line spacing (19): Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
==Report Design== |
==Report Design== |
||
#Replace the '''Label''' (XRLabel) that is bound to "Description" with '''Rich Text''' (XRRichText) control |
#Replace the '''Label''' (XRLabel) that is bound to "Description" with '''Rich Text''' (XRRichText) control |
||
#Change the |
#Change the '''(Name)''' to "xrRTItemDesc" (in Property Grid) |
||
# |
#Change font of xrRTItemDesc |
||
#:Font Name = "Tahoma" |
|||
#:Font size = 9 |
|||
#In Property Grid, Click [+] button of Scripts to reveal the events of this Rich Text |
#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 |
#Find Before Print, and click into the text box on the right |
||
Line 31: | Line 33: | ||
===Add function call in xrRTItemDesc_BeforePrint event=== |
===Add function call in xrRTItemDesc_BeforePrint event=== |
||
<syntaxhighlight lang="csharp"> |
<syntaxhighlight lang="csharp"> |
||
private void |
private void xrRTItemDesc_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) |
||
{ |
{ |
||
string desc = DetailReport.GetCurrentColumnValue("Description").ToString(); |
string desc = DetailReport.GetCurrentColumnValue("Description").ToString(); |
||
// |
//Line spacing is set to 1.5 pt. |
||
//You may change the value of spacing, but always end with letter 'f'. |
|||
(sender as XRRichText).Text = FormatLineSpacing(desc, 1.5f); |
(sender as XRRichText).Text = FormatLineSpacing(desc, 1.5f); |
||
} |
} |