我在項目中使用了devexpress xtrareports v.15 for winforms。如何從文件加載devexpress xtrareport並連接數據
我有發票報告。它裏面有一些文本字段和一個列表。我的數據連接到源在報告中構造函數:
public InvoiceReport(InvoiceCommonData icd, List<ReportPosition> positions)
{
InitializeComponent();
this.ReportCommonDataSource.DataSource = icd;
this.positionsList.DataSource = positions;
}
當我打印報告,因爲它是在Visual Studio中創建的數據連接正道。 但我需要爲此報告加載不同的佈局。我存儲報告佈局repx文件,並嘗試從文件在運行時加載它:
InvoiceReport report = new InvoiceReport(model.GetCommonData(), model.GetPositions());
var filename = "D://InvoiceReport.repx";
report.LoadLayout(filename);
當我打印的報告中,我看到,常見的數據(icd
)結合,並打印,但名單(positions
)沒有約束,它是空表而不是實際數據。 問題是如何從文件加載xtrareport佈局並保存所有數據連接?
Lalit Sharma謝謝你的回答。我的問題是,當我從文件加載佈局報告不顯示列表。當我不加載佈局時,它應該像它應該那樣工作。 –