Crystal Reports报告源问题 [英] Crystal Reports Report Source problem
本文介绍了Crystal 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
}
为什么ReportSource在visual studio中有下划线。我正在使用C#framework 3.5
查看//问题行
我的错误:
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?)
推荐答案
我认为
I think
report.SetDataSource(dts);
这是问题。
this is the problem line.
report.SetDataSource(dts.Tables[0]);
试试这个。
Try this.
使用CrystalDecisions.CrystalReports.Engine;
使用CrystalDecisions.Shared;
.....
...
crystalReportViewer1。 ReportSource =报告;
为什么......总是=>缺少使用直接...参考..
问题与.ReportSource无法定义...
?????
一些身体帮助我!
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!
我遇到了同样的问题。当我在我的aspx页面(不是代码隐藏文件)上拖放CrystalReportViewer而不是从工具箱的报告部分拖放ReportViewer控件时,没有错误
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
Muhammad asif assiff79@gmail.com
这篇关于Crystal Reports报告源问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文