Custom font not visible in report viewer

9 posts, 0 answers
  1. Thomas Kjaereng
    Thomas Kjaereng avatar
    3 posts
    Member since:
    Oct 2015

    Posted 21 Sep 2016 Link to this post

    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?

     

     

     

  2. Stef
    Admin
    Stef avatar
    3611 posts

    Posted 21 Sep 2016 Link to this post

    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
  3. Yemo
    Yemo avatar
    13 posts
    Member since:
    Sep 2006

    Posted 08 Feb in reply to Stef Link to this post

    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

  4. Stef
    Admin
    Stef avatar
    3611 posts

    Posted 09 Feb Link to this post

    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
  5. Yemo
    Yemo avatar
    13 posts
    Member since:
    Sep 2006

    Posted 10 Feb in reply to Stef Link to this post

    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

  6. Stef
    Admin
    Stef avatar
    3611 posts

    Posted 15 Feb Link to this post

    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
  7. Yemo
    Yemo avatar
    13 posts
    Member since:
    Sep 2006

    Posted 17 Feb in reply to Stef Link to this post

    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

  8. Stef
    Admin
    Stef avatar
    3611 posts

    Posted 17 Feb Link to this post

    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
  9. Yemo
    Yemo avatar
    13 posts
    Member since:
    Sep 2006

    Posted 17 Feb in reply to Stef Link to this post

    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

Back to Top