Search code examples
c#asp.net-mvcstored-proceduresdevexpressxtrareport

DevExpress report Main and Detail reports stored procedures


I have to create an XtraReport with two sections; master and detail. For example, categories - is master and their products is detail:

Category1

  • Prod1
  • Prod2
  • Prod3

Category2

  • Prod4
  • Prod5
  • Prod6

The problem is that both categories and relevant products come from Stored Procedures. So I have 2 stored procedures, the first master stored procedure is without parameters, the second detail store procedure has the parameter of CategoryId (that comes from first Stored Procedure).

I can't find a way to set the CategoryId parameter value of the second stored procedure from the first stored procedure.

In the stored procedure designer I can see this, but I can't set the parameter value to first store procedure ID.

enter image description here


Solution

  • The solution is using xsSubreport component, create separate sub-report and attach to it.

    You can pass parameters to it from outer(main) report, and it will fetch data in it based on outer parameters

    https://www.youtube.com/watch?v=ZKRsXxjr_EI

    enter image description here