All pastes #902305 Raw Edit

Etwas

public text v1 · immutable
·published 2008-02-13 10:49 UTC
rendered paste body
        private void SetNewData()
        {
            highValue *= 1.50;
            lowValue *= 0.50;
            double length = highValue - lowValue;
            double modulo = Math.Ceiling(length / 1000f);


            StringBuilder criteriaString = new StringBuilder();
            criteriaString.AppendFormat("[RecordHeader] = {0}", recordHeader.Oid);
            criteriaString.AppendFormat("   AND (");
            criteriaString.AppendFormat("       ([Oid] % {0} = 0 AND ([RecordSequence] > {1} AND [RecordSequence] < {2}))",
                        modulo, Convert.ToInt32(Math.Floor(lowValue)), Convert.ToInt32(Math.Ceiling(highValue)));
            criteriaString.AppendFormat("   OR");
            criteriaString.AppendFormat("   ([RecordSequence] = 0 OR [RecordSequence] = {0})", recordHeader.Records.Count - 1);
            criteriaString.AppendFormat(")");
            chartSource.CriteriaString = criteriaString.ToString();
            //chartSource.Reload();

        }