Sometimes in crystal report while showing a bar chart if we want to show the sum or average of some values other than count, the chart expert may not show you all the summary option like average, sum, mode etc. Though the coding is correct and no error is displayed its just that the chart expert doesn't show the summary option other than count or distinct count. This is because the value for which you want to display average or sum is not of desired data-type, for example, if we want to display marks on the change of roll no. than marks should be of data-type like integer or double rather than choosing the data-type like string. So just check the data-type to get rid of this problem.
Happy coding :)
pls help me o solve this issue..I am not getting the solution with your answer..I will be thank full,
ReplyDeleteThis is reference bar charts crystal reports in this link,download db file and source code and concentrate on only bar charts
http://www.codeproject.com/Articles/166291/Generate-a-report-using-Crystal-Reports-in-Visual
see the code of binding data in simplereport.aspx.cs , getAllOrders is stored procedure and its query is select * from customer_Orders
first let us change the below lines in the code to get the data from query instead of getAllOrders stored procedure
cmd.CommandText = " select * from customer_Orders";
cmd.CommandType = CommandType.Text;
cmd.Connection = Con;
ds = new DataSet();
adapter = new SqlDataAdapter(cmd);
adapter.Fill(ds, "Users");
now u can see the bar charts same..no change at all right..
Now I want to pass order_Id and get the report for it..i.e on y-axis sum of Products_Qty for the order Id I passed,and On x-axis of course I want only this order_ID
But,when I change the query “Select * from Customer_Orders where Order_ID = “+Request.QueryString[“order_ID”]+”” and passing order_ID from query string..I am getting the count of Products_Qty not the sum on y-axis
Pls.pls do some thing to achieve the task..no problem if ur using aggreagate fn ,or whatever I want to get it sum of Products_Qty on y-axis by passing order_ID as query string
What do you want to show on bar chart?
ReplyDeleteMy solution was to simply change the datatype of the desired variable which you want to total.