虽然方法掌握了,先把大量待绘制曲线的XY坐标点存储到DataTable中,然后在在报表中给chart中的Series绑定DataTable中的字段,可是绘制17万个点还是报内存溢出,请问这个问题没解决办法了吗?
SectionReport1 srp = new SectionReport1();
srp.Document.CacheToDisk = true;
srp.Document.CacheToDiskLocation = "c:\\Temp";
srp.chartControl1.DataSource = GetDataSource();
this.viewer1.LoadDocument(srp);
private DataTable GetDataSource()
{
DataTable dt = new DataTable();
dt.Columns.Add("ID");
dt.Columns.Add("A1");
dt.Columns.Add("B1");
dt.Columns.Add("C1");
dt.Columns.Add("T1");
try
{
float flowPos = 500;
float[] A1 = Commonfunc.GetdglChartSeriesArray(this.alyConf, this.dglData, (Byte)digital_ch_id.CONTACT_A1, 10, flowPos, true);
flowPos -= 20;
float[] B1 = Commonfunc.GetdglChartSeriesArray(this.alyConf, this.dglData, (Byte)digital_ch_id.CONTACT_B1, 10, flowPos, true);
flowPos -= 20;
float[] C1 = Commonfunc.GetdglChartSeriesArray(this.alyConf, this.dglData, (Byte)digital_ch_id.CONTACT_C1, 10, flowPos, true);
flowPos = 200;
double[] T1 = Commonfunc.GetaglChartSeriesArray(this.alyConf, this.algData[(Byte)analog_ch_id.SENSOR_1], (Byte)analog_ch_id.SENSOR_1, 12, flowPos);
for (int i = 0; i < this.alyConf.samplecount; i++)
{
dt.Rows.Add(((double)i / alyConf.samplerate * 1000).ToString("0.0"), A1, B1, C1, T1);
}
}
catch(Exception ex)
{}
return dt;
}
最后在报表中曲线绑定DataTable:
this.chartControl1.Series[0].ValueMemberX = "ID";
this.chartControl1.Series[0].ValueMembersY = "A1";
this.chartControl1.Series[1].ValueMembersY = "B1";
this.chartControl1.Series[2].ValueMembersY = "C1";
this.chartControl1.Series[3].ValueMembersY = "T1";
数据量小的时候,完美。数据量一大,还是内存溢出,崩溃。请问在ActiveReports中如何嵌入第三方控件,如何开发? |