[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Report Generation Getting Started Advice

hcurrie

9/2/2008 10:40:00 AM

I am about to start looking at adding various reports to the application
that I am developing. They will typically be simple tables of figures, or
graphs. At the moment there are just a few reports, but more will need to be
added in the future, and it would be useful if some of these could be
generated by a colleague who has less programming experience than I.
End-users will also need to be given some options for customising reports,
but this will likely be limited to filtering, sorting, etc... they won't be
creating completely new reports.
The data for the reports will mostly come directly from a database
(Access/Jet, SQL Server or MySQL) but some of them will require various
calculations on the data that I will need to code.
I don't have a problem generating the required SQL, or the code for the
calculations, but I'm looking for some advice for how to go about creating
the underlying system for generating and printing the reports. I have
managed to get something working using a DataGridview and a PrintDocument,
but it would be a lot of work to customise each individual report
(formatting of column widths, fonts, etc...) so I'm wondering whether I
might be better off using a third party report generator. Any suggestions
would be very much appreciated, especially anything that doesn't cost money
(my bosses are reluctant to pay much for this). I am using VS2008 Standard
Edition so anything already included in that would be good.
TIA
Phil.


6 Answers

hcurrie

9/2/2008 11:06:00 AM

0

I've just found the ReportViewer control, and this document:
http://msdn.microsoft.com/en-us/librar...(VS.80).aspx
This looks like it probably provides what I need.

>I am about to start looking at adding various reports to the application
>that I am developing. They will typically be simple tables of figures, or
>graphs. At the moment there are just a few reports, but more will need to
>be added in the future, and it would be useful if some of these could be
>generated by a colleague who has less programming experience than I.
>End-users will also need to be given some options for customising reports,
>but this will likely be limited to filtering, sorting, etc... they won't be
>creating completely new reports.
> The data for the reports will mostly come directly from a database
> (Access/Jet, SQL Server or MySQL) but some of them will require various
> calculations on the data that I will need to code.
> I don't have a problem generating the required SQL, or the code for the
> calculations, but I'm looking for some advice for how to go about creating
> the underlying system for generating and printing the reports. I have
> managed to get something working using a DataGridview and a PrintDocument,
> but it would be a lot of work to customise each individual report
> (formatting of column widths, fonts, etc...) so I'm wondering whether I
> might be better off using a third party report generator. Any suggestions
> would be very much appreciated, especially anything that doesn't cost
> money (my bosses are reluctant to pay much for this). I am using VS2008
> Standard Edition so anything already included in that would be good.
> TIA
> Phil.
>
>


jialge

9/3/2008 9:11:00 AM

0

Hello Phil

ReportViewer is a good choice. If you encounter any problem during the
development, please let us know, and we will help you.

Apart from ReportViewer, the crystal report control may also serve the
purpose. However, crystal report is not maintained/support by Microsoft:
http://support.microsoft.com/kb/31....

Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

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

hcurrie

9/3/2008 1:56:00 PM

0

> ReportViewer is a good choice. If you encounter any problem during the
> development, please let us know, and we will help you.

OK. Thanks.

I am just trying a few things out to familiarise myself with it at the
moment.
I have encountered a couple of issues though:

In one of the help pages it said to click on the ReportViewer icon in the
Data section of the Toolbox. However I do not have a ReportViewer icon in
the Data section. I found a MicrosoftReportViewer icon in the Reporting
section. This appears to be the same thing. Is this just a mistake in the
help file, or am I using the wrong thing?

Secondly I'm having difficulty understanding how grouping works. Is there an
article anywhere that explains this better than the help file?
I have a table in the report using an aggregate query with a group by clause
to group by three fields. Something like this:

SELECT fld1, fld2, fd3, count(ID) as tot FROM mytable GROUP BY fld1, fld2,
fd3

This returns data something like this:

fld1 fld2 fld3 tot
-----------------
A X i 4
A Y ii 3
A Y iii 6
....

and I would like to display it like this:

A
--
X
--
fld3 tot
--------
i 4
Y
--
fld3 tot
--------
ii 3
iii 6

Hope that makes sense.

Phil.


jialge

9/4/2008 11:26:00 AM

0

Hello Phil

For the first question about ReportViewer and MicrosoftReportViewer, this
might be related to the version of Visual Studio. In Visual Studio 2005,
it's "ReportViewer" in the Data section; in Visual Studio 2008, it's
"MicrosoftReportViewer" in the Reporting section. They refer to the same
thing. In my best guess, you are using VS 2008, and the help page is for VS
2005.

For the second question about "grouping" in report, you could right click
on the Details row (the icon on the left), and choose "Insert Group" in
the context menu. In the "Group on Expression" field, select fld1 for
instance. You can do the same on an existing group, and it will add a group
on top of that one. For more intro of group in report, please refer to MSDN
article:
http://msdn.microsoft.com/en-us/librar...(VS.80).aspx
And the group-related sections in the MSDN article:
http://msdn.microsoft.com/en-us/librar...(VS.80).aspx

If you have any other questions, welcome to post a new thread!

Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

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

hcurrie

9/4/2008 1:34:00 PM

0


> For the first question about ReportViewer and MicrosoftReportViewer, this
> might be related to the version of Visual Studio. In Visual Studio 2005,
> it's "ReportViewer" in the Data section; in Visual Studio 2008, it's
> "MicrosoftReportViewer" in the Reporting section. They refer to the same
> thing. In my best guess, you are using VS 2008, and the help page is for
> VS
> 2005.

OK. I thought it might be something like that. I am using VS2008, and there
are two versions of the article on the MSDN site, but the 2008 version is
the same as the 2005 one. It looks like someone has forgotten to update it.
http://msdn.microsoft.com/en-us/library/ms2...



hcurrie

9/4/2008 1:49:00 PM

0

> For the second question about "grouping" in report, you could right click
> on the Details row (the icon on the left), and choose "Insert Group" in
> the context menu. In the "Group on Expression" field, select fld1 for
> instance. You can do the same on an existing group, and it will add a
> group
> on top of that one. For more intro of group in report, please refer to
> MSDN
> article:
> http://msdn.microsoft.com/en-us/librar...(VS.80).aspx
> And the group-related sections in the MSDN article:
> http://msdn.microsoft.com/en-us/librar...(VS.80).aspx
>
Thanks I had read these articles already, but was having lots of problems.
After a lot of messing about I discovered that at some point I had added a
group, and must have unchecked both the include header row and include
footer row options. When you do this, the group no longer appears in the
designer screen, and as far as I can tell there then appears to be no way to
view, edit, or delete it. I only discovered it was there when I created
another group with the same name, and the only way I could find to remove it
was to open the rdlc file using the XML editor.