This is a migrated thread and some comments may be shown as answers.

Custom font not visible in report viewer

8 Answers 1516 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Thomas Kjaereng
Top achievements
Rank 1
Thomas Kjaereng asked on 21 Sep 2016, 11:57 AM

Hello

I have a report that uses a custom font (ttf). The font is installed on the computer. 

In Report Designer, the font is rendered correctly, however when I load the report (from a local file) into our wpf application (report viewer) the font is not displayed correctly, i.e. it shows a different font. 

When exporting the report to PDF or Excel etc the report is once again correct. 

We are not using report server - everything is generated locally. 

Any hints on what might cause this?

 

 

 

8 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 21 Sep 2016, 01:46 PM
Hello Thomas,

The used fonts must be installed on the machine where reports are processed and rendered.

Other approach is to use Telerik Reporting R3 2016 or greater, where we introduced the Private Fonts feature.


Let us know if you need further help.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Yemo
Top achievements
Rank 1
Iron
answered on 08 Feb 2017, 07:27 PM

Hello,

Do you have any C# code sample to do this with Telerik Reporting R3 2016 or greater? The documentation only refers to config files.

Thanks

0
Stef
Telerik team
answered on 09 Feb 2017, 03:54 PM
Hello Yemo,

Please check the attached demo project. You may need to run the Upgrade Wizard to update its assembly references. Private fonts should be configured through the application's configuration file.

We will appreciate it if you let us know more details about the reason to need to configure private fonts in code only.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Yemo
Top achievements
Rank 1
Iron
answered on 10 Feb 2017, 06:23 PM

Greetings,

Thanks for the sample, in VB too :)

Yes. Had to use the upgrade wizard to run against 2016 R3, even after having manually replaced the DLLs to the latest version. I *think* the sample is working, its just that the Gotham Book you chose is pretty close in style to MS Sans Serif on my screen.

Please try the attached font file, "Oblivious", from the same great font source you obtained Gotham Book.I get a REST API error when I try to use it. Simply rename the extension from png to ttf as your upload filters only allow graphics

Reason to need to configure private fonts in code only? Its to do with specialised reporting needs. For example, if you've ever done financial reporting where you've had to display large financial numbers, you usually run out of horizontal space unless you abbrieviate them. These are situations where you display multiple columns side by side, before showing a chart (or something) next to the table.

In these scenarios, a condensed font makes all the difference as it enables you to avoid reducing the the font size and still to use half the horizontal space. I moved over from one your competitors products which used to allow me to do this. Always wondered why the functionality was not there by default.

Best regards

 

 

I used to use a competitors product

0
Stef
Telerik team
answered on 15 Feb 2017, 02:25 PM
Hi Yemo,

The attached demo project uses the provided "Oblivious font" successfully for its HTML, Image, PDF rendering. Settings applied through the configuration file are applied to programmatically exported reports as well.

Font settings can checked in:
  1. Reports/Report1.cs
  2. Web.config
  3. WebForm1.aspx
The project uses v11.0.17.201.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Yemo
Top achievements
Rank 1
Iron
answered on 17 Feb 2017, 10:40 AM

Stef,

Thanks for the sample, but I don't have access to v11.0.17.201, and was hoping to confirm that it works against R3 2016 as discussed.

Based on the attached v11.0.17.201.sample, I modified the web.config of the earlier (converted to R3 2016) sample and noticed that the real issue is that the sample project has cached the report, and so any changes even in the report designer are not reflected when the report is run.

Thanks,

Yemi

0
Stef
Telerik team
answered on 17 Feb 2017, 03:44 PM
Hello Yemo,

Please downgrade the provided project by using the Upgrade Wizard. Then restart the browser to create a new viewer.

Cached content is taken from teh Reporting REST service storage if the same viewer (clientId) requests the same report (name and parameters combination). By creating a new clientId, the report will be processed again. you can also change the cache storage location by updating the Reporting REST Service's HostAppId for development and test purposes. Or a hack is to add a DateTime report parameter in the report, and always set a new value for it through the viewer's reportSource.

Details when and how cache entries are deleted are available in Cache Management.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Yemo
Top achievements
Rank 1
Iron
answered on 17 Feb 2017, 10:39 PM

Stef,

Ok that worked, both the downgrade and the displaying of the font. Oblivious was just a sample as its really a condensed font I need.

Can play around with this sample to get what I need.

Thanks for your help & on the pointers to the cache management

Tags
General Discussions
Asked by
Thomas Kjaereng
Top achievements
Rank 1
Answers by
Stef
Telerik team
Yemo
Top achievements
Rank 1
Iron
Share this question
or