开发者

Subreport parameters and grouping with Reporting Services

First, I'll lay out the structure:

The main report is a table variable from sql server giving form type, form number, previous date (hidden), current date (hidden, though the parent grouping is using this), the difference in times, person's id (hidden), and person's full name. The main report is only for unexpected results and isn't all of the data for a given day.

The subre开发者_如何学Pythonpoort is totals counts of the various form types based on either the entire project (on a given day) excluding the person's id if there isn't a specific person selected or filtered by day and person's id if someone is. The subreport should be the Totals row for a given day (the intended parent group) as the main report is anomalies, the totals are for all forms done.

I've run into a few problems:

1) The date grouping thing is seperating based on date and time. Is there a way to drop the time component of a field for the sake of the grouping? I'm looking at http://thavash.wordpress.com/category/reporting-services/page/3/ right now and the FormatDateTime thing may be useful if it is more than just a visual change (ie I won't have a bunch of 9/25/11 groups).

2) The subreport takes in two parameters of person and date to generate the list. I'm wondering if there is a hybrid way of passing parameters to the subreport as the date parameter is based off the parent groups (so not sure that it can be programmatically set). The person value may be able to be achieved by taking the key of the drop down list on the form. The only problem is I'm not sure how I can tell it programmatically to take the personid, but pull the date component only of the parent group.


1) Use something like =Format(Fields!MyDateField.Value,"dd/MM/yyyy") to format the date to string. Change the formatting expression to your needs.

To properly sort the group use =Format(Fields!MyDateField.Value,"yyyyMMdd")

2) You can pass any expression as a parameter to the subreport meaning that they can be group values, main report parameters etc.

For example: if your date parameter is on group named "table1_Group1", and you want to use it to a subreport, you can use an expression referencing to the group like =First(Fields!MyDateField.Value,"table1_Group1")

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