Is there a report viewer for a window application? I need to plug a report
into a Vb.Net windows app.
Thanks.Yes, there is a ReportViewer.dll which is great for ASP.NET applications.
This is installed in the folder YoursQLInstallfolder\Reporting
Services\Samples\Applications\ReportViewer.
But for windows applications why not use the web browser control? Add it to
your Windows project toolbox by doing Tools,Add/Remove Toolbox Items select
COM Components tab, then put a checkbox against Microsoft Web Browser
(filename c:\windows\system32\shdocvw.dll). This adds it to your toolbox. Now
add it to your Windows form; the default name for the control when added is
AxWebBrowser1.
Now you can do:
axWebBrowser1.Navigate("http://MyServer/ReportServer?" & reportPath)
for example:
axWebBrowser1.Navigate("http://MyServer/ReportServer?/Sample
Reports/Territory Sales Drilldown")
HTH
Charles Kangai, MCT, MCDBA
"Ed Willis" wrote:
> Is there a report viewer for a window application? I need to plug a report
> into a Vb.Net windows app.
> Thanks.
>
>
>|||That's great I was able to bring the report up. I cannot get the export to
excel to work. If I click Open after clicking on the export nothing happens.
Is there security problems with exporting?
Thanks.
"Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
news:790C7718-0D03-40B1-9BC0-CC4DD08BDD51@.microsoft.com...
> Yes, there is a ReportViewer.dll which is great for ASP.NET applications.
> This is installed in the folder YoursQLInstallfolder\Reporting
> Services\Samples\Applications\ReportViewer.
> But for windows applications why not use the web browser control? Add it
> to
> your Windows project toolbox by doing Tools,Add/Remove Toolbox Items
> select
> COM Components tab, then put a checkbox against Microsoft Web Browser
> (filename c:\windows\system32\shdocvw.dll). This adds it to your toolbox.
> Now
> add it to your Windows form; the default name for the control when added
> is
> AxWebBrowser1.
> Now you can do:
> axWebBrowser1.Navigate("http://MyServer/ReportServer?" & reportPath)
> for example:
> axWebBrowser1.Navigate("http://MyServer/ReportServer?/Sample
> Reports/Territory Sales Drilldown")
> HTH
> Charles Kangai, MCT, MCDBA
> "Ed Willis" wrote:
>> Is there a report viewer for a window application? I need to plug a
>> report
>> into a Vb.Net windows app.
>> Thanks.
>>
>>|||You need to call the web service's Render method. This creates an array of
bytes that you can write to a file. The Render method accepts a format
parameter.
This is what you need to do:
1) add the Reporting Services web reference to your project. The web
reference is http://Yourserver/ReportServer/ReportService.asmx
when you add it, you have to give it a name, such as RServer.
2) At the top of your form window code add:
Imports YourProjectName.RServer
Imports System.IO
3) declare and create an instance of the Reporting Service. I like to do it
at form level, within the Form1 class:
dim rs as New ReportingService
4) Assuming you are using code behind button to export to excel:
private sub Button1_Click(...)
dim historyid as string = nothing
dim deviceinfo as string = nothing
dim paramvalues() as ParameterValue = nothing
dim credentials() as DataSourceCredentials = nothing
dim showhide as string = nothing
dim encoding as string = nothing
dim mimetype as string = nothing
dim warnings() as Warning = nothing
dim paramsused() as ParameterValue
dim streamids() as string = nothing
dim myRenderedReport as byte() = _
rs.Render("/Sample Reports/Territory Sales DrillDown", "EXCEL", historyid,
deviceinfo, paramvalues, credentials, showhide, encoding, mimetype,
paramsused, warnings, streamids)
dim fs as FileStream = File.OpenWrite("c:\MyFile.xls")
fs.Write(myRenderedReport, 0, myRenderedReport.Length())
fs.Close()
End Sub
you can do:
dim myRenderedReport as byte[] = TheWebService.Render(FullReportPath, "EXCEL")
dim myFileStream as filestream
"Ed Willis" wrote:
> That's great I was able to bring the report up. I cannot get the export to
> excel to work. If I click Open after clicking on the export nothing happens.
> Is there security problems with exporting?
> Thanks.
> "Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
> news:790C7718-0D03-40B1-9BC0-CC4DD08BDD51@.microsoft.com...
> > Yes, there is a ReportViewer.dll which is great for ASP.NET applications.
> > This is installed in the folder YoursQLInstallfolder\Reporting
> > Services\Samples\Applications\ReportViewer.
> >
> > But for windows applications why not use the web browser control? Add it
> > to
> > your Windows project toolbox by doing Tools,Add/Remove Toolbox Items
> > select
> > COM Components tab, then put a checkbox against Microsoft Web Browser
> > (filename c:\windows\system32\shdocvw.dll). This adds it to your toolbox.
> > Now
> > add it to your Windows form; the default name for the control when added
> > is
> > AxWebBrowser1.
> >
> > Now you can do:
> > axWebBrowser1.Navigate("http://MyServer/ReportServer?" & reportPath)
> >
> > for example:
> > axWebBrowser1.Navigate("http://MyServer/ReportServer?/Sample
> > Reports/Territory Sales Drilldown")
> >
> > HTH
> >
> > Charles Kangai, MCT, MCDBA
> >
> > "Ed Willis" wrote:
> >
> >> Is there a report viewer for a window application? I need to plug a
> >> report
> >> into a Vb.Net windows app.
> >>
> >> Thanks.
> >>
> >>
> >>
> >>
> >>
>
>|||A ReportViewer control will be available in Visual Studio 2005 (aka
Whidbey). Whidbey Beta 1 does not have the ReportViewer control, but Beta 2,
scheduled for early 2005, will contain the control. There will be a WinForms
version and a WebForms version. The ReportViewer control will have built-in
ability to process and render reports, which means a Report Server is
unnecessary. If a Report Server is available then the controls will be able
to connect to the Report Server to view reports that are stored and
processed on the Report Server. Licensing has not been finalized, but we are
looking into making this control freely redistributable.
--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ed Willis" <ed_willis@.acsi.orgnospam> wrote in message
news:etizP1j1EHA.1524@.TK2MSFTNGP09.phx.gbl...
> Is there a report viewer for a window application? I need to plug a report
> into a Vb.Net windows app.
> Thanks.
>
>
No comments:
Post a Comment