Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 72303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:01:25+00:00 2026-05-10T20:01:25+00:00

I need to create reports in a C# .NET Windows app. I’ve got an

  • 0

I need to create reports in a C# .NET Windows app. I’ve got an SQL Server 2005 database, Visual Studio 2005 and am quite OK with creating stored procedures and datasets.

Can someone please point me in the right direction for creating reports? I just can’t seem work it out. Some examples would be a good start, or a simple How-to tutorial… anything really that is a bit better explained than the MSDN docs.

I’m using the CrystalDecisions.Windows.Forms.CrystalReportViewer control to display the reports, I presume this is correct.

If I’m about to embark on a long and complex journey, what’s the simplest way to create and display reports that can also be printed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:01:25+00:00Added an answer on May 10, 2026 at 8:01 pm

    I have managed to make this work now.

    Brief Overview

    It works by having a ‘data class’ which is just a regular C# class containing variables and no code. This is then instantiated and filled with data and then placed inside an ArrayList. The ArrayList is bound to the report viewer, along with the name of the report to load. In the report designer ‘.Net Objects’ are used, rather than communicating with the database.

    Explanation

    I created a class to hold the data for my report. This class is manually filled by me by manually retrieving data from the database. How you do this doesn’t matter, but here’s an example:

    DataSet ds = GeneratePickingNoteDataSet(id); foreach (DataRow row in ds.Tables[0].Rows) {     CPickingNoteData pickingNoteData = new CPickingNoteData();      pickingNoteData.delivery_date = (DateTime)row['delivery_date'];     pickingNoteData.cust_po = (int)row['CustomerPONumber'];     pickingNoteData.address = row['CustomerAddress'].ToString();     // ... and so on ...      rptData.Add(pickingNoteData); } 

    The class is then put inside an ArrayList. Each element in the arraylist corresponds to one ‘row’ in the finished report.

    The first element in the list can also hold the report header data, and the last element in the list can hold the report footer data. And because this is an ArrayList, normal Array access can be used to get at them:

    ((CPickingNoteData)rptData[0]).header_date = DateTime.Now; ((CPickingNoteData)rptData[rptData.Count-1]).footer_serial = GenerateSerialNumber(); 

    Once you have an arraylist full of data, bind it to your report viewer like this, where ‘rptData’ is of type ‘ArrayList’

    ReportDocument reportDoc = new ReportDocument(); reportDoc.Load(reportPath); reportDoc.SetDataSource(rptData); crystalReportViewer.ReportSource = reportDoc; 

    Now you will need to bind your data class to the report itself. You do this inside the designer:

    1. Open the Field Explorer tab (which might be under the ‘View’ menu), and right-click ‘Database Fields’
    2. Click on ‘Project Data’
    3. Click on ‘.NET Objects’
    4. Scroll down the list to find your data class (if it isn’t there, compile your application)
    5. Press ‘>>’ and then OK
    6. You can now drag the class members onto the report and arrange them as you want.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Memory is VERY tight on Windows Mobile devices -- it… May 11, 2026 at 11:06 am
  • added an answer For winforms DataGridView, you can use the Column DefaultCellStyle.Format to… May 11, 2026 at 11:06 am
  • added an answer From the MS knowledge base: Note that the max server… May 11, 2026 at 11:06 am

Related Questions

I need to create reports in a C# .NET Windows app. I've got an
I need to create a repeatable process for deploying SQL Server Reporting Services reports.
I need to find/create an application that will create employee web usage reports from
I can't create a NT account for everyone that need access to the reports.
I need to parse Visual Studio automatically generated XML documentation to create a report.
I'm using iReport and I need to create a sub-report using a XML DataSource
I have a third-party app that creates HTML-based reports that I need to display.
I need to create a historical timeline starting from 1600's to the present day.
I need to create an XML schema that looks something like this: <xs:element name=wrapperElement>
I need to create a linked server to a DB2 database on a mainframe.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.