Click here to Skip to main content
13,629,937 members
Rate this:
 
Please Sign up or sign in to vote.
I have a Winforms application (in Visual Studio 2015) that contains a Microsoft Report Viewer control that preview and prints report.

One user has 4K resolution monitor and when he runs the report it is shrunk to 2/3 size in microsoft report viewer control.

when I try to export this report into PDf it look proper.

The AutoScaleMode property of the form containing the Microsoft Report Viewer is set to "Font", although it doesn't seem to affect the report viewer if i change this.

I need some way to specify in the report viewer control itself that it should be rendered at 96dpi regardless of the system dpi setting. Is there any way to full-fill my purpose.

What I have tried:

I have added below code in my application manifest file but I could not work for me.

<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
Posted 16-May-18 1:41am
Updated 16-May-18 4:40am
v2
Comments
viru mayu 17-May-18 2:03am
   
I am using local report (.rdlc) instead of server report and you just give me code for creating report but I have a scalling issue in 4k resolution and I need solution for that issue

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

public partial class Form1 : Form  
{  
    private void Form1_Load(object sender, EventArgs e)  
    {  
        // Set the processing mode for the ReportViewer to Remote  
        reportViewer1.ProcessingMode = ProcessingMode.Remote;  

        ServerReport serverReport = reportViewer1.ServerReport;  

        // Get a reference to the default credentials  
        System.Net.ICredentials credentials =  
            System.Net.CredentialCache.DefaultCredentials;  

        // Get a reference to the report server credentials  
        ReportServerCredentials rsCredentials =  
            serverReport.ReportServerCredentials;  

        // Set the credentials for the server report  
        rsCredentials.NetworkCredentials = credentials;  

        // Set the report server URL and report path  
        serverReport.ReportServerUrl =   
            new Uri("http:// <Server Name>/reportserver");  
        serverReport.ReportPath =   
            "/AdventureWorks Sample Reports/Sales Order Detail";  

        // Create the sales order number report parameter  
        ReportParameter salesOrderNumber = new ReportParameter();  
        salesOrderNumber.Name = "SalesOrderNumber";  
        salesOrderNumber.Values.Add("SO43661");  

        // Set the report parameters for the report  
        reportViewer1.ServerReport.SetParameters(  
            new ReportParameter[] { salesOrderNumber });  

        // Refresh the report  
        reportViewer1.RefreshReport();  
    }  
}  
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.180712.1 | Last Updated 16 May 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100