Groups | Blog | Home
all groups > sql server reporting services > april 2005 >

sql server reporting services : Windows Forms RS control - When?


pdxfilter-google NO[at]SPAM yahoo.com
4/19/2005 2:20:48 PM
We're a small ISV looking to move away from Crystal Reports. For some
months, we've been waiting with bated breath for the release of an
embeddable, Windows Forms control that is able to render RDL.

VS.net Beta 2 was supposed to provide this. The control (ReportViewer)
seems to be included, but has no associated documentation or samples.
We tried to guess our way through the API, with no luck.

Our question: When does Microsoft expect to release a
workable/documented version of this control? Does anyone know if there
are samples or documentation available outside of MSDN?

Any information, no matter how small a scrap would help us immensely.
Thanks!
Deepak
4/19/2005 11:31:02 PM
Hopefully, this upcoming (Apr 22nd) MSDN Webcast can help you:

http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032271528%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e
[quoted text, click to view]
MSDN Webcast: Putting the "Smart" in Smart Client: Adding SQL Reporting to
Your Smart Client Applications Using the Reporting Services Client Controls
(Level 300)

Summar
--------------------------------------------------------------------------------
The new client controls in Microsoft Visual Studio 2005 allow you to create
Microsoft SQL Server 2005 Reporting Services formatted reports in your smart
client applications. These reports do not require a Reporting Services
Server. This session shows how to make use of these new controls in your
smart client applications as well as how to enhance their functionality by
migrating them to a central Report Server.

Presenter: Brian Welcker, Group Program Manager, Microsoft Corporation
[quoted text, click to view]

- Deepak


[quoted text, click to view]
pdxfilter-google NO[at]SPAM yahoo.com
4/20/2005 12:38:59 PM
Deepak,

Thanks! This is exactly what I'm looking for...
Rajeev Karunakaran
4/20/2005 2:53:31 PM
Some information will be available on MSDN soon.

Meanwhile here are the steps to create a basic WinForms app using the
ReportViewer control:

1. Create a C# or VB project.
2. From the Data menu choose Show Data Sources command. This opens the Data
Sources window.
3. The toolbar of Data Sources window has an Add New Data Source button.
Press this button to launch the Data Source Configuration Wizard.
4. Click Database in the Data Source Configuration Wizard. Continue with the
wizard. When you finish the wizard the columns of the selected table will
appear in the Data Sources window.
5. From Project menu choose Add New Item. In the Add New Item dialog choose
Report. This launches Report Designer.
6. Design the report. You can drag & drop fields from the Data Sources
window. (You may also need to access the Report Data Sources dialog, from
the Report menu. This dialog is used to specify which of the project data
sources should be used in the report.)
7. Expand the Data section of the Toolbox and drag & drop ReportViewer
control to the form.
8. In the smart tags panel of ReportViewer, select the report you designed.
As soon as the report is selected all the necessary code is generated for
you.
9. Press F5 to run the application.

For basic reports you don't have to write even a single line of code.

If you have subreports you have to handle
ReportViewer.LocalReport.SubreportProcessing event, and supply data for the
subreport in the event handler. If you have drillthrough reports you have to
handle ReportViewer.Drillthrough event and supply data for the drillthrough
report in the event handler.

Data can be supplied as DataTables or as a collection of business objects.
If you are familiar with the DataGridView control then ReportViewer control
is similar as far as data is concerned. The only difference is that the
DataGridView control only accepts one datasource instance at a time, but you
can supply multiple datasource instances to the ReportViewer control.

Create a simple app using the steps above then explore the API, especially
ReportViewer.LocalReport object. If you have questions post them here.

--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services

This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

pdxfilter-google NO[at]SPAM yahoo.com
4/20/2005 6:39:06 PM
Rajeev,

Thanks so much for your extensive reply. Us old timers often don't
think to turn to the wizards for help! I was able to get your steps to
work without a hitch.

I do have an outstanding question and maybe it'll get answered in time.
Passing DataSets to the ReportViewer is pretty powerful, but we're
wanting a general purpose method to add reports to our application such
that code won't have to be created for each report. Ideally, we would
only have to specify a RDL stream and SQL Server logon credentials and
the rest (display, drill-down, etc.) would happen automatically. This
would allow our clients to create sophisticated, drill-down reports for
our product without having to modify code. Are we on the right track?

Thanks again for responding. We've been waiting for this control for a
while and it's great to see it in action...

Jon
Rajeev Karunakaran
4/20/2005 7:17:26 PM
The ReportViewer control has two modes. It can either process and render
reports all by itself ("local mode") or it can connect to a Report Server to
view reports that are processed and rendered by the Report Server ("remote
mode"). Remote mode does exactly what you are asking for. You can embed
ReportViewer control in your application and point it to the Report Server,
and it will render the report, subreport, drillthrough report etc, without
you having to write any code.

In local mode you do have to write a tiny amount of code if you have
drillthrough reports: You have to handle the drillthrough event and supply
the data for the drillthrough report. This is required because the
ReportViewer control does not connect to databases and fetch data itself. We
separated that functionality out of the control in order to make it
compatible with all kinds of datasources, including CSV or XML files, web
services, business objects and other types of datasources that are only
understood by your application. Also note that Visual Studio can generate
code for connecting to databases, executing queries and fetching data.
Because of that it didn't make sense for us to build such functionality into
the control.

--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services

This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

azmat.mohammed NO[at]SPAM gmail.com
4/21/2005 1:03:13 AM
Rajeev,

For some reason when I open up a new winForms app, and click on the
Data menu, I only see two options:

Generate DataSet
Preview Data

Both of which are disabled. Am I d doing something wrong? I have
Reporting Services client tools installed, but can access any oitems
under the Data menu. Also, how do I get the ReportViewer control -- I
dont think I have it.

thanks!

azmat
Rajeev Karunakaran
4/21/2005 10:27:16 AM
Are you using Visual Studio 2005 Beta 2, Standard edition or better?
(ReportViewer control is not included in the Express edition.) If so in a C#
or VB project the Data menu should have "Show Data Sources" and "Add New
Data Source" commands.

--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services

This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

pdxfilter-google NO[at]SPAM yahoo.com
4/21/2005 12:02:02 PM
Rajeev,

Thank you for your informative replies; we're learning a lot. A couple
questions:

When running in "Remote" mode, does this require reporting services
(and a SQL license) or can SQL Desktop Edition/Express be used? Must
this run through IIS or can it a database connection?

Embedded in the RDL is a <CommandText> tag with the appropriate SQL
query. Ideally, we would like ReportViewer to pull data automatically
for the main report and all subreports. Since this doesn't seem to be
possible, we'll need to write a generic "bridge" that runs these
queries for the main report and subreport and feeds the data to the
ReportViewer. Unfortunately, we can't just drop our report into the
Visual Studio data adapter wizard as we allow our customers to plug in
their own reports that do who-knows-what.

Will it be possible for us to write this generically, so that any RDL
report can be added to the system without touching the code?

Thanks again for your patience with our questions!

Jon
Rajeev Karunakaran
4/21/2005 2:44:07 PM
Yes, to use the ReportViewer control in remote processing mode you need a
Report Server, which means a SQL Server license is required. SQL Server
Express does not include Report Server.

As you mentioned, RDL files contain a <CommandText> tag, but this tag is
ignored by the ReportViewer control. The ReportViewer control does not have
the ability to connect to databases or execute queries. (This capability was
not included in the control because we wanted the control to be compatible
with all kinds of data sources, not just databases, and also because Visual
Studio can generate code for getting data from databases any way.)

It is possible to allow your customers to plug in their own reports.
Typically, in this scenario, the data comes from your application and is
always the same, and the report added by your customer is just a new view of
the same data. If this is your scenario then it is easy to do, but if the
data changes based on the report then you have additional work to do. It is
up to your application to figure out what data is expected by the RDL and
supply that data to the ReportViewer control. One way to do that might be
for your application to peek inside the RDL and extract whatever is inside
the <CommandText> tag.

--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services

This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

pdxfilter-google NO[at]SPAM yahoo.com
4/21/2005 6:54:28 PM
Rajeev,

Thanks - this is exactly what we needed to know. As you said, the
<CommandText> tag doesn't appear to be accessible through the API.
We're comfortable fishing around in the RDL for this. When it comes to
parameters being used to condition reports and parameterized
drillthrough subreports, it gets tougher. It looks like we will need
to possibly do some relatively sophisticated text parsing to manually
construct the SQL queries necessary to handle these.

The flexible way ReportViewer is designed is understandable, but we
can't be the only ones who just want to set an RDL "string", point it
at a SQL Server database and have the rest be "magically" taken care
of. Seems like an opportunity for a 3rd party if Microsoft doesn't
fill this hole.

Thanks again, Rajeev, for your thoughts on this. Reporting services is
very mature for the age that it is - we'll just be one of those
customers who needs just a little bit more... :)

