Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
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

C#
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();  
    }  
}  
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900