Monday, March 26, 2012

ReportViewe needs a connection? Doesn't make sense...

Hi,
I have a VB .NET 2.0 WinForms application that needs to display reports on a
winform's ReportViewer control.
The application project and a separate reports project are under the same
solution.
The report project has its own global connection and datasource object that
is used by the report.
I test the report inside the Visual Studio developing environment report's
view mode and it works ok.
Then I open the form that has the ReportViewer control (in the application
project), and in the designer, I assign the properties and the report to the
ReportViewer control. I run the application... the form displays, and the
ReportViewer displays an error inside saying there's no dataset. Why? The
report has a connection and a dataset and they work when I test it.
So I create a connection and dataset in the application's project like the
ones I have in the report project, but I can't find a way to assign the
dataset to the ReportViewer...
How can I make this work?
Would you please Help me? This is the tip of the iceberg of all the problems
we're having with our reports and RSvcs... Thanks in advance.
Sincerely,
RichardThe report viewer operates in two modes. One is server based, the other is
local mode. In local mode you give it a .rdlc file (which is a renamed .rdl
file) and a tableset. In server mode you just give it the name of the
report, parameters, etc. It has to have been pointed to a server.
If you are doing local mode you have a lot more you have to do. You have to
handle events such as dealing with subreports (this is because you are
responsible when responding to the event to create the dataset for the
subreport). You have to handle drill through, etc etc. If you have a server
around it is much easier. I looked at local mode and decided to stick with
using the server.
If server mode then you need to have the report deployed to a server.
Hope that helps.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Richard" <Richard@.discussions.microsoft.com> wrote in message
news:D962526B-C414-4C5C-91CB-F671A3B529CA@.microsoft.com...
> Hi,
> I have a VB .NET 2.0 WinForms application that needs to display reports on
> a
> winform's ReportViewer control.
> The application project and a separate reports project are under the same
> solution.
> The report project has its own global connection and datasource object
> that
> is used by the report.
> I test the report inside the Visual Studio developing environment report's
> view mode and it works ok.
> Then I open the form that has the ReportViewer control (in the application
> project), and in the designer, I assign the properties and the report to
> the
> ReportViewer control. I run the application... the form displays, and the
> ReportViewer displays an error inside saying there's no dataset. Why? The
> report has a connection and a dataset and they work when I test it.
> So I create a connection and dataset in the application's project like the
> ones I have in the report project, but I can't find a way to assign the
> dataset to the ReportViewer...
> How can I make this work?
> Would you please Help me? This is the tip of the iceberg of all the
> problems
> we're having with our reports and RSvcs... Thanks in advance.
> Sincerely,
> Richard|||Thank you Bruce,
In local mode it needs a tableset? These reports are all based on stored
procedures. Does that mean they need to be rewritten to use tables?
One thing I noticed is the ReportViewer control needs a ReportDataSet
instance for local reports, but I couldn't find a way to convert/create a
ReportDataSet out of the already-existing dataset. How is it supposed to be
done?
Thanks in advance,
Richard
"Bruce L-C [MVP]" wrote:
> The report viewer operates in two modes. One is server based, the other is
> local mode. In local mode you give it a .rdlc file (which is a renamed .rdl
> file) and a tableset. In server mode you just give it the name of the
> report, parameters, etc. It has to have been pointed to a server.
> If you are doing local mode you have a lot more you have to do. You have to
> handle events such as dealing with subreports (this is because you are
> responsible when responding to the event to create the dataset for the
> subreport). You have to handle drill through, etc etc. If you have a server
> around it is much easier. I looked at local mode and decided to stick with
> using the server.
> If server mode then you need to have the report deployed to a server.
>
> Hope that helps.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Richard" <Richard@.discussions.microsoft.com> wrote in message
> news:D962526B-C414-4C5C-91CB-F671A3B529CA@.microsoft.com...
> > Hi,
> >
> > I have a VB .NET 2.0 WinForms application that needs to display reports on
> > a
> > winform's ReportViewer control.
> > The application project and a separate reports project are under the same
> > solution.
> > The report project has its own global connection and datasource object
> > that
> > is used by the report.
> > I test the report inside the Visual Studio developing environment report's
> > view mode and it works ok.
> >
> > Then I open the form that has the ReportViewer control (in the application
> > project), and in the designer, I assign the properties and the report to
> > the
> > ReportViewer control. I run the application... the form displays, and the
> > ReportViewer displays an error inside saying there's no dataset. Why? The
> > report has a connection and a dataset and they work when I test it.
> >
> > So I create a connection and dataset in the application's project like the
> > ones I have in the report project, but I can't find a way to assign the
> > dataset to the ReportViewer...
> >
> > How can I make this work?
> >
> > Would you please Help me? This is the tip of the iceberg of all the
> > problems
> > we're having with our reports and RSvcs... Thanks in advance.
> >
> > Sincerely,
> >
> > Richard
>
>|||Should have used the term datatable. Datasets can have multiple datatables.
In local mode you hand the control a rdlc file and the data. If your data is
from a stored procedure you have to call that stored procedure in your code.
It sounds like you have not written any ado.net code (creating datasets,
executing queries etc).
Local mode requires significantly more coding expertise than creating a
report, deploying it to a reportserver. You have to write code to respond to
events. You have to write code to retrieve the data the report is designed
for. You have to write code to retreive the data for the subreport. It is
non-trivial and if you are coming from a background of never having written
ado.net code then you have a big learning curve.
Are you sure you have to use local mode, do you have a reportserver around
that you can use. The control is quite easy to use in server mode (the
report resides on a server and is rendered there).
Bruce Loehle-Conger
"Richard" <Richard@.discussions.microsoft.com> wrote in message
news:C79C33D3-C72E-4BF3-AC1F-31E77DBC743F@.microsoft.com...
> Thank you Bruce,
> In local mode it needs a tableset? These reports are all based on stored
> procedures. Does that mean they need to be rewritten to use tables?
> One thing I noticed is the ReportViewer control needs a ReportDataSet
> instance for local reports, but I couldn't find a way to convert/create a
> ReportDataSet out of the already-existing dataset. How is it supposed to
> be
> done?
> Thanks in advance,
> Richard
> "Bruce L-C [MVP]" wrote:
>> The report viewer operates in two modes. One is server based, the other
>> is
>> local mode. In local mode you give it a .rdlc file (which is a renamed
>> .rdl
>> file) and a tableset. In server mode you just give it the name of the
>> report, parameters, etc. It has to have been pointed to a server.
>> If you are doing local mode you have a lot more you have to do. You have
>> to
>> handle events such as dealing with subreports (this is because you are
>> responsible when responding to the event to create the dataset for the
>> subreport). You have to handle drill through, etc etc. If you have a
>> server
>> around it is much easier. I looked at local mode and decided to stick
>> with
>> using the server.
>> If server mode then you need to have the report deployed to a server.
>>
>> Hope that helps.
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Richard" <Richard@.discussions.microsoft.com> wrote in message
>> news:D962526B-C414-4C5C-91CB-F671A3B529CA@.microsoft.com...
>> > Hi,
>> >
>> > I have a VB .NET 2.0 WinForms application that needs to display reports
>> > on
>> > a
>> > winform's ReportViewer control.
>> > The application project and a separate reports project are under the
>> > same
>> > solution.
>> > The report project has its own global connection and datasource object
>> > that
>> > is used by the report.
>> > I test the report inside the Visual Studio developing environment
>> > report's
>> > view mode and it works ok.
>> >
>> > Then I open the form that has the ReportViewer control (in the
>> > application
>> > project), and in the designer, I assign the properties and the report
>> > to
>> > the
>> > ReportViewer control. I run the application... the form displays, and
>> > the
>> > ReportViewer displays an error inside saying there's no dataset. Why?
>> > The
>> > report has a connection and a dataset and they work when I test it.
>> >
>> > So I create a connection and dataset in the application's project like
>> > the
>> > ones I have in the report project, but I can't find a way to assign the
>> > dataset to the ReportViewer...
>> >
>> > How can I make this work?
>> >
>> > Would you please Help me? This is the tip of the iceberg of all the
>> > problems
>> > we're having with our reports and RSvcs... Thanks in advance.
>> >
>> > Sincerely,
>> >
>> > Richard
>>|||Hi Bruce,
Thank you for helping me. Yes I have experience with ADO .NET but I'm a
newbie in Reporting Services and I need to "port" Crystal Reports (that are
working) to RS. So I have been trying to accomplish this using the local
approach, but I understand now that it would be easier to use reports from
the server instead of local reports.
There is a WinForm where the user selects the criteria (parameter values)
for the report and the application needs to pass these parameter values to
the report (w/o using the built-in report's parameter interface). Would you
please tell me how can this be done?
Thank you in advance,
Richard
==="Bruce L-C [MVP]" wrote:
> Should have used the term datatable. Datasets can have multiple datatables.
> In local mode you hand the control a rdlc file and the data. If your data is
> from a stored procedure you have to call that stored procedure in your code.
> It sounds like you have not written any ado.net code (creating datasets,
> executing queries etc).
> Local mode requires significantly more coding expertise than creating a
> report, deploying it to a reportserver. You have to write code to respond to
> events. You have to write code to retrieve the data the report is designed
> for. You have to write code to retreive the data for the subreport. It is
> non-trivial and if you are coming from a background of never having written
> ado.net code then you have a big learning curve.
> Are you sure you have to use local mode, do you have a reportserver around
> that you can use. The control is quite easy to use in server mode (the
> report resides on a server and is rendered there).
> Bruce Loehle-Conger
>
> "Richard" <Richard@.discussions.microsoft.com> wrote in message
> news:C79C33D3-C72E-4BF3-AC1F-31E77DBC743F@.microsoft.com...
> > Thank you Bruce,
> >
> > In local mode it needs a tableset? These reports are all based on stored
> > procedures. Does that mean they need to be rewritten to use tables?
> >
> > One thing I noticed is the ReportViewer control needs a ReportDataSet
> > instance for local reports, but I couldn't find a way to convert/create a
> > ReportDataSet out of the already-existing dataset. How is it supposed to
> > be
> > done?
> >
> > Thanks in advance,
> >
> > Richard
> >
> > "Bruce L-C [MVP]" wrote:
> >
> >> The report viewer operates in two modes. One is server based, the other
> >> is
> >> local mode. In local mode you give it a .rdlc file (which is a renamed
> >> .rdl
> >> file) and a tableset. In server mode you just give it the name of the
> >> report, parameters, etc. It has to have been pointed to a server.
> >>
> >> If you are doing local mode you have a lot more you have to do. You have
> >> to
> >> handle events such as dealing with subreports (this is because you are
> >> responsible when responding to the event to create the dataset for the
> >> subreport). You have to handle drill through, etc etc. If you have a
> >> server
> >> around it is much easier. I looked at local mode and decided to stick
> >> with
> >> using the server.
> >>
> >> If server mode then you need to have the report deployed to a server.
> >>
> >>
> >> Hope that helps.
> >>
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >>
> >> "Richard" <Richard@.discussions.microsoft.com> wrote in message
> >> news:D962526B-C414-4C5C-91CB-F671A3B529CA@.microsoft.com...
> >> > Hi,
> >> >
> >> > I have a VB .NET 2.0 WinForms application that needs to display reports
> >> > on
> >> > a
> >> > winform's ReportViewer control.
> >> > The application project and a separate reports project are under the
> >> > same
> >> > solution.
> >> > The report project has its own global connection and datasource object
> >> > that
> >> > is used by the report.
> >> > I test the report inside the Visual Studio developing environment
> >> > report's
> >> > view mode and it works ok.
> >> >
> >> > Then I open the form that has the ReportViewer control (in the
> >> > application
> >> > project), and in the designer, I assign the properties and the report
> >> > to
> >> > the
> >> > ReportViewer control. I run the application... the form displays, and
> >> > the
> >> > ReportViewer displays an error inside saying there's no dataset. Why?
> >> > The
> >> > report has a connection and a dataset and they work when I test it.
> >> >
> >> > So I create a connection and dataset in the application's project like
> >> > the
> >> > ones I have in the report project, but I can't find a way to assign the
> >> > dataset to the ReportViewer...
> >> >
> >> > How can I make this work?
> >> >
> >> > Would you please Help me? This is the tip of the iceberg of all the
> >> > problems
> >> > we're having with our reports and RSvcs... Thanks in advance.
> >> >
> >> > Sincerely,
> >> >
> >> > Richard
> >>
> >>
> >>
>
>|||You are correct, using in server mode is much easier. First, it is easier to
develop the report using the report designer and previewing it. Next it is
easier to have full functionality (subreports, drill through, etc).
As far as setting the parameters:
http://msdn2.microsoft.com/en-us/library/microsoft.reporting.winforms.reportparameterinfo.aspx
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Richard" <Richard@.discussions.microsoft.com> wrote in message
news:3914427F-67E0-45D1-B5AE-41F8376726A7@.microsoft.com...
> Hi Bruce,
> Thank you for helping me. Yes I have experience with ADO .NET but I'm a
> newbie in Reporting Services and I need to "port" Crystal Reports (that
> are
> working) to RS. So I have been trying to accomplish this using the local
> approach, but I understand now that it would be easier to use reports from
> the server instead of local reports.
> There is a WinForm where the user selects the criteria (parameter values)
> for the report and the application needs to pass these parameter values to
> the report (w/o using the built-in report's parameter interface). Would
> you
> please tell me how can this be done?
> Thank you in advance,
> Richard
> ===> "Bruce L-C [MVP]" wrote:
>> Should have used the term datatable. Datasets can have multiple
>> datatables.
>> In local mode you hand the control a rdlc file and the data. If your data
>> is
>> from a stored procedure you have to call that stored procedure in your
>> code.
>> It sounds like you have not written any ado.net code (creating datasets,
>> executing queries etc).
>> Local mode requires significantly more coding expertise than creating a
>> report, deploying it to a reportserver. You have to write code to respond
>> to
>> events. You have to write code to retrieve the data the report is
>> designed
>> for. You have to write code to retreive the data for the subreport. It is
>> non-trivial and if you are coming from a background of never having
>> written
>> ado.net code then you have a big learning curve.
>> Are you sure you have to use local mode, do you have a reportserver
>> around
>> that you can use. The control is quite easy to use in server mode (the
>> report resides on a server and is rendered there).
>> Bruce Loehle-Conger
>>
>> "Richard" <Richard@.discussions.microsoft.com> wrote in message
>> news:C79C33D3-C72E-4BF3-AC1F-31E77DBC743F@.microsoft.com...
>> > Thank you Bruce,
>> >
>> > In local mode it needs a tableset? These reports are all based on
>> > stored
>> > procedures. Does that mean they need to be rewritten to use tables?
>> >
>> > One thing I noticed is the ReportViewer control needs a ReportDataSet
>> > instance for local reports, but I couldn't find a way to convert/create
>> > a
>> > ReportDataSet out of the already-existing dataset. How is it supposed
>> > to
>> > be
>> > done?
>> >
>> > Thanks in advance,
>> >
>> > Richard
>> >
>> > "Bruce L-C [MVP]" wrote:
>> >
>> >> The report viewer operates in two modes. One is server based, the
>> >> other
>> >> is
>> >> local mode. In local mode you give it a .rdlc file (which is a renamed
>> >> .rdl
>> >> file) and a tableset. In server mode you just give it the name of the
>> >> report, parameters, etc. It has to have been pointed to a server.
>> >>
>> >> If you are doing local mode you have a lot more you have to do. You
>> >> have
>> >> to
>> >> handle events such as dealing with subreports (this is because you are
>> >> responsible when responding to the event to create the dataset for the
>> >> subreport). You have to handle drill through, etc etc. If you have a
>> >> server
>> >> around it is much easier. I looked at local mode and decided to stick
>> >> with
>> >> using the server.
>> >>
>> >> If server mode then you need to have the report deployed to a server.
>> >>
>> >>
>> >> Hope that helps.
>> >>
>> >> --
>> >> Bruce Loehle-Conger
>> >> MVP SQL Server Reporting Services
>> >>
>> >> "Richard" <Richard@.discussions.microsoft.com> wrote in message
>> >> news:D962526B-C414-4C5C-91CB-F671A3B529CA@.microsoft.com...
>> >> > Hi,
>> >> >
>> >> > I have a VB .NET 2.0 WinForms application that needs to display
>> >> > reports
>> >> > on
>> >> > a
>> >> > winform's ReportViewer control.
>> >> > The application project and a separate reports project are under the
>> >> > same
>> >> > solution.
>> >> > The report project has its own global connection and datasource
>> >> > object
>> >> > that
>> >> > is used by the report.
>> >> > I test the report inside the Visual Studio developing environment
>> >> > report's
>> >> > view mode and it works ok.
>> >> >
>> >> > Then I open the form that has the ReportViewer control (in the
>> >> > application
>> >> > project), and in the designer, I assign the properties and the
>> >> > report
>> >> > to
>> >> > the
>> >> > ReportViewer control. I run the application... the form displays,
>> >> > and
>> >> > the
>> >> > ReportViewer displays an error inside saying there's no dataset.
>> >> > Why?
>> >> > The
>> >> > report has a connection and a dataset and they work when I test it.
>> >> >
>> >> > So I create a connection and dataset in the application's project
>> >> > like
>> >> > the
>> >> > ones I have in the report project, but I can't find a way to assign
>> >> > the
>> >> > dataset to the ReportViewer...
>> >> >
>> >> > How can I make this work?
>> >> >
>> >> > Would you please Help me? This is the tip of the iceberg of all the
>> >> > problems
>> >> > we're having with our reports and RSvcs... Thanks in advance.
>> >> >
>> >> > Sincerely,
>> >> >
>> >> > Richard
>> >>
>> >>
>> >>
>>

No comments:

Post a Comment