Master Detail report using Crystal Report in Visual C# 2010
-
Hi to All, This is with reference to my earlier post Here. Short Description about project: Tools uses: Ms.Visual Studio 2010 ultimate edition, Sql Server & Crystal report. In earlier post, I was succeed to create N-tier application. Two classes Orders & OrderDetails were used to create new orders and add to database. Data Access Layer was used to establish Database connection and provide Sql base operations. Now I am willing to add reporting feature to my project, for a simple Report I can use following steps: 1-Add Typed DataSet in Visual Studio. 2-Based on that DataSet, create Crystal Report using wizard. 3-Using DAL class, to fetch data, create Report object and and set RecordSource property to Report object. This report was run successfully.. What I couldn't figure out is how I build Master/Detail report using same approach. How can I pass a DataSet which contains 2 DataTable Orders and OrderDetails to Report Object to display complete Order from Northwind Databse.
-
Hi to All, This is with reference to my earlier post Here. Short Description about project: Tools uses: Ms.Visual Studio 2010 ultimate edition, Sql Server & Crystal report. In earlier post, I was succeed to create N-tier application. Two classes Orders & OrderDetails were used to create new orders and add to database. Data Access Layer was used to establish Database connection and provide Sql base operations. Now I am willing to add reporting feature to my project, for a simple Report I can use following steps: 1-Add Typed DataSet in Visual Studio. 2-Based on that DataSet, create Crystal Report using wizard. 3-Using DAL class, to fetch data, create Report object and and set RecordSource property to Report object. This report was run successfully.. What I couldn't figure out is how I build Master/Detail report using same approach. How can I pass a DataSet which contains 2 DataTable Orders and OrderDetails to Report Object to display complete Order from Northwind Databse.
Two ways Using
Groups
Creating Crystal Report with Multiple Tables in ASP.NET[^] OR UsingSubreports
C# Crystal Reports - sub reports[^] C# Crystal Reports - on demand sub reports[^]thatraja
Code converters | Education Needed No thanks, I am all stocked up. - Luc Pattyn When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
-
Two ways Using
Groups
Creating Crystal Report with Multiple Tables in ASP.NET[^] OR UsingSubreports
C# Crystal Reports - sub reports[^] C# Crystal Reports - on demand sub reports[^]thatraja
Code converters | Education Needed No thanks, I am all stocked up. - Luc Pattyn When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
Thanks for the links...Let me try to clear the problem a little more: InvReport is the main report which contain a subreport. Which is based on DataSet1.xsd contains 2 Tables rptOrders and rptOrderdetails DataSet ds = Ord.GetOrdersByID(int.Parse(this.txtOrdID.text.ToString())); Above line call the GetOrdersByID method of Orders class which return Dataset consist of 2 tables Orders and OrderDetails. Then on a Print Button click event of Invoice form create an instance of InvReport invR, and set SetDataSource of invR to ds.Tables[0]. Lastly I called CrystalReportViewer.Report source to invR. The problem is how can I "tell" SubReport to use ds.Tables[1] as SetDataSource. So that it can pick OrderDetails relevant to Orders data. I hope I didn't make my problem more confusing... Thanks Ahmed
-
Thanks for the links...Let me try to clear the problem a little more: InvReport is the main report which contain a subreport. Which is based on DataSet1.xsd contains 2 Tables rptOrders and rptOrderdetails DataSet ds = Ord.GetOrdersByID(int.Parse(this.txtOrdID.text.ToString())); Above line call the GetOrdersByID method of Orders class which return Dataset consist of 2 tables Orders and OrderDetails. Then on a Print Button click event of Invoice form create an instance of InvReport invR, and set SetDataSource of invR to ds.Tables[0]. Lastly I called CrystalReportViewer.Report source to invR. The problem is how can I "tell" SubReport to use ds.Tables[1] as SetDataSource. So that it can pick OrderDetails relevant to Orders data. I hope I didn't make my problem more confusing... Thanks Ahmed
You could assign particular datasource for subreport. Check these Crystal Reports SubReport in Asp.Net[^] How to Create a Crystal Report Sub Report in C#.NET[^]
thatraja
Code converters | Education Needed No thanks, I am all stocked up. - Luc Pattyn When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
-
You could assign particular datasource for subreport. Check these Crystal Reports SubReport in Asp.Net[^] How to Create a Crystal Report Sub Report in C#.NET[^]
thatraja
Code converters | Education Needed No thanks, I am all stocked up. - Luc Pattyn When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute