Home » VB.Net

Reporting Services - Orientation Paper - Widht - Height

Hello Guys.
Have you seen that when the Widht is bigger than height, the SSRS change the orientation paper to landscape and in the another way it changes to portrait?
I have a paper who has more widht than height but I want to print it as portrait, because It will be printed in a continuos printer and the size of each paper is like an envelope.
I Have been looking for a solution on internet about this issue, but I havent found anything. 

For example. one Guy has the same problem and he wrote this: (I know is nothing about the printer, the problem is in the configuration of SSRS.) Thanks in advance!

I've come across what appears to be a bug in SSRS. If after reading this post you feel otherwise, please reply to this thread...

I am trying to use SSRS to print to a Dymo LabelWriter 400 printer. This is a specialized label printer that prints one label to a page. The label paper I am using 2-1/2 inches by 1-1/2 inches. The Dymo printer driver prints portait layout as being the 2-1/2 inches width and 1-1/2 inches height. I assume that is because the paper rolls through the printer that way and labels normally are printed with more width than height.

Other software programs I use to print to this printer handles it properly (Microsoft Word, Microsoft Office Document Imaging, Dymo Label software). However, SSRS seems to assume that portrait layout must mean paper height > width, as there is no explicity setting in SSRS to for page layout. The result is that no matter how I layout my SSRS report (e.g., switch width-height values, use tb-rl to rotate text), SSRS makes the final decision on whether it is portrait or lanscape. And in this case of the Dymo printer, it always sets it to the opposite of what it should be. Changing the printer settings (whether default or whether in print dialog) does not correct it.

Although assuming that portrait layout must mean paper height > width may seem to make logical sense, not every printer works that way; and other software programs (including Microsoft Office) do not make that assumption. It seems that SSRS and/or RDL spec should allow one to explicitly set portrait/landscape setting and not care about width-height ratio. It should be left to the printer and printer driver to decide.

Have other people come across this issue, either with Dymo printer or in other context? Were they able to find a workaround?


7 Answers Found


Answer 1

Hi smoncayo,

You are right. SQL Server Reporting Services print  a report in landscape  or portrait  based on the difference between the width and height.
If the width is larger than the height, the report will printed  in landscape, otherwise it will be printed in portrait.

In order to work around the issue  you mentioned, we can implement our customized application to render the report using Reporting Services web service API, and then use PrintDocument .NET object to print the report in portrait orientation.'

Or, please submit a wish at http://connect.microsoft.com/sql

For more information, please see:
ReportExecutionService.Render Method: http://msdn.microsoft.com/en-us/library/reportexecution2005.reportexecutionservice.render.aspx
PrintDocument Class: http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx

If you have any more questions, please feel free to ask.

Jin Chen

Jin Chen - MSFT

Answer 2

Hello Jin Chen. Thanks for your answer.

I'll be honest.
I have no idea about ReportExecution2005. 
I know is a kind of web services  from reporting  services but I think this services is not already deployed in my server. (I am using Reporting services 2008).
I tried to search the information on internet  but i feel that I am getting more confuse.

I just dont know how to start. and I am very worried about that.
Could you please help me with an step by step?

I really apreciate your help.




Answer 3


Any help regarding this issue?
I do apreciate your help guys.



Answer 4

Hi Smoncayo,

Reporting Services 2008 has the same end points with Reporting Services 2005, which means ReportExecution2005 is available in Reporting Services 2008 too.

There is a sample in the article I posted before. What we just need to do is add a web service reference.

There is a Walktrhough, that will help to understand:

Jin Chen


Answer 5

Hello Jin-

Thanks for your Answer.

I already added my Service Reference. But when I tried to use the code that you gave me, 

the class ReportExecutionService rs = new ReportExecutionService() could not be found.

I am forgeting something?

I added my code. Thanks again!









































publicvoid ObtenerWebReference()


ReportExecutionService rs =


new ReportExecutionService(); // could not be found

rs.Credentials = System.Net.



rs.Url =





// Render arguments



byte[] result = null;



string reportPath = "/AdventureWorks Sample Reports/Employee Sales Summary";



string format = "MHTML";



string historyID = null;



string devInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";



// Prepare report parameter.



ParameterValue[] parameters = newParameterValue[3];

parameters[0] =



parameters[0].Name =



parameters[0].Value =



parameters[1] =



parameters[1].Name =



parameters[1].Value =


"6"; // June

parameters[2] =



parameters[2].Name =



parameters[2].Value =





DataSourceCredentials[] credentials = null;



string showHideToggle = null;



string encoding;



string mimeType;



string extension;


Warning[] warnings = null;


Warning[] warnings = null;

Warning[] warnings = null;


ParameterValue[] reportHistoryParameters = null;



string[] streamIDs = null;

ExecutionInfo execInfo =


new ExecutionInfo(); // could not be found

ExecutionHeader execHeader =


new ExecutionHeader();// could not be found

rs.ExecutionHeaderValue = execHeader;

execInfo = rs.LoadReport(reportPath, historyID);






String SessionId = rs.ExecutionHeaderValue.ExecutionID;



Console.WriteLine("SessionID: {0}", rs.ExecutionHeaderValue.ExecutionID);





result = rs.Render(format, devInfo,


out extension, out encoding, out mimeType, out warnings, out streamIDs);

execInfo = rs.GetExecutionInfo();



Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime);




catch (SoapException e)








// Write the contents of the report to an MHTML file.







FileStream stream = File.Create("report.mht", result.Length);



Console.WriteLine("File created.");

stream.Write(result, 0, result.Length);



Console.WriteLine("Result written to the file.");





catch (Exception e)











Answer 6

Hi smoncayo,

You may try to import the ReportingService namespace first to fix the issue.

For example:
using myNamespace.MyReferenceName;

The myNamespace is the namespace of the project, and the MyReferenceName is the reference name of the ReportExecution service.

Jin Chen


Answer 7

Hello Jin.

Yes, Its rare cause I already added the namespace.






But, still cant recognice that. 


ReportExecutionService rs = new ReportExecutionService(); // could not be found

Any other suggestion?

Thanks for your help and patience.




<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure