Click here to Skip to main content
16,021,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Actually, I am trying to display the data into a crystal report table and on graph. so please tell me if I have created one xyz.rpt file and create one table and graph structure inside this report. How to use these structures multiple times in my report. Suppose I have a student table and this table contains data of multiple class for example I have two classes data class 8 and class 9. In this situation all the data of the both class are displaying in a single table and single graph. but I am trying to display the class 8 data into a table after that my table terminates here and display graph for class 8 after that in second loop class 8 display in another table which comes after the first graph with the help of same table structure and then display the graph for this class.


What I have tried:

C#
<pre>Here is my code, Which display all data into single table and single graph..

  dtoverall = DbClass.getdata(CommandType.Text, "select vn.VelocityNormalX VNX,vn.VelocityNormalY VNY,vn.VelocityNormalZ VNZ,vn.Unit VNU, vn.SampleTimeVN VNT,an.AccelerationNormalX ANX,an.AccelerationNormalY ANY,an.AccelerationNormalZ ANZ,an.Unit ANU from vel_normal_overall vn left join acc_normal_overall an on vn.SampleTimeVN = an.SampleTimeAN where vn.SampleTimeVN between '" + SubTime + "' and '" + CurrTime + "' and vn.sensorid = '" + SensorNo + "'");
                            if (dtoverall.Rows.Count > 0)
                            {
                                foreach (DataRow drtime in dtoverall.Rows)
                                {
                                    convertedtime = timechange.IndianTime(Convert.ToString(drtime["VNT"]));
                                    string loc = FName + "/" + AName + "/" + TName + "/" + MName + "/" + PName;
                                    Overallall.Rows.Add(convertedtime, Convert.ToString(Math.Round(Convert.ToDouble(drtime["VNX"]),3))+Convert.ToString(drtime["VNU"]), Convert.ToString(Math.Round(Convert.ToDouble(drtime["VNY"]), 3)) + Convert.ToString(drtime["VNU"]), Convert.ToString(Math.Round(Convert.ToDouble(drtime["VNZ"]), 3)) + Convert.ToString(drtime["VNU"]), Convert.ToString(Math.Round(Convert.ToDouble(drtime["ANX"]), 3)) + Convert.ToString(drtime["ANU"]), Convert.ToString(Math.Round(Convert.ToDouble(drtime["ANX"]), 3)) + Convert.ToString(drtime["ANU"]), Convert.ToString(Math.Round(Convert.ToDouble(drtime["ANX"]), 3)) + Convert.ToString(drtime["ANU"]), loc);
                                }

}
crptall.Database.Tables["OverallForAll"].SetDataSource(Overallall);
                                CrysRptViewer.ReportSource = crptall;
                                CrysRptViewer.Refresh();
Posted
Updated 5-Jun-22 19:43pm
v2
Comments
[no name] 4-Jun-22 9:47am    
You run the report multiple times ... with a different query each time to limit the data selected based on what you want to see on the report. That's just the way it is. If you need to "chain" things, that's another matter (and more work).

1 solution

Group the report by {Class}. I do this by using the menu option of Insert, Group... or by using Report, Group Expert...

Then, place the chart in the Group Footer section.
 
Share this answer
 

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