Professional Documents
Culture Documents
Generation in C#: MIS 21 - Introduction To Applications Development
Generation in C#: MIS 21 - Introduction To Applications Development
Generation in C#
MIS 21 – Introduction to Applications Development
Management Reporting
The regular provision of information to decision-
makers within an organization to support them in
their work
Can have graphs, text and tables
Can be generated regularly (e.g. weekly, monthly)
or ad hoc
Adding reporting features in a program saves the
user time and effort in preparing the report
Example of a Report
Creating Reports in C#
Can be done by
Using ReportViewer (for Visual Studio Standard
Edition)
Using third-party software (e.g. CrystalReports)
Manually draw the report using System.Drawing
and System.Drawing.Printing
Forour version of C#, we will manually
create our reports
Manually Creating Reports
Advantages
Free
Flexible and customizable
Disadvantages
Complicated
Each text and graphic needs to be drawn
Takes time to program
Solution
Use third-party libraries
Generating a Report
using ReportLibrary;
Create an instance of ReportClass
Assign
values to the Properties of the
ReportClass (e.g. report.ReportTitle)
Createa PrintPreviewDialog and
associate the report to it
Sample Report Code
ReportClass report = new ReportClass();
report.SetReportSource(headers, data);
report.ReportTitle = "Sample Report";
report.ReportLogo = Image.FromFile("company_logo.jpg");
report.TitleFont = new Font("Arial", 24, FontStyle.Bold);
report.TitleFontColor = Brushes.Green;
report.ShowTableGrid = false;
report.ShowTotals = false;
report.IsLandscape = false;