Wednesday, February 3, 2016

C# Crystal Report Tutorial In Urdu - Basics (Create Crystal Report & use in your project)


Code here

using System;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;

namespace CrystalReportDemo1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            ShowReport();
        }

        private void ShowReport()
        {
            ReportDocument rdoc = new ReportDocument();

            //string appPath = Application.StartupPath;
            //string reportPath = @"Reports\Report.rpt";

            //string reportFullPath = Path.Combine(appPath, reportPath);


            // Or you can write the following code
            rdoc.Load(@"Reports\Report.rpt");

            crystalReportViewer1.ReportSource = rdoc;
        }
    }
}

7 comments:

  1. Assalamo O Alaikum
    How R U
    Thanks Sir Nice and logical tutorials

    Sarfaraz Ali Siddique

    ReplyDelete
  2. Sir where can i get those sample data in sql server ? so i can proceed in this tutorial..

    ReplyDelete
    Replies
    1. You can use any table or database for this.

      Delete
  3. Rdoc.Load(fullPath);
    In this line It Give Error
    'CrystalDecisions.Windows.Forms.ReportDocuments' does not contain a definition for 'Load' and no extension method 'Load' accepting a first argument of type 'CrystalDecisions.Windows.Forms.ReportDocuments' could be found (are you missing a using directive or an assembly reference?) C:\Users\ACS\documents\visual studio 2013\Projects\CrystalReportDemo\CrystalReportDemo\Form1.csCrystalReportDemo

    ReplyDelete
  4. Watch full video first then try. Don't try it, when you watching it.

    ReplyDelete