条件查询数据窗口问题
string v_ym, v_retail_cat_id, v_sql, v_old_sql, v_bz, v_retail_cat_name,v_title,v_flag,v_retail_category_id,xianju
long title_width,columns
// Year & Month
if integer(em_statistics_month.text) > 9 then
v_ym = em_statistics_year.text + em_statistics_month.text
else
v_ym = em_statistics_year.text + "0" + em_statistics_month.text
end if
// Papers & Magazines
If rb_1.Checked Then
v_flag = '0' // papers
v_bz = '报纸'
End If
If rb_2.Checked Then
v_flag = '1' // magazines
v_bz = '杂志'
End If
If rb_3.Checked Then
v_retail_category_id='01'
v_bz='邮发'+v_bz
elseif rb_4.checked then
v_retail_category_id='03'
v_bz='代销'+v_bz
elseif rb_5.checked then
v_retail_category_id='02'
v_bz='特发'+v_bz
End If
v_title=v_ym+'月'+v_bz+'各单位每天到货款'
// Assing text content
dw_arrived_sheet_report.modify("title.text='"+v_title+"'")
select count(distinct order_date) into :columns FROM arrived_sheet
WHERE ARRIVED_SHEET.SHEET_MONTH = :v_ym AND
f_get_bkzl(bkdh,substr(period_number,1,4)) = :v_flag AND
arrived_sheet.amount <> 0 and retail_category_id=:v_retail_category_id;
title_width=long(dw_arrived_sheet_report.object.grand_sum_account.x)
title_width=title_width+long(dw_arrived_sheet_report.object.grand_sum_account.width)
title_width=title_width+(columns -1)*long(dw_arrived_sheet_report.object.account.width)
dw_arrived_sheet_report.object.title.width=title_width
dw_arrived_sheet_report.object.date.width=title_width
dw_arrived_sheet_report.object.grand_sum_account.width
dw_arrived_sheet_report.retrieve(v_ym,v_flag,v_retail_category_id)
dw_arrived_sheet_report.object.mfactaccount.visible=0
dw_arrived_sheet_report.object.magio.visible=0
*********************重点重点*重点重点重点重点重点重点**********************************************************************************
if rb_7.checked then
//--------------------------------------------------------------------------
// int li_col //显示所有的列名
// string ls_name
// for li_col = 1 to long(dw_arrived_sheet_report.object.datawindow.column.count)
// ls_name = dw_arrived_sheet_report.describe("#"+string(li_col)+".name")
// messagebox("column name",ls_name)
// next
//----------------------------------------------------------------------------
xianju='10'
dw_arrived_sheet_report.setfilter("company_company_category_id<>'"+xianju+"'")
dw_arrived_sheet_report.filter()
end if
if rb_8.checked then
xianju='10'
dw_arrived_sheet_report.setfilter("company_company_category_id='"+xianju+"'")
dw_arrived_sheet_report.filter()
end if
最后那处执行时,总是全部显示了所以数据,不能按company_company_category_id='"+xianju+"'来,并且报“Expression is not valid”,求指教