老
老郭
Unregistered / Unconfirmed
GUEST, unregistred user!
根据query1的不同选择条件,dbchart的图形作相应的改变,比如 x轴可根据条件为客户名称和收缴人,y轴都为收缴金额总数,
case comboboxex1.ItemIndex of
0: sql:='select b.com_cus_name 客户名称,sum(b.com_area) 合计面积,sum(b.com_ought_mon) 总应收金额,sum(b.com_fact_mon) 总实收金额,sum(a.arr_mon) 总收缴款金额,count(a.arr_nbr) 总收缴次数 from ad_arr a,ad_compact b where b.com_nbr=a.arr_nbr and a.arr_date between '+'TO_DATE('''+FormatDateTime('yyyymmdd', DateTimePicker1.Date )+''',''yyyymmdd'')'+' and '+'TO_DATE('''+FormatDateTime('yyyymmdd', DateTimePicker2.Date )+''',''yyyymmdd'')'+' group by b.com_cus_name';
1: sql:='select arr_man 收缴人,sum(arr_mon) 总收缴金额,count(arr_man) 总收缴次数 from ad_arr where arr_date between '+'TO_DATE('''+FormatDateTime('yyyymmdd', DateTimePicker1.Date )+''',''yyyymmdd'')'+' and '+'TO_DATE('''+FormatDateTime('yyyymmdd', DateTimePicker2.Date )+''',''yyyymmdd'')'+' group by arr_man';
end;
with series1do
begin
DataSource:=query1;
XLabelsSource:=query1.Fields[0].FieldName;
case comboboxex1.ItemIndex of
0: YValues.ValueSource:=query1.Fields[4].FieldName;
1: YValues.ValueSource:=query1.Fields[1].FieldName;
end;
end;
为什么只能第一次选择,能显示出需要的图,而再选择条件时,就提示客户名称字段或收缴人字段找不到。比如第一次选择客户,显示后再选择收缴人时,就提示客户的字段找不到。
好像series的数据源没起作用一样,可我已经设置了!请高手们帮助一下,应该怎么让这个series也同时改变?
case comboboxex1.ItemIndex of
0: sql:='select b.com_cus_name 客户名称,sum(b.com_area) 合计面积,sum(b.com_ought_mon) 总应收金额,sum(b.com_fact_mon) 总实收金额,sum(a.arr_mon) 总收缴款金额,count(a.arr_nbr) 总收缴次数 from ad_arr a,ad_compact b where b.com_nbr=a.arr_nbr and a.arr_date between '+'TO_DATE('''+FormatDateTime('yyyymmdd', DateTimePicker1.Date )+''',''yyyymmdd'')'+' and '+'TO_DATE('''+FormatDateTime('yyyymmdd', DateTimePicker2.Date )+''',''yyyymmdd'')'+' group by b.com_cus_name';
1: sql:='select arr_man 收缴人,sum(arr_mon) 总收缴金额,count(arr_man) 总收缴次数 from ad_arr where arr_date between '+'TO_DATE('''+FormatDateTime('yyyymmdd', DateTimePicker1.Date )+''',''yyyymmdd'')'+' and '+'TO_DATE('''+FormatDateTime('yyyymmdd', DateTimePicker2.Date )+''',''yyyymmdd'')'+' group by arr_man';
end;
with series1do
begin
DataSource:=query1;
XLabelsSource:=query1.Fields[0].FieldName;
case comboboxex1.ItemIndex of
0: YValues.ValueSource:=query1.Fields[4].FieldName;
1: YValues.ValueSource:=query1.Fields[1].FieldName;
end;
end;
为什么只能第一次选择,能显示出需要的图,而再选择条件时,就提示客户名称字段或收缴人字段找不到。比如第一次选择客户,显示后再选择收缴人时,就提示客户的字段找不到。
好像series的数据源没起作用一样,可我已经设置了!请高手们帮助一下,应该怎么让这个series也同时改变?