Thursday, March 8, 2012

changing report from VB

I'm trying to learn how to control a report from within a VB 2005 program.
My program has a windows form with a ReportViewer on it referencing a report
(.rdlc). The report has features in it which I would like to change per my
VB program. For example, I'd like to add a checkbox to the windows form that
would change the visibility of a column on the report (i.e. when checked, the
Visibility.Hidden property of the report column would be set to False, and
vica-versa). I assume this can be done, but I can't figure out how to obtain
a reference to the items on the report from within VB. Is this possible, and
if so, how do I do this?
--
EdHello Ed,
The only way you could do this is that you add a parameter in the local
report to control the visibility of the report item and then in the windows
application, you could set the parameter value and refresh the report to
get the result.
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.|||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.|||While I haven't tried it yet, I suppose you could load in the XML in the
.rdlc file, change the XML for the visibility of the column, and save it back
to the file, and then refresh the Report...the only problem might be that it
may produce an error message that the file is in use. This would not be an
elegant solution, particularly since if I wanted to modify the layout of the
report, I'd probably have to re-write the XML change code. I must say, it
would be very handy to be able to just click a button or checkbox to hide or
view certain parts of the reports.
Another thing I'm interested in is being able to easily show or hide group
detail on the report easily--similar to a TreeView control in Windows forms,
but with the '+' signs opening or closing levels of details. Is that
available in the Reporting Services?
--
Ed
"Wei Lu [MSFT]" wrote:
> Hello Ed,
> The only way you could do this is that you add a parameter in the local
> report to control the visibility of the report item and then in the windows
> application, you could set the parameter value and refresh the report to
> get the result.
> 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 ED,
You could do it.
It called drilldown report.
How to: Add a Visibility Toggle to an Item (Report Designer)
http://msdn2.microsoft.com/en-us/library/ms156456.aspx
Hope this helps.
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