I have a script that will generate a report from values in the fields highlighted in a browse:
when the same table is displayed as a imbedded browse on a form created on a set, the script does nothing, so I tried various attempts by coding
appendix = table.current(2) andappendix = table.current(3)
How do I make a table-pointer point to the second table in a set?Set definition:
+--->Base_details table
|
+--->Appendix_C table
| |
| +->Logging
| +->Radio_freqs
|
+--->Logging1 Table
|
+--->Logging2 Table
Code:
on error goto error_routine dim filelist as C = "" dim sqnlist as C = "" dim global varc_Country as c '======================================================== 'create sqnlist from table Appendix_c '======================================================== [B]appendix = table.current()[/B] ip = appendix.index_primary_get() idx = ip.name_get() query.filter = current_highlighted_records() query.order = "unique" qry1 = appendix.query_create() appendix.fetch_first() varC_Country = appendix.Country trace.writeln(varC_Country) WHILE .not. appendix.fetch_eof() IF ut(appendix.Sqn_logo) <> "" THEN sqnlist = sqnlist+crlf()+ut(appendix.Sqn_logo) END IF appendix.fetch_next() END WHILE qry1.drop() appendix.index_primary_put(idx) '======================================================== 'create filelist '======================================================== sqnlist = remove_blank_lines(sqnlist) sqnlist = sortsubstr(sqnlist,crlf()) sqnlist = *remove_duplicatesi(sqnlist) FOR each tag in sqnlist filelist = filelist+crlf()+filefind.get_recurse("c:\my databases\bitmaps",tag-"*.bmp",file_find_normal+file_find_not_directory,"PN"+crlf()) next filelist = remove_blank_lines(filelist) filelist = sortsubstr(filelist,crlf()) filelist = *remove_duplicates(filelist) '======================================================== 'create bmp_temp '======================================================== bmp_temp = table.open("bmp_temp",FILE_RW_EXCLUSIVE) bmp_temp.zap(.t.) bmp_temp.populate_from_string("name",crlf(),filelist) bmp_temp.fetch_first() WHILE .not. bmp_temp.fetch_eof() name = ut(bmp_temp.name) img = name commit_flag = .t. bmp_temp.change_begin() bmp_temp.Country = varC_Country on error goto change_record_error_routine bmp_temp.Sbs_bitmap = image_filename_encode(img) bmp_temp.change_end(commit_flag) on error resume next bmp_temp.fetch_next() END WHILE bmp_temp.close() '======================================================== 'Preview bmp_temp report '======================================================== prompt_result = ui_get_print_or_preview("Preview ") IF prompt_result = "Print" THEN :Report.Print("graphics_report4") ELSE IF prompt_result = "Preview" THEN :Report.Preview("graphics_report4") END IF end error_routine: err_msg = error_text_get(error_code_get()) script = error_script_get() line = error_line_number_get() ui_msg_box("Error",err_msg+" error occured at line "+alltrim(str(line,4,0))+" in Script "+alltrim(script)) end change_record_error_routine: commit_flag = .f. resume next
appendix = table.current(2) andappendix = table.current(3)
How do I make a table-pointer point to the second table in a set?Set definition:
+--->Base_details table
|
+--->Appendix_C table
| |
| +->Logging
| +->Radio_freqs
|
+--->Logging1 Table
|
+--->Logging2 Table
Comment