Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member200290
Contributor
0 Kudos

 from ReportObject crRptObj in rptDoc.ReportDefinition.ReportObjects

 

This declares the variable crRptObj as type ReportObject, then it says to search or iterate through the collection rptDoc.ReportDefinition.ReportObjects assigning it to the crRptObj variable.

 

where crRptObj.Kind == ReportObjectKind.SubreportObject

 

This is the comparison statement, it allows you to select the conditions to look for.

Like an SQL query you can set multiple conditions through the use of AND, OR, NOT statements.

 

 select (SubreportObject)crRptObj;

 

If the WHERE statement condition is met, then this line adds a variable to the result set. This could be the current item in the collection, or a completely different object. In this case we are type-casting the current object into a SubreportObject and returning that. 

The result has to match  the type that we defined QueryResults in the first item.

 

 I hope this was useful or at least a little interesting and that you will try to incorporate LINQ into your code!

Here are some websites on LINQ:

http://msdn.microsoft.com/en-us/netframework/aa904594.aspx
http://en.wikipedia.org/wiki/Language_Integrated_Query

And the LINQ to my Crystal Add-In sample, though it has not been updated yet with the LINQ code:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/208428c9-eebd-2b10-0c83-8c7579e8...