Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Subreport link not wotking Post Reply Post New Topic
Author Message
blueHD
Newbie
Newbie


Joined: 17 Apr 2011
Location: Malaysia
Online Status: Offline
Posts: 1
Quote blueHD Replybullet Topic: Subreport link not wotking
    Posted: 24 Apr 2011 at 3:54pm
Hai there..i need help in creating my first crystal report..

I have this main report which need to used subreport.
I have successfully find a way to view the subreport, but unfortunately it views all the data in that table.

What i need is the subreport is able to view the record according to ID based on main report. Instead, it view all the record.

I already try to used change subreport link, but it doesn't work, it still load all the data.
I need to call ID in main report, so that i can view record that using the ID.

Here is the code that i used in calling the subreport:

I'm using C#;

private CTISReportTableAdapters.PTT_ANALYSIS_ATableAdapter dtAnalysisA;
report = new ReportDocument();
mydb = new CTISReport();

//MAIN REPORT
report.Load(Server.MapPath("PTT Preliminary Fault Reportx.rpt"));
        dtCTIS = new CTISReportTableAdapters.PTTPreliminaryReportTableAdapter();
        dtCTIS.Fill(mydb.PTTPreliminaryReport, dateStart, dateEnd);
        report.SetDataSource(mydb);

//SUBREPORT
dtAnalysisA = new CTISReportTableAdapters.PTT_ANALYSIS_ATableAdapter();
        dtAnalysisA.Fill(mydb.PTT_ANALYSIS_A);
        report.Subreports["PTT_Preliminary_AnalysisA.rpt"].SetDataSource(mydb);
CrystalReportViewer1.ReportSource = report;
        CrystalReportViewer1.DataBind();


Thanks in advance. Any idea and help would be much appreciate.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 26 Apr 2011 at 3:19am
does the subreport use a parameter to filter the data?  If it doesn't, nothing is going to work, as there is no filter in place.  That is what the link does, it fills in the parameter so that only the desired information is displayed.
 
Make sure that your subreport is functioning as desired for different parameter values on it's own.  Then join it as subreport and see if the link fails to filter.
 
HTH
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.