ASP.NET
  Home arrow ASP.NET arrow Object-Oriented Report Development using C...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Object-Oriented Report Development using Crystal Reports and ASP.NET 2.0
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 15
    2007-08-20

    Table of Contents:
  • Object-Oriented Report Development using Crystal Reports and ASP.NET 2.0
  • The DBHelper class for interacting with the database
  • Developing classes to hold information from the database
  • Adding a Factory class to populate object collection

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Object-Oriented Report Development using Crystal Reports and ASP.NET 2.0


    (Page 1 of 4 )

    This is the fourth article in a series focusing on programming with Crystal Reports and ASP.NET 2.0. In this article, we will focus on implementing an object-oriented approach for creating and developing Crystal Reports using ASP.NET 2.0 and Visual Basic 2005.
    A downloadable zip file is available for this article.

    If you are new to Crystal report programming, I strongly suggest that you go through the following articles:

    Programming Crystal Reports with ASP.NET 2.0

    Working with Parameters with Crystal Reports and ASP.NET 2.0

    If you are new to OOP-based database applications in Visual Basic 2005, I further suggest that you read the following article: 

    Implementing OOP to Develop Database-Oriented Applications using VB.NET 2005

    The entire solution (source code) for this article is available as a free download (in the form of a zip). The source code in this article has been developed using Microsoft Visual Studio 2005 Professional Edition on Microsoft Windows XP Professional Edition with Microsoft SQL Server 2005 Express Edition.  I used the same version of Crystal Reports which comes with Visual Studio 2005 Professional Edition.  I didn't really test any of the code in any other tools/IDEs/servers/editions/versions. If you have any problems, please feel free to post in the discussion area.

    The approach for mixing business logic-based OOP with Crystal Reports

    Almost every .NET application is object oriented. We develop several classes involving different OOPS concepts such as inheritance, polymorphism, and so on to make applications more scalable, readable and easier to maintain. Most of these classes fall into either business logic or data access layers.

    Furthermore, we even implement a few types of patterns suggested by experts to solve the most common integration problems. The best example of this is Microsoft Enterprise Library. The pattern-oriented library is divided into several blocks and each block focuses on a particular type of module.

    All of the above methodologies are quite familiar during .NET application development. But, coming to Crystal Report development, developers take advantage of different approaches to make it easier to maintain. Most of those approaches directly use databases as data sources.

    When we maintain all our data access and business logic in the form of different classes, why can’t we use the same classes for report development as well? This approach would work well when we try to have reports embedded as part of our application, and this may not be suitable (or practical) to deploy with Crystal Servers.

    I must also agree that performance would be an issue. Performance tuning a report is not simply related to the report. We may need to tune a database (or data) with different approaches to get the reports out more quickly. Most people use stored procedures, indexed views, and so on to improve the performance of reports.

    Considering all of the above issues, I would like to present a simple approach which marries business logic classes with Crystal Reports. In my approach, I would like to introduce the following four classes:

    • DBHelper
    • Order
    • OrderCollection
    • OrderFactory

    "DBHelper" is meant only to interact with databases. "Order" contains detailed information about a particular order from the "Northwind" database.  "OrderCollection" simply maintains a set of orders. "OrderFactory" populates the "OrderCollection."

    Please note that this approach may not be suitable for every application or report you develop. It totally depends on issues such as requirements, performance, maintenance, administration, scheduling, and so forth. 

    Let us observe the code of each of those classes before looking at report development.

    More ASP.NET Articles
    More By Jagadish Chaterjee


       · Hello guys,This is my next contribution on the series of "Programming Crystal...
     

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek