Reputation: 940
I am creating reporting server using asp.net mvc web api. I am retrieving data from web api retriving report using XRDesignForm object of devexpress. I am posting back report data to web api. what issue i am facing is, and if i use xtrareport obejct and bind datasource manually it work fine.i.e.
XtraReport report = new XtraReport();
report.DataSource = setupSummary.FillDataSet();
report.DataMember = ((DataSet)report.DataSource).Tables[0].TableName;
designForm.OpenReport(report);
//designForm.Show();
designForm.ShowDialog(this);
I can successfully mainuplate this report and can save into database,
But as shown in articles for ReportStorage, if i only retrieve report from database using report name from server, datasource is always null.i.e.
XRDesignForm designForm = new XRDesignForm();
string url = GetSelectedUrl();
if (!string.IsNullOrEmpty(url))
designForm.OpenReport(url);
designForm.ShowDialog(this);
It seems that when saving dynamic report into database (as binary), It loss data source bindings. please help me for this. thanks
Upvotes: 0
Views: 3773
Reputation: 36
Aqdas, thank you very much.
There is a similar error in the report layout,
My solution is, after the layout again set DataSource
XtraReport rep = null;
rep = new rptReqVac();
Stream layoutStream = null;
layoutStream = mGetLoyoutStream(id);
rep.LoadLayout(layoutStream);
rep.DataSource = new dsREQPrintVac();
reportDesigner.OpenReport(rep);
Hope it will help someone :-)
Upvotes: 2
Reputation: 940
Finally after spending lot of time, i had fixed this, Issue is actually when you save report to database as binary, it skip DataAdapter for report. so before saving you need to do first null to dataadapter or report and then assaing again before you get buffer for report layout.
Hope it will help someone :-)
Upvotes: 0