Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: DataSet in memory - how to pass to CR? Post Reply Post New Topic
Author Message
cull
Newbie
Newbie


Joined: 28 Mar 2008
Online Status: Offline
Posts: 6
Quote cull Replybullet Topic: DataSet in memory - how to pass to CR?
    Posted: 21 Apr 2008 at 6:57am
My .NET web app has a DataSet in memory. It includes several tables.
 
How can I hook Crystal Reports XI into this data?
Can it be done without writing the dataset to a physical file?
 
I know basically how to use the ReportDocument in .NET code. But I don't know the best way to pass a DataSet in memory to CR.
 
Much thanks
 
 
[Apologies if this causes a double-posting. My first post brought back an error.]
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 21 Apr 2008 at 2:36pm
I haven't worked with the web viewer, but in WinForms I add a property to the form with the viewer.  This property will contain the dataset I want to use for the report.
 
In the "Set" for the property, I set the report document's datasource to the dataset.
 
In C# the code to open the new for looks something like this:
ReportViewer viewer = new ReportViewer();
viewer.DataSrc = rptDS;
viewer.Show();
 
In the viewer form, the code looks like this:
private ReportDocument myReport;
public CrystalDocReportViewer(DataSet ds)
{
  InitializeComponent();
   rpt = new MyReport();
}
public DataSet DataSrc
{
  set
  {
    rpt.SetDataSource(value);
    viewer.ReportSource = rpt;
  }   
}

-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.