Skip to Content

Change Font Size after First Paragraph/Line

Hi there

I have a text field in which I want the first paragraph (or line) to be in a large font, then all following paragraphs (ie. after the first line feed) to be in a smaller font.

Can anyone suggest a formatting formula I can use to do this?

many thanks

-Karen

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 06, 2011 at 05:25 AM

    Hi Karen,

    If you're Crystal Reports 2008, then here's how you can do it:

    1) Create a formula and use this code:

    numbervar lf := instr({string_field},chr(10)); //Find the 1st occurrence of a line feed
    '<big>'&Mid({string_field},1,lf-1)&'</big>'& //Increases the font size of the 1st line by 2 points
    Replace(Mid({string_field},lf,len({string_field})),chr(10),'<br>') //Finds the Line Feeds in the remaining text and replaces them with the corresponding <br> tag that HTML supports

    2) Place the formula beside the original field in the report

    3) Right-click the formula field > Format field > Paragraph tab > Set 'Text Interpretation' to 'HTML Text'

    4) Go to Common tab > check 'Can Grow' > OK

    The first line of the field will be 2 points bigger than the rest of the lines. You can also use the 'font size' tag instead of <big>, however the only supported values are 1 to 7 and trust me 7 is too huge to use! You would need to play around with the values if you wish to use the 'font size' tag.

    Let me know how this goes!

    -Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

    • Hurrah! Getting closer... where there are two paragraphs, I now get a large one and then a smaller paragraph.... There is just one more adjustment if you have the time to help me.... I'd like the smaller font to be 2 steps smaller than the large font (I've used size 4 for my large font, so 2 would be good for the smaller one).

      many thanks! excellent!

      -Karen

  • Posted on Dec 07, 2011 at 10:19 PM

    oops didn't mean to mark answered just yet

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.