Question

I'm starting using DevExpress XtraReports for the company project. My problem is the following:

I have a stored procedure that extracts the data, given three paramaters: startDay, endDay and developer ID, and this SP is inside a .dbml file.

Following this example http://www.devexpress.com/Support/Center/p/B223095.aspx, we have the this method:

static void report_DataSourceDemanded(object sender, System.EventArgs e) {

       Reports.WeeklyTimesheet report = (Reports.WeeklyTimesheet)sender;
       DataClasses1DataContext context = new DataClasses1DataContext();
       System.Data.Linq.ISingleResult<WeeklyTimesheetUserReportResult> res = >context.WeeklyTimesheetUserReport(Convert.ToDateTime("2012/01/16"), >Convert.ToDateTime("2012/01/20"), 52);
       var result = from orderDetail in res select orderDetail;
       report.DataSource = res.ToList();

}

Which is the only way i've found (that works) to pass parameters to the SP for the report.

What can i do so the report comes with the data i am sucessfully bringing but is not binding into the report? The attached images will illustrate this point better.

I have to point that when i made that report in the images, were originally formatted from a dataset using the wizard (hence why is ordered), but i have no idea how i can format it instead using the .dbml file.

Thanks in advance.

http://imgur.com/YQ7RE

Was it helpful?

Solution

XtraReport have xrTables, xrLabel controls, they will let you to create custom report and after that you can bind those cell etc and modify the XRControl bindings of the report in the following manner:

[C#] ...

  // Original 
  //this.xrTableCell14.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
  // new DevExpress.XtraReports.UI.XRBinding("Text", null, "Symbols.Description")});
  // Modified
  this.xrTableCell14.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
    new DevExpress.XtraReports.UI.XRBinding("Text", null, "Description")});

...

Refer these links and samples..

Binding a Report to an Entity Framework object at runtime [ How to use LINQ to SQL data source to create a Master-Detail report example

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top