All reports in the world are most complicated in China. Looking at the foreigners are very simple, only one line is almost a line. But the Chinese head is generally a few layers, giving you two layers, it is already a very good thing. In addition, the Chinese favorite is the active head, meaning this year, this year may become another format. So this also puts a challenge for programmers who write a header program. We also know that PowerBuildo's DataWindow has a powerful search function, and PowerBuilder is a database front-end development tool, but beginners believe that it can only be used as a static report, in fact it hides a bigger function, DataWindow can also make dynamics Report type. The following program is what I used to be used before doing the project. I hope to bring a prompt to string ls_part1, ls_aux1, ls_aux2, IS_TEMP, LS_SYNTAXULONG AI_X1 = 0, AI_X2 = 0, AI_Y1 = 0, AI_Y2 = 88, AI_Style = 0, ai_width = 0, ai_linecolor = 1, h_y1, h_y2ulong cil_posx, cil_width, temp_x, temp_y, temp_cilinteger char_w, i = 1, font = 19ulong f1 = 0, f2 = 0, f3 = 0, save_i1, save_i2ulong col_table_len = 0 , as_old1, as_old2, col_len2 = 0, col_len3 = 0string as_syntax, as_tableulong y0, y1, y2, y3, y4, id = 0string as_name, as_unit, as_columnstring as_head1, as_head2, as_head3, as_head4, as_head5, as_dateulong height
//r_w=margin.paper_size*1000/margin.font_size//CHAR_W =1500/Margin.font_size*10//CHAR_W =1500/100*10char_w=1Of_ProfileString_Margin()/Margin.top=250//margin.bottom= 250 // margin.right = 250 // margin.Left = 250 // Margin.Head = 4330 // Margin.Detail = 730 // Margin.footer = 100 // Margin.title = 2000 // Margin.Paper_Size = 35.4 //margin.font_size=30y0=margin.titley1=y0 (Margin.Head -y0) / 4Y2 = Y0 2 * (margin.head -y0) / 4y3 = Y0 3 * (margin.head -y0) / 4y4 = margin.head height = Y1 -Y0
AS_TABLE = 'Release 8; ~ R ~ N' & 'DataWindow (Units = 3 Timer_Interval = 0 color = 1073741824 processing = 0 print.margin.bottom =' string (margin.bottom) & 'print.margin.Left = ' string (margin.Left) ' print.margin.right = ' string (margin.right) ' print.margin.top = ' string (margin.top) &' print.preview.buttons = NO) Header (Height = ' string (margin.head) DETAIL (Height =' string (margin.detail) & ') Footer (Height =' string (margin.footer) TABLE ( ) 'do while table [i] .name <> "/ 0" as_name = table [i] .name as_unit = table [i] .unit cil_width = table [i] .len * char_w as_column = "column _" String ID) as_head1 = "h1 _" string (id) as_head2 = "h2 _" string (id) as_head3 = "h3 _" string (id) as_head4 = "h4 _" string (id) as_head5 = "h11 _" string ( ID) // ö »óðò» 2 μμ¿ ÆÄ¿ ͬ¬äûûûû ÆÄ¿ Çø · ö £ £¬õññ¶ô × öìåμμä ää »¯ óoü'óoã' | c c c" 1 "if Table [i] .unit =" "" = i f1 = 1 table [i] .x = col_table_len else temp_x = table [save_i1] .x temp_cil = col_table_len -table [save_i1] .x if table [save_i1] .len * char_w> = temp_cil then temp_cil = table [save_i1]. len * char_w col_table_len = table [save_i1] .x temp_cil end if ls_aux1 = uf_text ( "header", table [save_i1] .name, as_head1, temp_x, y0, height, temp_cil) as_syntax = ls_aux1 // μÚÒ »²ãÓëμÚ¶þ²ãÖ ® //4Ä ä¬¬ß a ai_x1 = TEMP_X AI_X2 =
col_table_len h_Y1 = y1 h_Y2 = y1 ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 AI_x1 = col_table_len AI_x2 = col_table_len h_Y1 = y0 h_Y2 = y4 ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 h_Y1 = 0 h_Y2 = margin.detail ls_aux1 = uf_lined (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 col_len2 = 0 save_i1 = I f1 = 1 table [i] .x = col_table_len end if else // ö »óðò» 2 μμ¿ ÆÄ¿ if f1 = 1 then temp_x = table [save_i1] .x temp_cil = col_table_len -table [save_i1] .x if table [save_i1] .len * char_w> = temp_cil then temp_cil = table [save_i1] .len * char_w col_table_len = table [ save_i1] .x temp_cil end if ls_aux1 = uf_text ( "header", table [save_i1] .name, as_head1, temp_x, y0, height, temp_cil) as_syntax = ls_aux1 // μÚÒ »²ãÓëμÚ¶þ²ãÖ®¼äμÄÁ¬Ïß AI_x1 = temp_x AI_x2 = col_table_len h_Y1 = y1 h_Y2 = y1 ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 f1 = 0 AI_x1 = col_table_len AI_x2 = col_table_len h_Y1 = y0 h_Y2 = y4 ls_aux1 = uf_lineh (ID, AI_X1, H_Y1, AI_X2, H_Y2, 0, 0, 1) AS_SYNTAX = LS_AUX1 h_y1 = 0 h_y2 = margin.detail ls_aux1 = uf_lined (ID, AI_X1, H_Y1, AI_X2, H_Y2, 0, 0, 1) as_syntax = LS_AUX1 END IF ID AS_TABLE = UF_TABLECOLUMN (as_table, as_column) ls_aux1 =
uf_detailcolumn (as_column, id, col_table_len, margin.detail / 4, margin.detail, cil_width, font) as_syntax = ls_aux1 temp_y = (y3 y0) / 2 ls_aux1 = uf_text ( "header", table [i] .name, as_head5 , col_table_len, temp_y, height, cil_width) as_syntax = ls_aux1 ls_aux1 = uf_text ( "header", table [i] .unit, as_head4, col_table_len, y3, height, cil_width) as_syntax = ls_aux1 col_table_len = cil_width AI_x1 = col_table_len AI_x2 = col_table_len h_Y1 = Y0 h_y2 = Y4 LS_AUX1 = UF_LINEHH (ID, AI_X1, H_Y1, AI_X2, H_Y2, 0, 1) AS_SYNTAX = LS_AUX1 H_Y1 = 0 h_y2 = margin.detail Ls_AUX1 = UF_LINED (ID, AI_X1, H_Y1, AI_X2, H_Y2, 0, 0, 1) As_SYNTAX = LS_AUX1 END IF CASE "2" if Table [i] .unit = "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" // Í¬Ê ± ° ÑÉÏ'μǼμÄμÚ¶þ²ã temp_x = table [save_i2] .x temp_cil = col_table_len -table [save_i2] .x if table [save_i2] .len * char_w> = temp_cil then temp_cil = table [save_i2]. Len * char_w color_table_len = Table [Save_i2] .x TEM p_cil end if ls_aux1 = uf_text ( "header", table [save_i2] .name, as_head2, temp_x, y1, height, temp_cil) as_syntax = ls_aux1 AI_x1 = col_table_len AI_x2 = col_table_len h_Y1 = y1 h_Y2 = y2 ls_aux1 = uf_lineh (id, Ai_x1 , h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 // μÚ¶þ²ãÓëμÚÈý²ãÖ®¼äμÄÁ¬Ïß AI_x1 = temp_x AI_x2 = col_table_len h_Y1 = y2 h_Y2 = y2 ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y2 , 0, 0, 1) as_syntax = ls_aux1 col_len3 =
0 Save_i2 = I f2 = 1 Table [i] .x = color_table_len end if f3 = 1 else // ã» óðμúèý2 ã i = 1 TEMP_X = Table [Save_i2] .x Temp_cil = col_table_len -table [Save_i2] .x if table [save_i2] .len * char_w> = temp_cil then temp_cil = table [save_i2] .len * char_w col_table_len = table [save_i2] .x temp_cil end if ls_aux1 = uf_text ( "header", table [save_i2] .name, as_head2 , temp_x, y1, height, temp_cil) as_syntax = ls_aux1 AI_x1 = col_table_len AI_x2 = col_table_len h_Y1 = y1 h_Y2 = y2 ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 // μÚ ¶þ²ãÓëμÚÈý²ãÖ®¼äμÄÁ¬Ïß AI_x1 = temp_x AI_x2 = col_table_len h_Y1 = y2 h_Y2 = y2 ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 f2 = 0 end if id as_table = uf_tablecolumn (as_table, as_column) ls_aux1 = uf_detailcolumn (as_column, id, col_table_len, margin.detail / 4, margin.detail, cil_width, font) as_syntax = ls_aux1 temp_y = (y1 y2) / 2 ls_aux1 = uf_text ( "header", table [i] .name, as_head2, col_table_len, temp_y, height, cil_width) as_syntax = ls_aux1 ls_aux1 = uf_text ( "header", table [ i] .unit, as_head4, col_table_len, y3, height, cil_width) as_syntax = ls_aux1 AI_x1 = col_table_len AI_x2 = col_table_len h_Y1 = y1 h_Y2 = y4 ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 h_y1 = 0 h_y2 = margin.detail ls_aux1 =
uf_lined (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 col_table_len = cil_width end if case "3" id as_table = uf_tablecolumn (as_table, as_column) ls_aux1 = uf_detailcolumn (as_column, id, col_table_len , margin.detail / 4, margin.detail, cil_width, font) as_syntax = ls_aux1 ls_aux1 = uf_text ( "header", table [i] .name, as_head3, col_table_len, y2, height, cil_width) as_syntax = ls_aux1 ls_aux1 = uf_text ( "header", table [i] .unit, as_head4, col_table_len, y3, height, cil_width) as_syntax = ls_aux1 ai_x1 = col_table_len ai_x2 = color_table_len // ¿ Éäüôμúèý2ãöò »¿ ªª1/1/1 íó¹ááá þþþþ¶¿¿ ÆÄ¿ Òò'ëó| ¸ã' óy1-> y4 if f3 = 1 TEN H_Y1 = Y1 h_y2 = Y4 f3 = 0 else // ¿ Éäüôμúèý2ãöò »¿ ªª1/42 »ç¹¹á ¢ μäþ1/4¶¿ ÆÄ¿ Òò'ëó| ¸ã'1 = Y2 h_y2 = y4 end if ls_aux1 = uf_LINEH (ID, AI_X1, H_Y1, AI_X2, H_Y2, 0, 0, 1) AS_SYNTAX = LS_AUX1 H_Y1 = 0 h_y2 = margin.detail ls_aux1 = uf_lined (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 col_len3 = 1 col_table_len = cil_width end choose i loopif f1 = 1 thentemp_x = table [save_i1] .xtemp_cil = col_table_len -table [save_i1] .xif table [save_i1] .len * char_w> = temp_cil then temp_cil = table [save_i1] .len * char_w col_table_len = table [save_i1] .x temp_cilend ifls_aux1 = uf_text ( "header", table [save_i1]. name, as_head1, temp_x, y0, height, temp_cil) as_syntax = ls_aux1 id // μÚÒ »²ãÓëμÚ¶þ²ãÖ®¼äμÄÁ¬ÏßAI_x1 = temp_xAI_x2 = col_table_lenh_Y1 = y1h_Y2 = y1ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y2, 0, 0, 1) as_syntax =
ls_aux1end ifif f2 = 1 thentemp_x = table [save_i2] .xtemp_cil = col_table_len -table [save_i2] .xif table [save_i2] .len * char_w> = temp_cil then temp_cil = table [save_i2] .len * char_w col_table_len = table [save_i2] .x temp_cilend ifls_aux1 = uf_text ( "header", table [save_i2] .name, as_head1, temp_x, y1, height, temp_cil) as_syntax = ls_aux1 // μÚ¶þ²ãÓëμÚÈý²ãÖ®¼äμÄÁ¬ÏßAI_x1 = temp_xAI_x2 = col_table_lenh_Y1 = y2h_Y2 = y2ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y1,0,0,1) as_syntax = ls_aux1end if // ± í¸ñμÄ × î × ó¶ËμÄheaderÖ ± Ïßid AI_x1 = 0AI_x2 = 0h_Y1 = y0h_Y2 = y4ls_aux1 = uf_lineh ( ID, AI_X1, H_Y1, AI_X2, H_Y2, 0, 0, 1) AS_SYNTAX = LS_AUX1 // ó¸ ¸ñμμä × × ó¶ëμääet = 0AI_X2 = 0H_Y1 = 0 // h_y2 = margin.detail - 3ls_aux1 = uf_lined (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 // ± í¸ñμÄ × îÓÒ¶ËμÄheaderÖ ± Ïßid AI_x1 = col_table_lenAI_x2 = col_table_lenh_Y1 = y0h_Y2 = y4ls_aux1 = uf_lineh (id , Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = ls_aux1 // ± í¸ñμÄ × îÓÒ¶ËμÄdetailÖ ± Ïßid AI_x1 = col_table_lenAI_x2 = col_table_lenh_Y1 = 0 // h_Y2 = margin.detail -3ls_aux1 = uf_lined (ID, AI_X1, H_Y1, AI_ x2, h_y2,0,0,1) as_syntax = ls_aux1 // ± í¸ñμÄ × îÉ϶ËμÄheaderÖ ± Ïßid AI_x1 = 0AI_x2 = col_table_lenh_Y1 = y0h_Y2 = y0ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y2,0 , 0,1) as_syntax = ls_aux1 // ± í¸ñμÄμÚÈý²ãÓëμ ¥ Î »Ö®¼äμÄheaderÖ ± Ïßid h_Y1 = y3h_Y2 = y3ls_aux1 = uf_lineh (id, Ai_x1, h_y1, Ai_x2, h_y2,0,0,1) as_syntax = LS_AUX1
// ± ¸ ¸ññhheaderçøóöö × μ × 2¿ μä ± ïhH_Y1 = Y4 -50H_Y2 = Y4 -50LS_AUX1 = UF_LINEH (ID, AI_X1, H_Y1, AI_X2, H_Y2, 0, 0, 1) AS_SYNTAX = LS_AUX1
// ± ¸ ¸ñμäôdetailçøó × μ × 2¿ μä ± ± ßID h_y1 = margin.detail -50h_y2 = margin.detail -50ls_aux1 = uf_Lined (ID, AI_X1, H_Y1, AI_X2, H_Y2, 0, 0, 1) AS_SYNTAX = LS_AUX1 / * ID H_Y1 = margin.detail -10h_y2 = margin.detail -10ls_aux1 = uf_Lined (ID, AI_X1, 201) AI_X2, 20, 0, 1) as_syntax = ls_aux1 * /// òôâêç'|àí ± ¸¸μμ¼¼ âââ ° æä3ã1/4 ¡ ¢ ò31/2 å
// cil_width = len ( "Õã½Ê¡Å © ÌïË®Àûͳ¼Æ ± í") * char_wcil_width = col_table_lenls_aux1 = uf_title_text ( "header", title, (col_table_len -cil_width) / 2, y0 / 8, height, cil_width, -20, 2) as_syntax = ls_aux1string startday, deadday, startmonth, deadmonthif day (startdate) <10 then startday = "0" string (day (startdate)) else startday = string (day (startdate)) end ifif day (deadline) <10 Then deadday = "0" string (days (deadline) Else deadday = string (day (deadline)) endiff
if Month (StartDate) <10 Then StartMonth = "0" String (MonthDate) Else Startmonth = String (Month (StartDate) End If Month (deadline) <10 Then Deadmonth = "0" String (Month Deadline)) Else DeadMonth = String (Month (deadline)) endiff
As_date = string (Year (startdate)) "-" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " DEADMONTH "
cil_width = len (as_date) * char_Wcil_width = col_table_lenls_aux1 = uf_title_text ( "header", as_date, (col_table_len -cil_width) / 2, y0 / 2, height, cil_width, -12,2) as_syntax = ls_aux1
// ¸ ± ê ìâtemp_x = 10CHAR_W = 400cil_width = LEN ("îî ± μ ¥ ¥»: õõõ½¡¡¡ ") * char_wls_aux1 = uf_title_text (" header "," îî ± μ μ ¥ £ £ £ £ £ £ " TBDW, TEMP_X, y0 * 3/4, height, cil_width, -12,0) as_syntax = ls_aux1temp_x = cil_widthcil_width = len ( "ÖÆ ± í") * char_wls_aux1 = uf_title_text ( "header", "ÖÆ ± í £ º", temp_x, y0 * 3/4, HEIGHT, CIL_WIDTH, -12, 0) as_syntax = ls_aux1
Temp_x = CIL_WIDTHCIL_WIDTH = LEN ("") * char_wls_aux1 = uf_title_text ("Header", "11", TEMP_X, Y0 * 3/4, HEIGHT, CIL_WIDTH, -12, 0) AS_SYNTAX = LS_AUX1
Temp_x = CIL_WIDTHCIL_WIDTH = LEN ("ð £ ô") * char_wls_aux1 = uf_title_text ("Header", "ð £ o", TEMP_X, Y0 * 3/4, Height, Cil_Width, -12, 0) as_syntax = LS_AUX1
Temp_x = CIL_WIDTHCIL_WIDTH = LEN ("") * CHAR_WLS_AUX1 = UF_TITLE_TEXT ("Header", "12", TEMP_X, Y0 * 3/4, Height, Cil_Width, -12, 0) as_syntax = LS_AUX1
Temp_x = CIL_WIDTHCIL_WIDTH = LEN ("ç © · ¢") * char_wls_aux1 = uf_title_text ("HEADER", "ç © · ¢ £ o", TEMP_X, Y0 * 3/4, Height, Cil_Width, -12, 0) as_syntax = LS_AUX1
Temp_x = CIL_WIDTHCIL_WIDTH = LEN ("") * char_wls_aux1 = uf_title_text ("Header", "13", TEMP_X, Y0 * 3/4, HEIGHT, CIL_WIDTH, -12, 0) AS_SYNTAX = LS_AUX1
Temp_x = CIL_WIDTHCIL_WIDTH = LEN ("à ¸ä:") * char_wls_aux1 = uf_title_text ("Header", "à à¿¿", TEMP_X, Y0 * 3/4, Height, Cil_Width, -12, 0) As_syntax = LS_AUX1
Temp_x = CIL_WIDTHCIL_WIDTH = LEN ("oæ") * char_wls_aux1 = uf_title_text ("HEADER", LMS, TEMP_X, Y0 * 3/4, Height, Cil_Width, -12, 0) as_syntax = ls_aux1
temp_x = cil_widthcil_width = len ( "ÏîÄ¿'úÂë:") * char_wls_aux1 = uf_title_text ( "header", "ÏîÄ¿'úÂë", temp_x, y0 * 3/4, height, cil_width, -12,0) as_syntax = ls_aux1temp_x = CIL_WIDTHCIL_WIDTH = LEN ("oæ") * char_wls_aux1 = uf_title_text ("Header", XMDM, TEMP_X, Y0 * 3/4, Height, Cil_Width, -12, 0) as_syntax = ls_aux1
Temp_x = CIL_WIDTHCIL_WIDTH = LEN ("ïøêðê:") * CHAR_WLS_AUX1 = UF_TITLE_TEXT ("Header", "ïêðêý", TEMP_X, Y0 * 3/4, Height, Cil_Width, -12, 0) As_syntax = LS_AUX1
Temp_x = CIL_WIDTHCIL_WIDTH = LEN ("oæ") * char_wls_aux1 = uf_title_text ("Header", XSS, TEMP_X, Y0 * 3/4, Height, Cil_Width, -12, 0) as_syntax = ls_aux1
//ls_syntax=as_table as_syntax//IDW_Area.create (LS_SYNTAX )RETURN (LS_SYNTAX)