PB line as much as the report title

A self think of a better way to add a title.
Grid suppose to add two headings: d_bt1, d_bt2. d_bt1 as headline, d_bt2 as subtitle, if the same plurality of subtitle added. Assuming that the data in the last column named n03.
First, add a title d_bt1 (Title)
1, put a Text (text box) forms the head of the object to DataWindow: pull down the header, the header portion and then moved down, and then put into a Text object header area.
2, on this Text Right-click to select Properties: ①General: set the title name in the name column: d_bt1; ②Font: Text Color-> Black, Background-> White; ③Position: x = 0, y = 0, Layer-> Foreground ; ④Expression: setting the width font.weight expression: long (describe ( 'n03.x' )) + long (describe ( 'n03.width')) + 10, wherein n03 is the last field name Detail section, 10 is added to cover the rightmost gridline. The title is set to center, the title will change along with changes in the size of table columns.
3, changing the position and width of Text and Text this content to the right of the report title, note the value of Position.Width and Height.
Second, add the title d_bt2 (subtitle)
1, a Text object to put the title d_bt1 DataWindow header.
2, on this Text Right-click to select Properties: ①General: set the title name in the name column: d_bt2; ②Font: Text Color-> Black, Background-> White; ③Position: x = 0, y = 200 (200 is d_bt1. the value Positon.Height), Layer-> Foreground, width value to a value of d_bt1.Position.Width; ④Expression: setting the width of the expression font.weight: long (describe ( 'n03.x' )) + long (describe ( 'n03.width') ) + 10, described supra.
Third, add a horizontal line
1, in the title DataWindow header d_bt2 delegated a mechanical Line (horizontal line) object.
2, the right click on this Line Select Properties: ①Position: x1 = 0, x2 = d_bt1.Position.Width, values y1 and y2 should d_bt2.Position.y + d_bt2.Position.Height, the value in the design slightly larger than this value, ease of design; ②Expression: x2 = long (describe ( 'n03.x')) + long (describe ( 'n03.width')) + 9, y1 (y2) = long (describe ( ' d_bt2.y ')) + long (describe (' d_bt2.height '))
IV dynamically modify the script in the title of the content
for the title may be present Chinese dw_1.modify ( "text_name.text =' title '" ) Dynamically modify the program, the variable header portion may also be used.
Fifth, how to modify the display order of the fields for the grid of the DataWindow?
In the data window drawing board, PB drag the column is not allowed to change the order of columns. skillIs in the preview, drag the column to the order you want to return to the drawing board, save it.
6, how to take the value of the DW Summary
IF dw_1.RowCount ()> 0 the then
em_1.text = String (dw_1.Object.hjhs [. 1])
the else
em_1.text = '0'
End IF

seven, how to display the value 0 blank
select the appropriate fields (numeric) on Detail, color fields in the attribute input Expressions (properties) is:
IF (field name = 0, rgb (255,255,255), rgb (0,0,0))

VIII. how to determine the plurality of rows selected
by isSelected ()
selection:
Long CurRow
Boolean Result
CurRow = dw_employee.GetRow ()
Result = dw_employee.IsSelected (CurRow)
the IF THEN Result
  dw_employee.SelectRow (CurRow, FALSE)
the ELSE
  dw_employee.SelectRow (CurRow, TRUE )
the END the IF
applications:
for CurRow to dw_1.rowcount. 1 = ()
  if dw_employee.IsSelected(CurRow) then
     ...
  end if
next

Guess you like

Origin www.cnblogs.com/Bokeyan/p/11775271.html