Talk with the Author
 Crystal Reports Forum : General Information : Talk with the Author
Message Icon Topic: Subreport use in crystal report Post Reply Post New Topic
Author Message
itsmekitanjal
Newbie
Newbie


Joined: 20 May 2014
Location: India
Online Status: Offline
Posts: 1
Quote itsmekitanjal Replybullet Topic: Subreport use in crystal report
    Posted: 20 May 2014 at 4:38am
Hi All,
 
I have below table in MSAccess
 
ID Name Category
1 John ASE
2 Kev ASE
3 Paul ASE
4 Lina SSE
5 Hendry SSE
 
I need to display result in two tables in one Crystal Report
1) one table for names with Category "ASE"
2) Second table for names with Category "SSE"
 
I can't display both categories details in one table
 
Please suggest how I can do this. I am using C# as language to generate this crystal report
 
Here is the script , I am using
Collapse | Copy Code
//CrystalReport1 is main where I want to show subreport
//CrystalReport4 is subreport

CrystalReport1 ObjRpt;
 
CrystalReport4 ObjRpt1;
 
ObjRpt = new CrystalReport1();
 
ObjRpt1 = new CrystalReport4();
 
String StrQuery;
 
StrQuery="SELECT Id,Name,MemberRank FROM Members WHERE Cat=1";
 
OleDbDataAdapter adp = new OleDbDataAdapter(StrQuery.ToString(), ControlRules.ClsConnect.Conn);
 
                DataSet ds = new DataSet();
 
                int ctr = adp.Fill(ds);
 
                DataSet1 Ds = new DataSet1();
 
                adp.Fill(Ds, "Customer");
 
StrQuery="SELECT Id,Name,SubRank,Ratiopergrop,NHPL,((KLP_Num * 120) - 25) as "RHN_Number" FROM Members WHERE Cat=2";
 
               OleDbDataAdapter adp1 = new OleDbDataAdapter(result1.ToString(), ControlRules.ClsConnect.Conn);
 
                DataSet ds1 = new DataSet();
 
                int ctr1 = adp1.Fill(ds1);
 
                ds1.Tables[0].Rows.Add(0, "", 0, 0, 0, 0);
 
                DataSet6 Ds1 = new DataSet6();
 
                adp1.Fill(Ds1, "Customer1");
 
                ObjRpt1.SetDataSource(Ds1);
 
                ObjRpt.SetDataSource(Ds);
 
                ReportDocument crystalReport = new ReportDocument();
 
                ReportDocument crystalReport1 = new ReportDocument();
 
                crystalReport=ObjRpt;
 
                crystalReport1 = ObjRpt1;
 
crystalReportViewer1.ReportSource = ObjRpt;
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 May 2014 at 3:02am
Which version of Crystal and Visual Studio are you using?

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