Click here to Skip to main content
14,304,263 members
Rate this:
Please Sign up or sign in to vote.
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,
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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 [^]
   
Comments
Amir Mahfoozi 29-Jan-12 8:03am
   
+5
Sourav Sarkar-SS 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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100