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

No comments:

Post a Comment