f_xls_templates.srf 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. $PBExportHeader$f_xls_templates.srf
  2. global type f_xls_Templates from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_xls_templates (s_xls_msg arg_s_xls)
  6. end prototypes
  7. global function integer f_xls_templates (s_xls_msg arg_s_xls);Int rslt = 1
  8. IF arg_s_xls.obj_dwname = '' THEN
  9. rslt = 0
  10. GOTO ext
  11. END IF
  12. String arg_msg
  13. Long ll_xls_billid,ll_xls_templatesid
  14. ll_xls_billid = arg_s_xls.arg_billid
  15. ll_xls_templatesid = arg_s_xls.arg_templatesid
  16. uo_sendtoexcel uo_xls
  17. uo_xls = CREATE uo_sendtoexcel
  18. uo_xls.commit_transaction = sqlca
  19. datastore ds_xls
  20. ds_xls = CREATE datastore
  21. ds_xls.DataObject = arg_s_xls.obj_dwname
  22. ds_xls.SetTransObject( sqlca)
  23. CHOOSE CASE arg_s_xls.retr_pram_falg
  24. CASE 0 //
  25. ds_xls.Retrieve()
  26. CASE 1 //one string pram
  27. ds_xls.Retrieve(arg_s_xls.retr_pramstr)
  28. CASE 2 //one number pram
  29. ds_xls.Retrieve(arg_s_xls.retr_pramnmb)
  30. CASE 3 //one date pram
  31. ds_xls.Retrieve(arg_s_xls.retr_pramfd)
  32. CASE 4 //two date pram
  33. ds_xls.Retrieve(arg_s_xls.retr_pramfd,arg_s_xls.retr_pramed)
  34. CASE 5 //two number pram
  35. ds_xls.Retrieve(arg_s_xls.retr_pramnmb,arg_s_xls.retr_pramnmb2)
  36. CASE 6 //two datetime pram
  37. ds_xls.Retrieve(arg_s_xls.retr_pramfdt,arg_s_xls.retr_pramedt)
  38. CASE 11 //one number pram,one string pram
  39. ds_xls.Retrieve(arg_s_xls.retr_pramnmb,arg_s_xls.retr_pramstr)
  40. CASE 12 //two string pram
  41. ds_xls.Retrieve(arg_s_xls.retr_pramstr,arg_s_xls.retr_pramstr2)
  42. END CHOOSE
  43. //IF uo_xls.sendtoexcel(ll_xls_billid,ll_xls_templatesid,arg_s_xls.arg_allowwrite,ds_xls,arg_msg) = 0 THEN
  44. // MessageBox('系统提示',arg_msg)
  45. // rslt = 0
  46. // GOTO ext
  47. //END IF
  48. ext:
  49. RETURN rslt
  50. end function