2013-12-10 29 views
4

iam使用DevExpress v.10.2並希望在XtraReport上用角度顯示XRLabel。如果使用設計器,它工作正常。但是現在我想在運行時執行此操作,因爲Label.Text是動態的。我的問題是報告不顯示我的標籤。我閱讀了一些DevExpress支持文章,其中描述了它只是處理PDF格式。但在我的情況下,我只是看到一條小灰線。 我嘗試以下只是填充我XRLabel第一個:XRLabel.Angle在運行時間

XRLabel druckinfo = new XRLabel(); 
druckinfo.Text = string.Format("SB{0} {1} EMAIL {2}", _Sachbearbeiter.Sbnr, _Kennung, 
       _Sachbearbeiter.Email1); //The values are filled and working. 
       druckinfo.Visible = true; 
       druckinfo.AutoWidth = false; 
       druckinfo.Angle = 90; 
       druckinfo.Font = new Font("Arial", 6f); 
       band.Controls.Add(druckinfo); //This is the DetailBand where i add other Labels too and its working fine. 
       druckinfo.HeightF = 500f; //Setting Height very high, because the text turns and i thought this is working. But seems to have no effect :(
       druckinfo.LocationF = new PointF(400f, 400f); 
       druckinfo.Borders = DevExpress.XtraPrinting.BorderSide.All; 

如果我刪除以下行:

druckinfo.Angle = 90; 

標籤變爲顯示細膩,但沒有角是肯定的。

這裏一個屏幕快照,顯示了對PDF頂部設置標籤:

enter image description here 這是我報告的設置:

_Report.PaperKind = PaperKind.A4; 
_Report.ReportUnit = ReportUnit.HundredthsOfAnInch; 
_Report.ShowPrintMarginsWarning = false; 
_Report.Margins = new Margins(0, 0, 0, 0); 

所有其他屬性都在默認值。它存在的頻段是以下幾點:

PageHeaderBand DetailBand PageFooterBand

問候

+0

乍一看,你的代碼看起來是正確的。你能分享整個報告定義(樂隊等)嗎?可能這個問題涉及到一些特定的配置。 – Mikhail

+0

@Mikhail我編輯了我的帖子:) – Sebi

+0

我現在複製了設計者的代碼,並讓它一步接近我的願望。它的工作原理:) – Sebi

回答

3

這似乎是工作:)我不知道爲什麼這個工程,我的最高職位不。但我複製了由設計師生成的代碼,現在它可以工作。

XRLabel druckinfo = new XRLabel(); 
druckinfo.Angle = 90F; 
druckinfo.Padding = new PaddingInfo(2, 2, 0, 0, 96F); 
druckinfo.SizeF = new SizeF(29.16666F, 500F); 
druckinfo.Font = new Font("Arial",8f); 
druckinfo.Text = text; 
_Band.Controls.Add(druckinfo); 
druckinfo.LocationF = new PointF(0F, 500F);