Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Visual-Studio Reports , +
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared; 
 

namespace Reports
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void btnSimpleReport_Click(object sender, EventArgs e)
        {
            NorthwindDataSet dts = new NorthwindDataSet();
            NorthwindDataSetTableAdapters.CustomersTableAdapter dta = new NorthwindDataSetTableAdapters.CustomersTableAdapter();
            dta.Fill(dts.Customers);
            RPTsimple report = new RPTsimple(); //create instance
            report.SetDataSource(dts);
            crystalReportViewer1.ReportSource = report; //Problem Line
        }
 
Why is ReportSource underlines in visual studio. Im using C# framework 3.5
look at //problem line
my error:
'Microsoft.Reporting.WinForms.ReportViewer' does not contain a definition for 'ReportSource' and no extension method 'ReportSource' accepting a first argument of type 'Microsoft.Reporting.WinForms.ReportViewer' could be found (are you missing a using directive or an assembly reference?)
Posted 29-Aug-12 1:06am
Edited 29-Aug-12 1:24am
v2
Comments
Dhinesh kumar.V at 29-Aug-12 7:41am
   
You will try to add some extra reference and use ReportDocument report =new ReportDocument() instead of your create instance line. Just try this one.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I think
    report.SetDataSource(dts);
this is the problem line.
    report.SetDataSource(dts.Tables[0]);
 
Try this.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
 
.....
...
 

crystalReportViewer1.ReportSource = report;
Why ... always => missing using direct ... reference..
problem with .ReportSource not definition...
?????
some body help me!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

I had a same problem. When i drag and drop CrystalReportViewer1 on my aspx page(not code behind file) instead of ReportViewer control from Reporting section of toolbox, there was no error that the
'Microsoft.Reporting.WinForms.ReportViewer' does not contain a definition for 'ReportSource' and no extension method 'ReportSource' accepting a first argument of type 'Microsoft.Reporting.WinForms.ReportViewer' could be found (are you missing a using directive or an assembly reference?)
Muhammad asif assiff79@gmail.com
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 329
1 Nirav Prabtani 274
2 OriginalGriff 239
3 _Amy 165
4 Richard MacCutchan 145
0 OriginalGriff 7,744
1 Sergey Alexandrovich Kryukov 6,956
2 Maciej Los 3,994
3 Peter Leow 3,708
4 CHill60 2,742


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 16 Jun 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100