Well as if the subject made absolutely no sense.
I have a set wo.set
The parent is wo_header with a one to many child I need to pull a summary total from.
Using a operation as a guidance for the xbasic only allows me to pull data from the child because if I use the set as source I am not allowed to select any of the one to many tables.
If I select the one to many table as the source then I cannot use filters based on data in the parent.
So bottom line is I need to test 2 logical fields in the parent and then only pull summary totals from the child table if the parent logical are met.
What I have now works but pulls all summary data from the child. I need to only summarize records in the child where the logical field "Ordered" = .F. and the logical field "Invoice" = .T.
Report off the order_items.dbf looks like this.
I have a set wo.set
The parent is wo_header with a one to many child I need to pull a summary total from.
Using a operation as a guidance for the xbasic only allows me to pull data from the child because if I use the set as source I am not allowed to select any of the one to many tables.
If I select the one to many table as the source then I cannot use filters based on data in the parent.
So bottom line is I need to test 2 logical fields in the parent and then only pull summary totals from the child table if the parent logical are met.
What I have now works but pulls all summary data from the child. I need to only summarize records in the child where the logical field "Ordered" = .F. and the logical field "Invoice" = .T.
Code:
summarize_db_name = filename_decode("[PathAlias.ADB_Path]\order_items.DBF") tbl = table.open("wo_items")'this is a one to many child table in the wo.set ON ERROR GOTO ERROR0301201613210257 sum.db = summarize_db_name sum.db_dd_delete = .F. sum.result_overwrite = .T. sum.order = "STYLE+COLOR" sum.filter = "" sum.options = "I" sum.fields = 12 sum.field1 = "STYLE" sum.code1 = 0 sum.field2 = "COLOR" sum.code2 = 0 sum.field3 = "XS" sum.code3 = 1 sum.field4 = "S" sum.code4 = 1 sum.field5 = "M" sum.code5 = 1 sum.field6 = "L" sum.code6 = 1 sum.field7 = "XL" sum.code7 = 1 sum.field8 = "X2" sum.code8 = 1 sum.field9 = "X3" sum.code9 = 1 sum.field10 = "X4" sum.code10 = 1 sum.field11 = "X5" sum.code11 = 1 sum.field12 = "X6" sum.code12 = 1 tbl.summarize() GOTO CONTINUE0301201613210257 ERROR0301201613210257: ON ERROR GOTO 0 ui_msg_box("Error","Error running Summarize Operation"+crlf()+error_text_get()) END CONTINUE0301201613210257: tbl.close() 'Add the table just created by the Summarize operation to the Database.. file_add_to_db(summarize_db_name)

Comment