Thursday, August 14, 2014

NextReports: HTML Text inside PDF/RTF

Sometimes data inside database may contain simple HTML which has some formatting using tags like < b >,< i >,< font >, < br >.  When we render to a HTML file, we will see data formatted as needed.

But it would be nice to have it also in PDF / RTF files. Starting with NextReports 7.3 this will be possible out-of-the-box. The only requirement is that data starts with < html > and ends with < /html > and contains a correctly formed HTML string.

Let's say we have a column in which data is HTML text like:

<html><b><font size=\"4\" color=\"blue\">Winters</font></b></html>

Then our PDF/RTF exported reports will look like the following:

If your column does not contain < html > and < / html > tags , you can create an expression and add them by yourself.

Tuesday, August 05, 2014

Display revisited

NextCharts 7.2 introduced a new type of report / widget called display. You can read about it here.

One thing that needs to be polished is title alignment. In 7.2 release title is aligned with value. This is good in all cases when value is big enough to be at least length comparable with title. But in case the value is small and title is longer, display does not look very nice.

Lets take a simple display example when the value is smaller than the title:

In such cases it would be nicer to center the title text. That's why we added a new property to NextCharts display making json containing titleAlignment with two possibilities: center or alignToValue. By default, alignToValue is selected if property is undefined. Choosing center for this property will make the widget looks as we desired:

When we define the report in NextReports Designer 7.3, title band element can have horizontal alignment property selected as center or left (right is not considered, generating inside json alignToValue).