Click here to Skip to main content
15,879,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working with crystalReport. Where I want to display the records of a SQL Server based tables. I Design the CrystalReport but not able to design it exactly, how I want.
I Wrote the following code,
C#
SqlConnection con = new SqlConnection(Global.constr);
           con.Open();
           SqlDataAdapter da3 = new SqlDataAdapter("select * from ItemDetails", con);
           DataSet ds3 = new DataSet();
           da3.Fill(ds3, "ItemDetails");
           rptItemnList abc = new rptItemList();
           abc.SetDataSource(ds3.Tables[0]);
           crystalReportViewer1.ReportSource = abc;
           crystalReportViewer1.Refresh();


so, I am getting following output.
BrandName         ItemCode        Price        Stock
-------------------------------------------------------
aaaa              mmmm             77           200
aaaa              nnnn             12           354
aaaa              oooo             35           571
bbbb              iiii             14           34
bbbb              jjjj             71           157              


but I want my report to be look like:
BrandName         ItemCode        Price        Stock
-------------------------------------------------------           
aaaa
                  mmmm             77           200 
                  nnnn             12           354
                  oooo             35           571
                  ------------------------------------
                  total stock                   1125  

bbb               iiii             14           34
                  jjjj             71           157 
                 ------------------------------------
                  total stock                   191    

Please help me. I am not be able to decide the way.
Posted

1 solution

Simple task, listen. All you need to do is create group Creating a grouping report[^] & for group total you have to create Crystal Reports Summary Field [^]
 
Share this answer
 
Comments
Amir Mahfoozi 29-Jan-12 8:03am    
+5
[no name] 31-Jan-12 12:34pm    
+5
thatraja 31-Jan-12 12:57pm    
You welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900