LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set font in Rich Text Box?

I'm trying to build an RTF report using a Rich textbox which I'm saving with an Invoke Node.  However, I can't seem to figure out how to set font properties by entry as I'm populating the box - everything else seems to pretty much work.

 

For example, the first line will be the title.  I want this text to be 16 point Arial Bold.

Next will be the report creation date - I want this in 12 point Arial Normal

 

Using a constructor node into a property node I was able to set the font for the whole textbox, but not change it any further.

 

This whole thing is pushing my comfort zone, but I'm sure there has to be a way.  If I'm creating an RTF file the hard way, I'll take any advice on that as well 😄

 

If it matters, the final application will eventually be made into an executable for distribution to customers.

 

I'm using 8.5, BTW

 

Thanks,

Mike

0 Kudos
Message 1 of 13
(7,998 Views)

Hi,

    You can try Report genration Toolkit 1.1.1  using Microsoft Office, their you can go with MS Word or MS Excel and you can set the font size for individual lines or Headers. Since it is fully customizable, you can generate with  some jazzy template also. Try this!

 

With Regards,

Vijay

Message 2 of 13
(7,984 Views)

vijai-conz wrote:

Hi,

    You can try Report genration Toolkit 1.1.1  using Microsoft Office, their you can go with MS Word or MS Excel and you can set the font size for individual lines or Headers. Since it is fully customizable, you can generate with  some jazzy template also. Try this!

 

With Regards,

Vijay


One point to note regarding the Report Generation Toolkit, is that to create microsoft office documents, the user must have MS Office installed on their machine. LabVIEW opens then hides Office and edits the document, so it doesn't quite "generate" as one would think. You can however create html reports that need nothing more than a browser to view.

_____________________________
- Cheers, Ed
Message 3 of 13
(7,964 Views)

I looked into using the Report Toolkit for Office, but decided against it for the reasons Ed mentioned as well as the $500 investment.  I also looked at creating HTML reports, which would work okay, except that it doesn't appear that I can save the report and later append data to it.  A text or sreadsheet file would be better to allow easier editing, too.

 

A little info on the application:  The program is going to perform various calculations based on user inputs.  The user will have the option to click on a "add to report" button to append the current calculation data to the end of the report.  If the user is working on a larger job that will span several days/weeks, the report needs to be able to be saved and appended to later. 

 

Thanks,

Mike

Message Edited by MB1 on 09-17-2008 08:48 AM
0 Kudos
Message 4 of 13
(7,943 Views)

I'm sure I can remember being able to open an existing html document for appending further data into.

 

Let me check

_____________________________
- Cheers, Ed
Message 5 of 13
(7,937 Views)
That would be great.  Thanks.
0 Kudos
Message 6 of 13
(7,921 Views)
No, there isn't a VI for opening an html file for appending. I did find my code where I edited a file. What I did was open the html file as a normal text file and remove the </body> and </html> tags, then append extra data and close the tags again.
_____________________________
- Cheers, Ed
0 Kudos
Message 7 of 13
(7,895 Views)

Thanks, Ed.

 

I think I actually just figured out this morning how to set the font "on the fly" in a Rich Textbox.  I was initially using the "Font" property for the Rich Textbox.  That seemed to set the font for the whole textbox.  I tried the "selection font" property, and it appears to do exactly what I want.  Everything I read previously on the selection font property made it seem like it would only change the font of text already in the box - apparently, I was wrong.

 

Again, thanks for your help.

0 Kudos
Message 8 of 13
(7,882 Views)

I'm trying to add limited (for now) functionality to a RichTextBox to allow a user to bold, italicize or underline selected parts of the text. I've tried the above steps, but I'm unable to change the various font properties to "Write".

  

To see if I was totally off base, I tried this with an ActiveX TextBox, and I was able to change the font properties to "Write" and get text to go bold etc. Unfortunately, I need a RichTextBox for my application.

 

Not sure if I'm missing something very fundamental here or what ...

0 Kudos
Message 9 of 13
(7,025 Views)

Hi Steiger,

 

You need to set the SelectionFont property instead of read from it.

 

FontExample.png 

Jared S.
Applications Engineering
National Instruments
Message 10 of 13
(6,981 Views)