我正在尝试以横向或纵向打印本地报告。
private void Export(LocalReport report)
{
Warning[] warnings;
m_streams = new List<Stream>();
var deviceInfo = new StringBuilder();
deviceInfo.AppendLine("<DeviceInfo>");
deviceInfo.AppendLine("<OutputFormat>EMF</OutputFormat>");
//"11.7in", "8.3in"
deviceInfo.AppendLine("<PageWidth>11.7in</PageWidth>");
deviceInfo.AppendLine("<PageHeight>8.3in</PageHeight>");
deviceInfo.AppendLine("</DeviceInfo>");
report.Render("Image", deviceInfo.ToString(), CreateStream, out warnings);
foreach (var stream in m_streams) { stream.Position = 0; }
}
我有两种不同的报告,一种是纵向模式,另一种是横向模式,但是我为 PageWidth 和 PageSize 更改什么值并不重要,它总是以纵向打印。我在 11.7 英寸和 8.3 英寸之间交换了宽度和高度,但它始终以纵向模式打印。