Monday, March 26, 2012
Opening a Report from a VB Application
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
>> >>
>> >>
>> >>
>>
Tuesday, March 20, 2012
Open or Download a file in Sql Reports Resources using Report Service API
Using the reporting service web service to get the file path for a reports and the report viewer control on a Web page, it is possible to view reports. This works fine. I built a tree view that shows the reports. I also show resource files ( like .xls or .doc files ) that a user may have uploaded to the report directory. I show these filenames in the treeview as well as actual sql reports. If the user clicks on a report name, I set the path in the report viewer control and the report is rendered.
Now I would also like the user to be able to download or open any xls or doc file that may also be in the report directory from this web application.
Is this possible?
Normally in the Report Manager it uses Resources.aspx to download or open the file.
Is there any way to access these files programatically?
thanks
-Barb
Okay I found the answer, it is using the Report Web ServicegetResourceContents()
-Barb
Wednesday, March 7, 2012
only show fields that have data in reportviewer
Hi all,
I am using reportviewer control in Visual Web Developer. It uses a report (Report.rdlc with a table) to show all the fields. I am using a stored procedure to populate the dataset. How can I set the reportviewer or the table to increase or decrease the number of columns it shows depending on the names and number of fields pulled from the database. The user has an option of choosing the fields she/he wants on the report but right now all the coulmns show (even those which I am not selecting from the database, i.e. columns with no data).
Please help,
Thanks,
bullpit
have a look at thishttp://en.wikipedia.org/wiki/Double_posting|||
I got your point. Actually I was not sure which forum I should submit this post. I found two forums which looked related to my problem so I posted in both of them. But now I know this should not be done, would you please let me know how to delete one.
Thanks