我正在尝试打印文本以在Windows Forms Host中垂直显示。标签正在使用WPF中的报表查看器进行打印。这是我的代码:
// boolean is based on true or false, when printing labels
private bool _isReportViewerLoaded;
// method to display data in .rdlc
private void ReportViewer_Load(object sender, EventArgs e)
{
// if equal false run this code isReportViewerLoaded
if (!_isReportViewerLoaded)
{
// get the lot based on the parameter Id
Lot lot = BottleLotRespository.GetLotById(this.Parameter);
// settings the page settings
PageSettings pg = new PageSettings();
pg.PrinterSettings
.DefaultPageSettings
.Margins = new Margins(0, 0, 0, 0);
pg.Landscape = false;
PaperSize size = new PaperSize("110.0 x 74.0", 433, 100);
BottleLotDataSet bottleLotDataSet = new BottleLotDataSet();
DataTable reportDataTable = bottleLotDataSet.LotDataTable;
DataRow lotRow = reportDataTable.NewRow();
lotRow["Id"] = lot.Id;
lotRow["Number"] = lot.Number.ToString();
reportDataTable.Rows
.Add(lotRow);
bottleLotDataSet.BeginInit();
this._reportViewer.SetPageSettings(pg);
this.reportDataSource.Name = "DataSet1";
this.reportDataSource.Value = reportDataTable;
this._reportViewer
.LocalReport
.DataSources
.Add(this.reportDataSource);
this._reportViewer
.LocalReport
.ReportEmbeddedResource = "BottleLotWPF.View.Report1.rdlc";
bottleLotDataSet.EndInit();
_reportViewer.RefreshReport();
_isReportViewerLoaded = true;
}
}
我的问题是Report1.rdlc不允许我旋转文本,并且没有设置。是否可以添加设置以旋转文本?