Reporting

You may find it useful to perform reporting in an application. There is a report wizard in Visual Studio (not in Express), and you can show those reports in a ReportViewer Control. To use the report viewer, take a Windows Forms form and get to the design view. Then, open up the Toolbox and scroll down to the Reporting section. Drag the ReportViewer onto the form. You will get a menu that will ask you which report you want to show, or it will let you build a new report. There is a Report Definition Language (RDL) you can use to generate a report on the fly. This is very similar to the SQL Server Reporting Services. The difference is that the Visual Studio reports are RDLC files and saved and run locally, while the SQL Server reports are RDL files and they are saved and run remotely.

An entire book could be written on reporting, so I’m not going to go into great detail here. There is a fantastic walk-through on building a report on MSDN that I highly encourage you to check out if you need to do reporting. There are walk-throughs for reporting in Windows Forms, Server Side Web Forms, and Client Side Web Forms.

I’m pointing this out just to let you know it is there and that you don’t need to reinvent the wheel to do reporting. But there is a ton of information to cover to put a working example in this writing, and it would be no more detailed than the walk-through that you can see online on MSDN.

Get C# Database Basics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.