Meanwhile, if anyone has any ideas to "automagically" do what we want,
we'd be very interested. Thanks!

Jon
Ravi R
4/22/2005 3:31:51 PM
Rajeev,

This thread is very very informative regarding how to get the reports
inside a windows app.
I am trying to achieve a similar objective and here is some background
of the system I have.
1. I have implemented SQL RS and deployed to a production server and
clients access it through URL directly and the built-in interface.
2. Authentication is Windows based (created accounts on the server
machine)
Mainly due to lack of time to implement something more sophisticated.
3. I am developing a windows app for the same organization and the
clients want me to integrate RS somehow into the app.
4. I am using VS.NET 2003. (so i guess I Cant add the RV control
directly)
5. The application has an authentication mechanism (user-passwd pairs
stored in db).

My questions/issues are the following.
Q1. How to include the RV control into the windows app (i know there is
a sample dll of RV in samples folder of RS but somehow when I include
reference, i dont cant use the control) Donno if I am doing the right
thing.
Q2. How to integrate the authentication of RS with the authentication
of the App ?

Any suggestions will appreciated.

Thanks very much
Ravi
Rajeev Karunakaran
4/22/2005 3:48:03 PM
The ReportViewer control can be added to WinForms (or Web) apps written
using .NET v2.0. Earlier in this thread I have provided the steps to create
a simple app using the control.

In remote mode the ReportViewer control connects to the Report Server as the
thread user. If the server is set to integrated security and you have
permission to view the report then you shouldn't have to do anything
special. If you want to specify the windows identity to connect to the
Report Server as, or if you want to use basic auth etc then you have to
implement the IReportServerCredentials interface, and set
ReportViewer.ServerReport.ReportServerCredentials property.

--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services

This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

Robert Bruckner [MSFT]
4/22/2005 5:15:01 PM
Just adding to Rajeev's comments: the remote mode of the ReportViewer
control can only connect to a SQL Server 2005 Report Server.

-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.


"Rajeev Karunakaran" <rajeevkarunakaran@online.microsoft.com> wrote in
message news:%23CvCZ14RFHA.508@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

Ravi R
4/22/2005 5:35:52 PM
Rajeev and Robert,

Thanks for the quick responses.
We are running SQL server 2000 and RS EE SP1.
Is there anything I can do to integrate RS into my App without any
upgrades ?

Thanks
Ravi
Robert Bruckner [MSFT]
4/22/2005 5:39:52 PM
No. The RS Winforms and Webforms controls actually use the new 2005 SOAP
endpoint to communicate with the report server. Also there was functionality
specifically added in the 2005 Report Server to enable certain execution
scenarios. All this does not exist on a RS 2000 infrastructure.

You can still use the controls in "Local" processing mode. But in this case
the controls would not connect to any report server.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

set server credential?
4/26/2005 9:38:01 PM
I tried to run the Reportviewer client application from different system
other that reporting server.it throwing error ERRO 404.Connection Error.Do
you know how to set server credential?



[quoted text, click to view]
Rajeev Karunakaran
4/27/2005 11:20:32 AM
You have to make an implementation of IReportServerCredentials interface and
set ReportViewer.ServerReport.ReportServerCredentials property.

--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services

This posting is provided "AS IS" with no warranties, and confers no rights.

"set server credential?" <set server credential?@discussions.microsoft.com>
[quoted text, click to view]

AddThis Social Bookmark Button