Suppose the dataset comes back looking like (the counts are
arbitrarilly chosen)
PO #___Dept___PO Total___PO Line__Colour___ Item Count
1 Dept1 $100 1 Red 5
1 Dept1 $100 2 Green 10
1 Dept1 $100 3 Blue 15
2 Dept2 $110 1 Red 1
2 Dept2 $110 2 Green 2
2 Dept2 $110 3 Blue 3
3 Dept1 $200 1 Red 50
4 Dept2 $150 1 Green 65
How would I get a report that gives group footers line
Red 55
Green 10
Blue 15
Dept1 $300
Red 1
Green 67
Blue 3
Dept2 $260
I did not use PO Line $ bcause in my real world the field corresponding
to the PO Total is not an argregate of the lines but rather another
attribute of the higher level file altogether.You need to get a subtotal on your groups. Edit Group and then subtotal on
"rows"..
"BruceJ" wrote:
> Suppose the dataset comes back looking like (the counts are
> arbitrarilly chosen)
> PO #___Dept___PO Total___PO Line__Colour___ Item Count
> 1 Dept1 $100 1 Red 5
> 1 Dept1 $100 2 Green 10
> 1 Dept1 $100 3 Blue 15
> 2 Dept2 $110 1 Red 1
> 2 Dept2 $110 2 Green 2
> 2 Dept2 $110 3 Blue 3
> 3 Dept1 $200 1 Red 50
> 4 Dept2 $150 1 Green 65
> How would I get a report that gives group footers line
> Red 55
> Green 10
> Blue 15
> Dept1 $300
> Red 1
> Green 67
> Blue 3
> Dept2 $260
> I did not use PO Line $ bcause in my real world the field corresponding
> to the PO Total is not an argregate of the lines but rather another
> attribute of the higher level file altogether.
>|||Thanks Asim. That gets me the subtotals by colour quite readily.
How would I then get the subtotals by Department 1 $300 and 2 $260
instead of $500 (3 x $100 + $200) and $480 (3 x $110 + $150) for 1 and
2, respectively if I use regular sum approaches.
The closest that I've come is to define two functions in my customer
code. The first maintains a string array and will return 1 if it is
able to insert a new concatenation of PO # + Line # 1 in to that array
and zero otherwise. The second will maintain and return a running
total of the PO Line Amounts by receiving the current line amount
multiplied by success or failure of the insertion attempt. To enquire
as to the current value of the running total I simply pass it a zero
which is added to the current value and then the new current value =old current value + zero is returned.
http://www.toomuchcode.net/2005/11/sql_server_2000.html gives more
details on the procedure.
Unfortunately I've run in to a problem with the order that reporting
services actually builds the footers prior to rendering them. It
appears that the lower numbered, higher level or outer footer levels
are processed before the deeper ones. So, in my example above my
running value at the Department 1 footer would be zero and then the
detail lines would shown it as $100 and then $300 and the $300 value
would be placed on the Department 2 footer.|||Asim, a colleague and I have have just confirmed that, for the
following report structure
Group1 Header
Group2 Header
Group3 Header
Detail Line1
Detail Line2
...
Detail Line n
Group3 Footer
Group2 Footer
Group1 Footer
(with "=Code.TrackLine(1)" placed in a cell once per Header, Footer or
Detail), the order of execution of TrackLine will be
=1 Group1 Header
=2 Group1 Footer
=3 Group2 Header
=4 Group2 Footer
=5 Group3 Header
=6 Group3 Footer
=7 Detail Line1
=8 Detail Line2
...
=(n+6) Detail Line n
Which concurs with my experience that I was shows a value of zero in my
Group 3 Footer before my detail lines got 'round to adding anything to
my running total.
The Custom Code looks like
...
Function TrackLine(ByVal c_line as integer) as integer
Static Dim n_line as integer
n_line = n_line + c_line
return n_line
End Function
...
I find this rather puzzling since aggregate functions work on the
footer levels. Either Bill's wandering through the data twice or
there's a deeper mystery.
Regardless, does anyone know of a way to force a morenatural order of
execution that corresponds with the way the report would appear once it
has been rendered? e.g. top-to-bottom, left-to-right.
Showing posts with label item. Show all posts
Showing posts with label item. Show all posts
Friday, February 24, 2012
Can I total "distinct" subtotals?
Labels:
___dept___po,
arbitrarilly,
back,
chosen,
counts,
database,
dataset,
dept1,
distinct,
item,
line__colour___,
microsoft,
mysql,
oracle,
server,
sql,
subtotals,
suppose,
total,
total___po
Sunday, February 12, 2012
Can I obtain a reference to a report item?
SSRS 2005
This question is loosely related to the one I posed in "Can report content
be generated dynamically?"
I would like to make sure that the text boxes in the report footer are
always formatted the same way...same font face, font size, same size,
position, etc. But I also want to allow for the fact that these standard
settings may change over time.
I know I could create a custom code assembly and use expressions to set the
attributes of the text boxes. For example, for each textbox I could set the
FontSize property like this:
=Code.OakRptLib.FooterFontSize()
This approach works but it is a little clumsey.
I would prefer to be able to pass a reference to the textbox to a function
in my custom code assembly so that I could set all of the standard settings
using one function call.
For example I would set the text by setting the Value property like this:
=Code.OakRptLib.BuildPageFooterLeft(ref)
Where "ref" would be a reference to the textbox and would be used by
BuildPageFooterLeft() to set all of the other textbox settings (font, textbox
size, position, etc.).
Is there a way to do this? I cannot find a way to pass a reference to a
textbox object to my custom code assembly.
Thanks!
--
Chris, SSSIWhy not write a utility that just updates all your reports and changes the
footers to be whatever standard you define? You could use a web service to
get the reports in the reports collection, then you can export the rdl file
as an XML file (since it IS XML), next have a XML DOM object point to that,
query down to the PageFooter->ReportItems collection. Now loop for all
TextBox items, and you can respecify how you want the standard look and feel
to be for all the textbox attributes.
To see how this is laid out, I highly reccommend XML Notepad 2006 from
Microsoft. You can download it from their web site. Do a search for it. They
just put it out to download awhile back. It has been missing for quite a
number of years as they have made great improvements to it.
=-Chris
"Chris G." <ChrisG@.nospam.nospam> wrote in message
news:4DCEE1FA-0D17-4C0C-BCD5-DD393305F4D1@.microsoft.com...
> SSRS 2005
> This question is loosely related to the one I posed in "Can report content
> be generated dynamically?"
> I would like to make sure that the text boxes in the report footer are
> always formatted the same way...same font face, font size, same size,
> position, etc. But I also want to allow for the fact that these standard
> settings may change over time.
> I know I could create a custom code assembly and use expressions to set
> the
> attributes of the text boxes. For example, for each textbox I could set
> the
> FontSize property like this:
> =Code.OakRptLib.FooterFontSize()
> This approach works but it is a little clumsey.
> I would prefer to be able to pass a reference to the textbox to a function
> in my custom code assembly so that I could set all of the standard
> settings
> using one function call.
> For example I would set the text by setting the Value property like this:
> =Code.OakRptLib.BuildPageFooterLeft(ref)
> Where "ref" would be a reference to the textbox and would be used by
> BuildPageFooterLeft() to set all of the other textbox settings (font,
> textbox
> size, position, etc.).
> Is there a way to do this? I cannot find a way to pass a reference to a
> textbox object to my custom code assembly.
> Thanks!
> --
> Chris, SSSI|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Chris,
>>Why not write a utility that just updates all your reports and changes the
>>footers to be whatever standard you define?
I have thought of doing that as well. The reasons I have not taken that
approach are:
1. More effort at this point than is warranted by the constraints of the
project
2. It is a design time solution and not a run time solution. We will have a
single suite of reports that support multiple clients, and a run time
solution permits more flexibility for each client. Yes we could have copies
of reports for each client and tools to deploy them when updates are made,
but again that is beyond the scope of this project at this time.
Thanks a lot for your ideas and any further advice would be greatly
appreciated!
--
Chris, SSSI
"Chris Conner" wrote:
> Why not write a utility that just updates all your reports and changes the
> footers to be whatever standard you define? You could use a web service to
> get the reports in the reports collection, then you can export the rdl file
> as an XML file (since it IS XML), next have a XML DOM object point to that,
> query down to the PageFooter->ReportItems collection. Now loop for all
> TextBox items, and you can respecify how you want the standard look and feel
> to be for all the textbox attributes.
> To see how this is laid out, I highly reccommend XML Notepad 2006 from
> Microsoft. You can download it from their web site. Do a search for it. They
> just put it out to download awhile back. It has been missing for quite a
> number of years as they have made great improvements to it.
> =-Chris
>
> "Chris G." <ChrisG@.nospam.nospam> wrote in message
> news:4DCEE1FA-0D17-4C0C-BCD5-DD393305F4D1@.microsoft.com...
> > SSRS 2005
> >
> > This question is loosely related to the one I posed in "Can report content
> > be generated dynamically?"
> >
> > I would like to make sure that the text boxes in the report footer are
> > always formatted the same way...same font face, font size, same size,
> > position, etc. But I also want to allow for the fact that these standard
> > settings may change over time.
> >
> > I know I could create a custom code assembly and use expressions to set
> > the
> > attributes of the text boxes. For example, for each textbox I could set
> > the
> > FontSize property like this:
> >
> > =Code.OakRptLib.FooterFontSize()
> >
> > This approach works but it is a little clumsey.
> >
> > I would prefer to be able to pass a reference to the textbox to a function
> > in my custom code assembly so that I could set all of the standard
> > settings
> > using one function call.
> >
> > For example I would set the text by setting the Value property like this:
> > =Code.OakRptLib.BuildPageFooterLeft(ref)
> >
> > Where "ref" would be a reference to the textbox and would be used by
> > BuildPageFooterLeft() to set all of the other textbox settings (font,
> > textbox
> > size, position, etc.).
> >
> > Is there a way to do this? I cannot find a way to pass a reference to a
> > textbox object to my custom code assembly.
> >
> > Thanks!
> >
> > --
> > Chris, SSSI
>
>|||Hi Wei,
Chris Connor's reply was interesting and appreciated, but it did not really
answer my questions...it proposed an alternative approach. Could you please
reread my original post and in particular answer these questions?:
"I would prefer to be able to pass a reference to the textbox to a function
in my custom code assembly so that I could set all of the standard settings
using one function call.
...
Is there a way to do this? I cannot find a way to pass a reference to a
textbox object to my custom code assembly."
Thanks!
-- Chris
--
Chris, SSSI
"Wei Lu [MSFT]" wrote:
> Hi ,
> How is everything going? Please feel free to let me know if you need any
> assistance.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hello Chris,
I have read your original post. And my understanding is that you may try to
deploy a report and the report user could modify the textbox layout via
some parameter. If I am offset, please let me know.
Based on my research, you may not get the reference to change the Height
and Width of a ReportItem. They are readonly.
You may try to use the Reporting Services Web Services to render a
Reporting from the XML DOM object and you could made the XML modification
in your program.
This seems to be the only way you could do.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights
This question is loosely related to the one I posed in "Can report content
be generated dynamically?"
I would like to make sure that the text boxes in the report footer are
always formatted the same way...same font face, font size, same size,
position, etc. But I also want to allow for the fact that these standard
settings may change over time.
I know I could create a custom code assembly and use expressions to set the
attributes of the text boxes. For example, for each textbox I could set the
FontSize property like this:
=Code.OakRptLib.FooterFontSize()
This approach works but it is a little clumsey.
I would prefer to be able to pass a reference to the textbox to a function
in my custom code assembly so that I could set all of the standard settings
using one function call.
For example I would set the text by setting the Value property like this:
=Code.OakRptLib.BuildPageFooterLeft(ref)
Where "ref" would be a reference to the textbox and would be used by
BuildPageFooterLeft() to set all of the other textbox settings (font, textbox
size, position, etc.).
Is there a way to do this? I cannot find a way to pass a reference to a
textbox object to my custom code assembly.
Thanks!
--
Chris, SSSIWhy not write a utility that just updates all your reports and changes the
footers to be whatever standard you define? You could use a web service to
get the reports in the reports collection, then you can export the rdl file
as an XML file (since it IS XML), next have a XML DOM object point to that,
query down to the PageFooter->ReportItems collection. Now loop for all
TextBox items, and you can respecify how you want the standard look and feel
to be for all the textbox attributes.
To see how this is laid out, I highly reccommend XML Notepad 2006 from
Microsoft. You can download it from their web site. Do a search for it. They
just put it out to download awhile back. It has been missing for quite a
number of years as they have made great improvements to it.
=-Chris
"Chris G." <ChrisG@.nospam.nospam> wrote in message
news:4DCEE1FA-0D17-4C0C-BCD5-DD393305F4D1@.microsoft.com...
> SSRS 2005
> This question is loosely related to the one I posed in "Can report content
> be generated dynamically?"
> I would like to make sure that the text boxes in the report footer are
> always formatted the same way...same font face, font size, same size,
> position, etc. But I also want to allow for the fact that these standard
> settings may change over time.
> I know I could create a custom code assembly and use expressions to set
> the
> attributes of the text boxes. For example, for each textbox I could set
> the
> FontSize property like this:
> =Code.OakRptLib.FooterFontSize()
> This approach works but it is a little clumsey.
> I would prefer to be able to pass a reference to the textbox to a function
> in my custom code assembly so that I could set all of the standard
> settings
> using one function call.
> For example I would set the text by setting the Value property like this:
> =Code.OakRptLib.BuildPageFooterLeft(ref)
> Where "ref" would be a reference to the textbox and would be used by
> BuildPageFooterLeft() to set all of the other textbox settings (font,
> textbox
> size, position, etc.).
> Is there a way to do this? I cannot find a way to pass a reference to a
> textbox object to my custom code assembly.
> Thanks!
> --
> Chris, SSSI|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Chris,
>>Why not write a utility that just updates all your reports and changes the
>>footers to be whatever standard you define?
I have thought of doing that as well. The reasons I have not taken that
approach are:
1. More effort at this point than is warranted by the constraints of the
project
2. It is a design time solution and not a run time solution. We will have a
single suite of reports that support multiple clients, and a run time
solution permits more flexibility for each client. Yes we could have copies
of reports for each client and tools to deploy them when updates are made,
but again that is beyond the scope of this project at this time.
Thanks a lot for your ideas and any further advice would be greatly
appreciated!
--
Chris, SSSI
"Chris Conner" wrote:
> Why not write a utility that just updates all your reports and changes the
> footers to be whatever standard you define? You could use a web service to
> get the reports in the reports collection, then you can export the rdl file
> as an XML file (since it IS XML), next have a XML DOM object point to that,
> query down to the PageFooter->ReportItems collection. Now loop for all
> TextBox items, and you can respecify how you want the standard look and feel
> to be for all the textbox attributes.
> To see how this is laid out, I highly reccommend XML Notepad 2006 from
> Microsoft. You can download it from their web site. Do a search for it. They
> just put it out to download awhile back. It has been missing for quite a
> number of years as they have made great improvements to it.
> =-Chris
>
> "Chris G." <ChrisG@.nospam.nospam> wrote in message
> news:4DCEE1FA-0D17-4C0C-BCD5-DD393305F4D1@.microsoft.com...
> > SSRS 2005
> >
> > This question is loosely related to the one I posed in "Can report content
> > be generated dynamically?"
> >
> > I would like to make sure that the text boxes in the report footer are
> > always formatted the same way...same font face, font size, same size,
> > position, etc. But I also want to allow for the fact that these standard
> > settings may change over time.
> >
> > I know I could create a custom code assembly and use expressions to set
> > the
> > attributes of the text boxes. For example, for each textbox I could set
> > the
> > FontSize property like this:
> >
> > =Code.OakRptLib.FooterFontSize()
> >
> > This approach works but it is a little clumsey.
> >
> > I would prefer to be able to pass a reference to the textbox to a function
> > in my custom code assembly so that I could set all of the standard
> > settings
> > using one function call.
> >
> > For example I would set the text by setting the Value property like this:
> > =Code.OakRptLib.BuildPageFooterLeft(ref)
> >
> > Where "ref" would be a reference to the textbox and would be used by
> > BuildPageFooterLeft() to set all of the other textbox settings (font,
> > textbox
> > size, position, etc.).
> >
> > Is there a way to do this? I cannot find a way to pass a reference to a
> > textbox object to my custom code assembly.
> >
> > Thanks!
> >
> > --
> > Chris, SSSI
>
>|||Hi Wei,
Chris Connor's reply was interesting and appreciated, but it did not really
answer my questions...it proposed an alternative approach. Could you please
reread my original post and in particular answer these questions?:
"I would prefer to be able to pass a reference to the textbox to a function
in my custom code assembly so that I could set all of the standard settings
using one function call.
...
Is there a way to do this? I cannot find a way to pass a reference to a
textbox object to my custom code assembly."
Thanks!
-- Chris
--
Chris, SSSI
"Wei Lu [MSFT]" wrote:
> Hi ,
> How is everything going? Please feel free to let me know if you need any
> assistance.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hello Chris,
I have read your original post. And my understanding is that you may try to
deploy a report and the report user could modify the textbox layout via
some parameter. If I am offset, please let me know.
Based on my research, you may not get the reference to change the Height
and Width of a ReportItem. They are readonly.
You may try to use the Reporting Services Web Services to render a
Reporting from the XML DOM object and you could made the XML modification
in your program.
This seems to be the only way you could do.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights
Subscribe to:
Posts (Atom)