Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. Object oAKReport is a cDRReport
  2. Set psReportName to "ReportAkBon.dr"
  3.  
  4. Procedure ChangeODBCDataSource String sReportId
  5. String sConnectionString sDSN sSubReportId sConnect
  6. Integer iSubReports iSubReport
  7.  
  8. //Connection string
  9. //DRIVER=SQL Server;SERVER=adm-sql2005;Trusted_Connection=Yes;DATABASE=imb
  10. Clear BHWEBDR
  11. Move 'CONNECTIONSTRINGDRREPORT' to BHWEBDR.Z01
  12. Find eq BHWEBDR by Index.1
  13. If (Found) Begin
  14. Move (Trim(BHWEBDR.Z02)) to sConnect
  15. End
  16. Clear BHWEBDR
  17. Set psDatabaseConnection sReportId to sConnect
  18.  
  19. Get SubReportCount sReportId to iSubReports
  20. Decrement iSubReports
  21. For iSubReport from 0 to iSubReports
  22. Get SubReportId sReportId iSubReport to sSubReportId
  23. Send ChangeODBCDataSource sSubReportId
  24. Loop
  25. End_Procedure
  26.  
  27. Procedure OnPrintReport Handle ByRef hPrintDlg
  28. Forward Send OnPrintReport (&hPrintDlg)
  29. End_Procedure
  30.  
  31. Procedure OnInitializeReport
  32. String sReportId
  33.  
  34. Forward Send OnInitializeReport
  35. Get psReportId to sReportId
  36. Send ChangeODBCDataSource sReportId
  37.  
  38. Send setFilters
  39. End_Procedure
  40.  
  41.  
  42. Procedure setFilters
  43. String sReportID
  44. //Here you do the filters (for the moment it's hardcoded to test)
  45. Send AddFilter of oAKReport sReportID "{BESKO.Z3100A}" C_drEqual '1'
  46. Send AddFilter of oAKReport sReportID "{BESKO.Z3160}" C_drEqual 'DEQ'
  47. Send AddFilter of oAKReport sReportID "{BESKO.Z3102}" C_drEqual 208608585
  48. End_Procedure
  49.  
  50. Procedure RefreshReport
  51. String sReportId
  52. Get psReportId to sReportId
  53. If (sReportId <> '') Begin
  54. Send setFilters
  55. Forward Send RefreshRePort
  56. End
  57. End_Procedure
  58. End_Object
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement