我有一個報告,顯示測試的集合。測試報告實際上是另一個在收集報告中顯示爲子報告的xtrareport。在這些測試報告中可以有多個子測試和。對於每個子測試,都有一個在腳本中創建的圖表。 這是腳本來創建的子測試圖:顯示xtrareport報告與子報告與差異腳本和圖表detailreports腐敗圖表
private void xrChart1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
XRChart chrt = (XRChart)sender;
XYDiagram axis = (XYDiagram)chrt.Diagram;
if (chrt.Series.Count > 0)
{
while (chrt.Series[0].View is ScatterLineSeriesView)
{
chrt.Series.RemoveAt(0);
}
}
Series standardSeries = chrt.Series[0];
Series allBottleSeries = chrt.Series[1];
var curColVal = this.DetailReport1.GetCurrentColumnValue("ShowCurve");
if (curColVal == null)
{
return;
}
chrt.BeginInit();
chrt.Visible = (bool)curColVal;
if (chrt.Visible)
{
List<TSegment> segments = (List<TSegment>)this.DetailReport1.GetCurrentColumnValue("Segments");
if (segments != null)
{
foreach (TSegment segment in segments)
{
Series tempSeries = new Series();
ScatterLineSeriesView tempscatterLineSeriesView = new ScatterLineSeriesView();
tempscatterLineSeriesView.LineMarkerOptions.BorderVisible = false;
tempscatterLineSeriesView.MarkerVisibility = DefaultBoolean.False;
tempscatterLineSeriesView.LineStyle.Thickness = segment.Thickness;
tempscatterLineSeriesView.Color = segment.SegmentColor;
tempSeries.LabelsVisibility = DefaultBoolean.False;
tempSeries.View = tempscatterLineSeriesView;
tempSeries.ShowInLegend = false;
tempSeries.ArgumentDataMember = "X";
tempSeries.ArgumentScaleType = ScaleType.Numerical;
tempSeries.ValueDataMembersSerializable = "Y";
tempSeries.DataSource = segment.Points;
chrt.Series.Insert(0, tempSeries);
}
}
standardSeries.ValueDataMembers[0] = "ODValue";
standardSeries.ArgumentDataMember = "ConcentrationValue";
standardSeries.DataSource = this.DetailReport1.GetCurrentColumnValue("Standards");
allBottleSeries.ValueDataMembers[0] = "Y";
allBottleSeries.ArgumentDataMember = "X";
allBottleSeries.DataSource = this.DetailReport1.GetCurrentColumnValue("BottlePoints");
axis.AxisX.Logarithmic = (bool)this.DetailReport1.GetCurrentColumnValue("XPlotIsLog");
axis.AxisX.LogarithmicBase = (double)this.DetailReport1.GetCurrentColumnValue("LogarithmicBase");
axis.AxisX.Title.Text = (string)this.DetailReport1.GetCurrentColumnValue("UnitsOfConcentration");
axis.AxisX.Label.NumericOptions.Format = NumericFormat.Number;
axis.AxisX.Label.NumericOptions.Precision = (int)this.DetailReport1.GetCurrentColumnValue("NumberOfDigitsInResults");
axis.AxisY.Label.NumericOptions.Format = NumericFormat.Number;
axis.AxisY.Label.NumericOptions.Precision = (int)this.DetailReport1.GetCurrentColumnValue("NumberOfDigitsInMeasuredValues");
axis.AxisY.Logarithmic = (bool)this.DetailReport1.GetCurrentColumnValue("YPlotIsLog");
axis.AxisY.LogarithmicBase = axis.AxisX.LogarithmicBase;
axis.AxisY.Title.Text = (string)this.DetailReport1.GetCurrentColumnValue("UnitsOfStandardsInput");
axis.AxisY.WholeRange.AlwaysShowZeroLevel = !(bool)this.DetailReport1.GetCurrentColumnValue("ODAxisShouldNotStartAtZero");
}
chrt.EndInit();
}
現在,如果我看這個報表單獨的報告顯示正確。不同的分測驗有不同的圖表。
問題是當我顯示收集報告子報告顯示錯誤。所有圖表都沒有不同。最後一個子測試的圖表會一直顯示。
該腳本用來設置子報表的reportsource:
private void Detail1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
((XRSubreport)sender).ReportSource = this.DetailReport.GetCurrentRow() as XtraReport;
}
任何人這是怎麼回事任何想法?