0

I have a .Net 4.6 C#/WPF app that is deployed on several Windows 10 desktops. Reporting is done using local RDLC reports. These can be previewed by the user in a ReportViewer control housed in a Windows Form. I have dozens of reports in this app that have all previewed as designed for years. The app was installed on a new user workstation recently, and on this system, one particular report that displays DataBar charts in the rows of the report Tablix is enlarging just these chart items by over a factor of 2. This screen shot shows how this tablix looks on all other systems vs. this new system: Odd chart enlargement

Edit: Also found that this font error occurs on this report when rendering the report to PDF. All reports in the application use the following logic to render to PDF. Only this report is showing this font enlargement:

        // Variables
        Warning[] warnings;
        string[] streamIds;
        string mimeType = string.Empty;
        string encoding = string.Empty;
        string extension = string.Empty;

        // Setup the report viewer object and get the array of bytes
        reportViewer1.ProcessingMode = ProcessingMode.Local;

        reportViewer1.LocalReport.DataSources.Clear();
        ReportDataSource datasource = new ReportDataSource("MainData", RptData);
        reportViewer1.LocalReport.DataSources.Add(datasource);

        byte[] bytes = reportViewer1.LocalReport.Render(
            "PDF", null, out mimeType, out encoding, out extension,
            out streamIds, out warnings);
        using (FileStream fs = new FileStream(fileName, FileMode.Create))
        {
            fs.Write(bytes, 0, bytes.Length);
        }

What might cause one particular system to render this one part of this report so strangely?

Twitort
  • 17
  • 5
  • Changing the output mode of `rdlc` to `pdf` can better fix this problem. – Jiale Xue - MSFT Nov 24 '21 at 06:07
  • Does this answer your question? [Report Viewer - scaling issue with system DPI change](https://stackoverflow.com/questions/23411240/report-viewer-scaling-issue-with-system-dpi-change) – Jiale Xue - MSFT Nov 24 '21 at 06:11
  • I'll check the user's DPI settings to see if this might be the cause. – Twitort Nov 24 '21 at 19:14
  • Checked with user... the strange scaling of the chart occurs both when previewed on screen or printed to PDF. Have not yet tested printing the report to an actual printer yet. The user's Windows 10 display settings are at their defaults - no enlarged fonts or non-standard DPI settings. – Twitort Nov 24 '21 at 23:38
  • Are you sure that the operation you are performing is to convert `rdlc` itself into `pdf`? There will be no format errors in pdf. Did you just print it as `pdf`? [Have you checked similar links?](https://stackoverflow.com/a/30740036/16764901) – Jiale Xue - MSFT Nov 25 '21 at 06:35
  • Updated the original post to include the PDF rendering code. – Twitort Nov 29 '21 at 22:44

0 Answers0