Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Opening a subreport VS2008 C# Post Reply Post New Topic
Author Message
andrevh
Newbie
Newbie


Joined: 26 Aug 2010
Location: South Africa
Online Status: Offline
Posts: 1
Quote andrevh Replybullet Topic: Opening a subreport VS2008 C#
    Posted: 26 Aug 2010 at 5:00am
Hi
 
I have created a subreport in a main report and run it using.
1)  crep = new CrystalReport1();
2)  crep.Load();
3) crep.SetDataSource((System.Data.DataTable)dt); // Filled table
if I use
4)  crep3 = (CrystalReport3)crep.OpenSubreport("Subreport1")
   the function returns null.
I want to do a load and setdatasource on CRep3 afterwards.
 
Why would it return null and what can I do to get a valid object.?
 
 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 01 Sep 2010 at 8:55am
Here is a code snippet that I'm using in my current app:

AnimalReport.Subreports["AnimalDetails"].SetDataSource(AnimalDataView);

Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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.039 seconds.