Current filter:
                                You should refresh the page.

                                You are using an older version of the DevExpress Support Center.

                                  • I really need clear step by step instructions on how to do this.
                                    I have looked back through the posts I have made in the last few weeks but I am coding in circles.

                                    I wrote myself some long instructions in the comments at
                                    https://www.devexpress.com/Support/Center/Question/Details/T317718

                                    but they are failing me.

                                    I noted that I need to use the report designer to set the bindingsource.datasource property to the business object that I want to report on.

                                    I looked up a report that I had got working but the object is no longer visible in the  report designer ( when I click the menu in the top left corner of the designer )

                                    In the designer code I see that the correct binding is set  however I should not have to edit generated code to get my new report.

                                    [Update]
                                    Here is the structure of my business object

                                    [C#]
                                    public class SPResultString { public string Result { get; set; } }

                                    Here is my Reports dbContext

                                    [C#]
                                    public class ReportsDB : jtDbContext { public IList<SPResultString> CancelOrders() { return GetSpResults("aaCancelTestOrders"); // returns 1 record } // etc

                                    I have made the ReportDataV2_ListView accessible via a navigation item in my project and run the report from an action in a controller.
                                    Here is my Action method

                                    [C#]
                                    private void actRunReport_Execute(object sender, SimpleActionExecuteEventArgs e) { var report = (ReportDataV2)e.CurrentObject; if (report == null) { return; } using (var db = new ReportsDB()) { if (report.PredefinedReportType.Name.Contains("ClearTestOrders")) { var rep = new ClearTestOrders(); var xtraRep = (XtraReport)rep; xtraRep.DataSource = db.CancelOrders(); xtraRep.ShowPreviewDialog(); } } // etc.

                                    Here is me trying to figure out what options to put in.
                                    I cant work out how to add SPResultString as the bound field

                                    http://screencast.com/t/4saVVuks5

                                Show all comments
                                • Dennis (DevExpress) 01.22.2016

                                  Hello Kirsten,

                                  In the ticket you gave, we discussed at least two methods of accomplishing this task for Entity Framework Code First:
                                  1. Bind an XtraReport's DataSource directly to the result of the Database.SqlQuery<T> query.
                                  2. Use the SqlDataSource component as per How to use SqlDataSource with ReportsV2 and pass the application connection string into the data source?
                                  Here you will need to design a regular XtraReport as per XtraReports documentation.
                                  As far as XAF integration is concerned, in both cases you will need to handle the CustomSetupReportDataSource event as shown in the last link.

                                  Please clarify the following:

                                  1. Which method do you prefer to use to complete this task?
                                  2. Which difficulties are you experiencing with each method?
                                  3. What XAF integration features do you expect from a report bound to stored procedures (should it be shown in the standard report list along with other regular reports, should all standard XAF reporting functions be available for it or its preview just needs to be invoked from one place)?
                                  With that, we will be in a better position to assist you further.
                                • kirsten greed 01.22.2016
                                  1. I am using Method 1
                                  2. The report runs but shows no data
                                • kirsten greed 01.22.2016

                                  >>in both cases you will need to handle the CustomSetupReportDataSource event as shown in the last link
                                  I dont want to pass the connection string. I want to set the datasource to a list of objects.  I thought I managed this somehow before.

                                • kirsten greed 01.22.2016

                                  I see in a report that I did have working that the Designer.cs contains
                                  this.bindingSource1.DataSource = typeof(Module.BusinessObjects.SPResultStripg);  how would this have got into the report?

                                • kirsten greed 01.22.2016

                                  I have it working now , using the trick of editing the designer generated code.

                                • kirsten greed 01.22.2016

                                  But what steps are there to achieve this using the UI?

                                • kirsten greed 01.22.2016

                                  The UI now works the way I want, but how do I set it up to get there ?  http://screencast.com/t/P4KMCwopPeW

                                • Dennis (DevExpress) 01.22.2016

                                  Hello Kirsten,

                                  Most likely your report shows no data because your newly created ReportsDB does not return any data from the CancelOrders method. Would you please verify this while debugging in Visual Studio?

                                  In an XAF application it is best to instantiate an EFObjectSpace  and then call your stored procedures through its ObjectContext property. You can find more information on this method in MSDN, e.g.:
                                  https://social.msdn.microsoft.com/Forums/en-US/a7e15e64-5724-44ce-a047-d256424a1e7f/how-to-call-stored-procedure-from-entity-framework?forum=adodotnetentityframework

                                  >>I have it working now , using the trick of editing the designer generated code.
                                  >>The UI now works the way I want, but how do I set it up to get there ?  http://screencast.com/t/P4KMCwopPeW
                                  Please submit a separate ticket on the .NET | XtraReports product and attach your problematic sample project so we can research your exact situation and provide the best technical solution. Thanks in advance.

                                • kirsten greed 01.22.2016

                                  Thanks for your answer Dennis.  Once I realized that my question was really about how to report on a collection of objects I was able to work out the answer.  The fact that the data originally came out of a stored procedure got me side tracked.  It is a bit of work to create the correct data object for the stored procedure results.  The only shortcut I know is to use the Import Function feature inside the EF Model First (.EDMX ) approach.

                                1 Solution

                                Creation Date Importance Sort by

                                Step 1 )
                                From the Project Menu select Add New Datasource to start the Data Source Configuration Wizard
                                In the Data Source Configuration Wizard the first question is
                                "Where will the application get the data from?"
                                Select Object,
                                Click Next
                                Locate object you want to report on in my case Module.BusinessObjects.SPResultString
                                Click Finish

                                Step 2 )
                                Select Add New Item and use the Report Wizard
                                Select Empty Report
                                Click Finish

                                Step 3 )
                                Click the Report Tasks Icon in the top left of the report designer
                                Select DataSource
                                Then expand out the project objects and select the object you want to report on.
                                Then select  XtraReports from the Visual Studio Menu
                                Then select Field List to select fields for the report.

                                http://screencast.com/t/R70fItkP30yq

                                Step 4) The code in the question shows how the object collection can be passed into the report for it to use.

                                • kirsten greed 08.14.2017

                                  Note to self regarding pivotGrids

                                  If there is a PivotGrid in the report the following works to set the datasource of the pivotgrid

                                  [C#]
                                  xtraRep.DataSource = spResult.DataSource(paramObjects); var xrGrid = GetGridControl(xtraRep); if (xrGrid != null) { xrGrid.DataSource = xtraRep.DataSource;} private XRPivotGrid GetGridControl(XtraReport xtraRep ) { const string controlName = "xrPivotGrid1"; var controls = xtraRep.Controls; foreach (XRControl ctrl in controls) { var pivotControl = ctrl.FindControl(controlName, true); if (pivotControl == null) continue; return pivotControl as XRPivotGrid; } return null; }