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

  • SEARCH
  • Home
  • 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 8846709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:04:26+00:00 2026-06-14T12:04:26+00:00

I designed a form and used the Bar Chart on my form to display

  • 0

I designed a form and used the Bar Chart on my form to display the number of students having a particular problem (e.g family problems) in a particular Program (Nursing) in a particular year (say 2009). I designed everything else to get the total from the Database and display it on a Bar Chart. I am able to achieved this on a Form, but I have to generate a report and display the same Bar Chart on a Report. My question is can I achieve this without connecting to the Database? If yes, then Awesome, but How?? Thanks in Advance.

The code below is the code for a Bar Chart for total number of Students with problems (Family problems, drug addict, etc) in a particular program for 3 years.

    public void calculateStatsFor3Years(int year1, int year2, int year3)
    {
         //count the number of students in with intervention in particular program in a year

        intervention.Classes.Programs objPrograms = new intervention.Classes.Programs();

        List<int> programCodeList = objPrograms.GetProgramCode();

        List<int> numStudentsYear1 = new List<int>();
        List<int> numStudentsYear2 = new List<int>();
        List<int> numStudentsYear3 = new List<int>();

        int temp1 = 0;
        int temp2 = 0;
        int temp3 = 0;

        for (int counter = 0; counter < programCodeList.Count; counter++)
        {

            temp1 = Convert.ToInt32(objControllerClass.get_students_intervention_particular_year_program(year1, programCodeList.ElementAt(counter)));

            numStudentsYear1.Add(temp1);

            temp2 = Convert.ToInt32(objControllerClass.get_students_intervention_particular_year_program(year2, programCodeList.ElementAt(counter)));

            numStudentsYear2.Add(temp2);

            temp3 = Convert.ToInt32(objControllerClass.get_students_intervention_particular_year_program(year3, programCodeList.ElementAt(counter)));

            numStudentsYear3.Add(temp3);

        }//for 

        int[] yValues0 = numStudentsYear1.ToArray();//2011-2012
        int[] yValues1 = numStudentsYear2.ToArray();//2010-2011
        int[] yValues2 = numStudentsYear3.ToArray();//2009-2010 


        string[] xNameSeries0 = { "Agent immobilier", "Mécanique du bâtiment", "Gestion des eaus ", "Soins infirmiers ", "Anglais ", "Comtabilité et gestion ", "Bureautique ", "Architecture et gestion de réseau ", "Programmeur web ", "Assurance de dommages ", "O'Bois ", "Éducation à l'enface ", "Francisation " };

        myBarChart.Series[0].Points.DataBindXY(xNameSeries0, yValues0);
        myBarChart.Series[1].Points.DataBindXY(xNameSeries0, yValues1);
        myBarChart.Series[2].Points.DataBindXY(xNameSeries0, yValues2);


        //legend text
        myBarChart.Series[0].LegendText = year1.ToString();
        myBarChart.Series[1].LegendText = year2.ToString();
        myBarChart.Series[2].LegendText = year3.ToString();

    }//calculateStatsFor3Years()

Here’s a screenshot of the horizontal graph that I need to display in Crystal Reports.

http://i1342.photobucket.com/albums/o765/CSharpJunior/C%20Sharp%20project/horizontalGraph.jpg

  • 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. Editorial Team
    Editorial Team
    2026-06-14T12:04:28+00:00Added an answer on June 14, 2026 at 12:04 pm

    This is possible. The best way is probably to use a dataset. I often refer people to: http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-without-database.htm

    using System;
    using System.Windows.Forms;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using System.Data;
    
    namespace WindowsApplication1
    {
        public partial class Form1 : Form
        {
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                DataSet1 ds = new DataSet1();
                DataTable t = ds.Tables.Add("Items");
                t.Columns.Add("id", Type.GetType("System.Int32"));
                t.Columns.Add("Item", Type.GetType("System.String"));
    
                DataRow r ;
                int i = 0;
                for (i = 0; i <= 9; i++)
                {
                    r = t.NewRow();
                    r["id"] = i;
                    r["Item"] = "Item" + i;
                    t.Rows.Add(r);
                }
    
                CrystalReport1 objRpt = new CrystalReport1();
                objRpt.SetDataSource(ds.Tables[1]);
                crystalReportViewer1.ReportSource = objRpt;
                crystalReportViewer1.Refresh(); 
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on python plugins.I designed my form using pyqt4 designer. I used
I have a strange problem. I have designed a windows form application in c#
http://www.thecommonwealthmembers.com/ I designed a website, and used jQuery and CSS on the contact form
I have an HTML document type which is designed to display a form pulling
I'm styling a form designed by a client with the following structure: <div class=formRow>
I have designed one sign-up form,in this form after getting all necessary values I
I just designed a simple For Loop using window form application. I would like
Hi I'm designed a web app to be used offline at my company. People
I've built a form using HTML and jQuery. The form is designed to generate
Originally my .xaml form used the following line to set the Designer's DataContext where

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.