Crystal Rpts .NET 2003 - SetDataSource() and ReportSource unavaila

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here's a sample of my code for the web form that will display the report:

public class myClass: System.Web.UI.Page
{
protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;

private void Page_Load(object sender, System.EventArgs e)
{
myDataSet mds = new myDataSet();
myClass mc = new myClass();

... code to fill DataSet here ...

// mc.SetDataSource(mds);
// CrystalReportViewer1.ReportSource = mc;
}
}

The last two lines are commented out because SetDataSource() and
ReportSource is not recognized or available through IntelliSense.

Why would this be the case? Are they specific to VS.NET 2005 and 2003 uses
something different?
 
Just because something isn't available through Intellisense doesn't mean you
can't use it. That just means the compiler doesn't know about it at design
time.

Does MyClass inherit the ReportDocument object? If not, try that--this
should fix your problem. However, when you double-click to open MyClass.cs,
VS will throw an error about not being able to use the designer. To open
MyClass.cs, you should right-click and choose "View Code". This is VS being
too clever by half.
 
Thanks, Richard. I did what you suggested and I got SetDataSource(). However,
I am now getting this error:

'...OnInit(System.EventArgs)': no suitable method found to override

This would mean I should be inheriting from System.Web.UI.Page, but that
obviously won't give me what I need to work with. How do I manage this error?
 
OK, nevermind. I fixed that problem :)



ATroy said:
Thanks, Richard. I did what you suggested and I got SetDataSource(). However,
I am now getting this error:

'...OnInit(System.EventArgs)': no suitable method found to override

This would mean I should be inheriting from System.Web.UI.Page, but that
obviously won't give me what I need to work with. How do I manage this error?
 
Back
Top