Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: SetDataSource of Subreport within a Subreport Post Reply Post New Topic
Author Message
Shaft
Newbie
Newbie


Joined: 27 Jul 2007
Online Status: Offline
Posts: 2
Quote Shaft Replybullet Topic: SetDataSource of Subreport within a Subreport
    Posted: 27 Jul 2007 at 4:58am

Hi All,

I hope somebody can help me with this issue I'm trying to set the datasource of a subreport within a subreport using a .net CrystalReportSource but I'm getting an error. Please see my code below the first line works for setting the subreport but not the subreport within the subreport.

        CP12SummarySource.ReportDocument.Subreports.Item("CP12Print.rpt").SetDataSource(ds)
        CP12SummarySource.ReportDocument.Subreports("CP12Print.rpt").Subreports.Item("CP12Print_Apps").SetDataSource(dsSub)

 The error I'm getting on the second line is 'Not supported within subreports', if this is not supported how would I set the datasource?

Any help would be much appreciated :-)

Thank U

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 27 Jul 2007 at 9:05am
Isn't CP12Print.rpt a subreport? If so, the second line is trying to open a subreport of a subreport. This can't be done because subreports can't be nested more than one level deep.
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
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 16 Aug 2010 at 12:08pm
To set the datasource of your first subreport, use the following:

CP12SummarySource.Subreports[0].SetDataSource(ds);


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.031 seconds.