none
Special characters displayed incorrectly when compression disabled in local ReportViewer RRS feed

  • Question

  • Hi, in my WPF application I am using Microsoft.ReportViewer.WinForms.dll 10.0.0.0 to generate a PDF file on the fly. I don't want the PDF file to be compressed so I set the HumanReadablePDF attribute to true:

    LocalReport localReport = new LocalReport { ReportPath = "Report1.rdlc" };
    
    Warning[] warnings;
    string[] streamids;
    string mimeType, encoding, extension;
    
    string deviceInfo = "<DeviceInfo><HumanReadablePDF>True</HumanReadablePDF></DeviceInfo>";
                
    byte[] data = localReport.Render("PDF", deviceInfo, out mimeType, out encoding, out extension, out 
    
    streamids, out warnings);
    
    File.WriteAllBytes("Test.pdf", data);

    My RDLC file contains a textbox containing the euro currency symbol:

    <Textbox Name="Textbox1">
      <CanGrow>true</CanGrow>
      <KeepTogether>true</KeepTogether>
      <Paragraphs>
        <Paragraph>
          <TextRuns>
            <TextRun>
              <Value>Testing €</Value>
              <Style />
            </TextRun>
          </TextRuns>
          <Style />
        </Paragraph>
      </Paragraphs>
      <rd:DefaultName>Textbox1</rd:DefaultName>
      <Top>1.28799cm</Top>
      <Left>3.77507cm</Left>
      <Height>0.6cm</Height>
      <Width>7.44771cm</Width>
      <Style>
        <Border>
          <Style>None</Style>
        </Border>
        <PaddingLeft>2pt</PaddingLeft>
        <PaddingRight>2pt</PaddingRight>
        <PaddingTop>2pt</PaddingTop>
        <PaddingBottom>2pt</PaddingBottom>
      </Style>
    </Textbox>

    The problem is that the euro symbol is rendered as a question mark.

    Help is appreciated. 

    Michel Miranda

    Saturday, September 20, 2014 6:53 AM

All replies

  • Can you try escaping the euro character as:

    &euro; or &#8364;

    Saturday, September 20, 2014 7:36 AM
  • No, same result.
    Saturday, September 20, 2014 7:50 AM
  • When I use the report viewer and hit export to pdf I get the euro sign correctly.

    If I open the PDF file in a text editor with the ? and replace it by hand with the euro sign it works also correctly.


    Saturday, September 20, 2014 8:10 AM
  • When you hit the export to pdf menu item the PDF file is compressed by default. In that case the euro sign is rendered correctly. But I don't want the file to be compressed. That's why I set the HumanReadablePDF attribute.
    Saturday, September 20, 2014 8:18 AM
  • I will give a try to SAP Crystal Reports for VS 2013 instead of 2010 and see if this is resolved

    Saturday, September 20, 2014 8:36 AM
  • Crystal Reports are really SAP Crystal Reports and from SAP forum there is an explanation that fits this issue (since the euro sign is non-Western European character) and from what I can tell the PDF is created with ANSI Encoding.

    << /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>

    http://scn.sap.com/thread/1471968

    Saturday, September 20, 2014 8:40 AM
  • cnk_gr, I really appreciate your response. 

    But I don't have a solution to my problem. 

    It looks like a problem in ReportViewer. Compressed files are rendered correctly. Human readable files are not. 

    Michel Miranda

    Saturday, September 20, 2014 9:01 AM
  • It looks like ReportViewer has an issue where the de-compressed output will not display Unicode symbols like the euro. 

    Is there someone having a fix?

    Michel Metselaar

    Saturday, September 20, 2014 9:23 AM
  • Trying the same thing with

    VS 2013 (ReportViewer controls version 11) worked like a charm.

    VS 2010 (ReportViewer controls version 10) didn't work.


    • Edited by cnk_gr Saturday, September 20, 2014 2:12 PM
    Saturday, September 20, 2014 2:12 PM