RGS
RGS

Reputation: 5211

How to set line height to text box in RDLC report?

I have tried to increase line height to text box in RDLC report. I have increased values of padding and line spacing properties. But padding and line-height properties not working in RDLC report. How to resolve that above mentioned issue?

Upvotes: 1

Views: 13262

Answers (2)

Naro
Naro

Reputation: 1

Set the TextBox (or Placeholder) markup type as HTML - Interpret HTML tags as style"> In the expression :

="<div style='padding-bottom:0.05in;'>" & Fields!Description.Value & "</div>" 

Upvotes: 0

Oceans
Oceans

Reputation: 3509

As far as I'm aware of, the line-height property is only supported when using the HTML markup.
Just set the TextBox (or Placeholder) markup type as HTML - Interpret HTML tags as style". Then you can simply use CSS to format your text as wanted.

For your example you could use an expression similar to this:

= "<p style='line-height:1.5;'>" + Fields!MyText.Value + "</p>"

Update: The above code is for when you're defining the expression in the Designer view. I'll add the code after compilation to avoid any mistakes for those that wish to edit it in the code:

<Paragraphs>
    <Paragraph>
        <TextRuns>
            <TextRun>
                <Value>="&lt;p style='line-height:1.5'&gt;" &amp; Fields!MyText.Value &amp; "&lt;/p&gt;"</Value>
                <MarkupType>HTML</MarkupType>
                <Style>
                    <FontSize>8pt</FontSize>
                </Style>
            </TextRun>
        </TextRuns>
        <Style />
    </Paragraph>
</Paragraphs>

Upvotes: 2

Related Questions