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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 |