Monday, March 26, 2012

Opening a Report from a VB Application

Hi All,
I have a VB Application that lists all the reports on my report server in a
treeview control. Now all i need to do is open a report when it is clicked
on in my app.. What is the VB code to do this?
Thanks
SanjeevUse a browser control on your VB form. You can add this from the file
c:\windows\system32\shdocvw.dll. Read the report path from the treeview
control when a user selects an item to view, then use URL access to display
the report in the browser control as follows:
AxWebBrowser1.Navigate("http://MyReportServer/ReportServer?" & reportPath)
AxWebBrowser1 is the default name of the browser control when you place it
on the form.
There are lots of examples in Books Online. Look up the topic "Using URL
Acces from a Windows application".
HTH
Charles Kangai, MCT, MCDBA
"Sanjeev" wrote:
> Hi All,
> I have a VB Application that lists all the reports on my report server in a
> treeview control. Now all i need to do is open a report when it is clicked
> on in my app.. What is the VB code to do this?
> Thanks
> Sanjeev
>
>|||I am not entirely sure on how to add the browser control.
What i did was add shdocvw.dll as a reference to my to my windows
application.
Then I added "Imports SHDocVw" to the code.
But the Browser Control didnt appear in my ToolBox.
I suppose that this was the wrong way to go about it.
Sorry to trouble you again but what is the riht way to go about this.
Thanks in advance
Sanjeev
"Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
news:C42CA3EB-A91F-4F5A-A0A6-1BE59DE35999@.microsoft.com...
> Use a browser control on your VB form. You can add this from the file
> c:\windows\system32\shdocvw.dll. Read the report path from the treeview
> control when a user selects an item to view, then use URL access to
> display
> the report in the browser control as follows:
> AxWebBrowser1.Navigate("http://MyReportServer/ReportServer?" & reportPath)
> AxWebBrowser1 is the default name of the browser control when you place it
> on the form.
> There are lots of examples in Books Online. Look up the topic "Using URL
> Acces from a Windows application".
> HTH
> Charles Kangai, MCT, MCDBA
> "Sanjeev" wrote:
>> Hi All,
>> I have a VB Application that lists all the reports on my report server in
>> a
>> treeview control. Now all i need to do is open a report when it is
>> clicked
>> on in my app.. What is the VB code to do this?
>> Thanks
>> Sanjeev
>>|||In Visual Studio go to Tools, Add/Remove Toolbox Items.. Click on COM
Components tab, then find Microsoft Web Browser. Check the checkbox then OK.
HTH
Charles Kangai, MCT, MCDBA
"Sanjeev" wrote:
> I am not entirely sure on how to add the browser control.
> What i did was add shdocvw.dll as a reference to my to my windows
> application.
> Then I added "Imports SHDocVw" to the code.
> But the Browser Control didnt appear in my ToolBox.
> I suppose that this was the wrong way to go about it.
> Sorry to trouble you again but what is the riht way to go about this.
> Thanks in advance
> Sanjeev
>
>
> "Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
> news:C42CA3EB-A91F-4F5A-A0A6-1BE59DE35999@.microsoft.com...
> > Use a browser control on your VB form. You can add this from the file
> > c:\windows\system32\shdocvw.dll. Read the report path from the treeview
> > control when a user selects an item to view, then use URL access to
> > display
> > the report in the browser control as follows:
> >
> > AxWebBrowser1.Navigate("http://MyReportServer/ReportServer?" & reportPath)
> >
> > AxWebBrowser1 is the default name of the browser control when you place it
> > on the form.
> >
> > There are lots of examples in Books Online. Look up the topic "Using URL
> > Acces from a Windows application".
> >
> > HTH
> >
> > Charles Kangai, MCT, MCDBA
> >
> > "Sanjeev" wrote:
> >
> >> Hi All,
> >>
> >> I have a VB Application that lists all the reports on my report server in
> >> a
> >> treeview control. Now all i need to do is open a report when it is
> >> clicked
> >> on in my app.. What is the VB code to do this?
> >>
> >> Thanks
> >> Sanjeev
> >>
> >>
> >>
>
>|||Yip . that sure did the trick.
Appreciate all your help.
"Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
news:6138AE51-7E0C-487F-96B7-6A5A849EFF4D@.microsoft.com...
> In Visual Studio go to Tools, Add/Remove Toolbox Items.. Click on COM
> Components tab, then find Microsoft Web Browser. Check the checkbox then
> OK.
> HTH
> Charles Kangai, MCT, MCDBA
> "Sanjeev" wrote:
>> I am not entirely sure on how to add the browser control.
>> What i did was add shdocvw.dll as a reference to my to my windows
>> application.
>> Then I added "Imports SHDocVw" to the code.
>> But the Browser Control didnt appear in my ToolBox.
>> I suppose that this was the wrong way to go about it.
>> Sorry to trouble you again but what is the riht way to go about this.
>> Thanks in advance
>> Sanjeev
>>
>>
>> "Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in
>> message
>> news:C42CA3EB-A91F-4F5A-A0A6-1BE59DE35999@.microsoft.com...
>> > Use a browser control on your VB form. You can add this from the file
>> > c:\windows\system32\shdocvw.dll. Read the report path from the treeview
>> > control when a user selects an item to view, then use URL access to
>> > display
>> > the report in the browser control as follows:
>> >
>> > AxWebBrowser1.Navigate("http://MyReportServer/ReportServer?" &
>> > reportPath)
>> >
>> > AxWebBrowser1 is the default name of the browser control when you place
>> > it
>> > on the form.
>> >
>> > There are lots of examples in Books Online. Look up the topic "Using
>> > URL
>> > Acces from a Windows application".
>> >
>> > HTH
>> >
>> > Charles Kangai, MCT, MCDBA
>> >
>> > "Sanjeev" wrote:
>> >
>> >> Hi All,
>> >>
>> >> I have a VB Application that lists all the reports on my report server
>> >> in
>> >> a
>> >> treeview control. Now all i need to do is open a report when it is
>> >> clicked
>> >> on in my app.. What is the VB code to do this?
>> >>
>> >> Thanks
>> >> Sanjeev
>> >>
>> >>
>> >>
>>

No comments:

Post a Comment