説明
PDF テンプレートで設定した行番号とフォーム フィールド名の間に区切り文字を指定します。
戻り値の型
なし
構文
object.SetDBMultiRowSeparator MultiRowSeparator
SetDBMultiRowSeparator メソッドは次のパラメータから構成されています。
|
パラメータ |
値の型 |
説明 |
|
Object |
|
Toolkit オブジェクト |
|
MultiRowSeparator |
String |
PDF ファイルでフィールド名と行番号を区切る文字 |
備考
一対多 (1 : N) のクエリを実行するとき、Toolkit は PDF テンプレートに複数の行を格納できます。テンプレート内の行を指定するには Fieldname.1、Fieldname-1、Fieldname1 などの PDF フィールド名を使用できます。
たとえば、APTOOLKIT.SetDBMultiRowSeparator "" を呼び出して、フィールド名を次のように表示できます。
Qty1 Item1 Description1 Price1
Qty2 Item2 Description2 Price2
Qty3 Item3 Description3 Price3
また、APTOOLKIT.SetDBMultiRowSeparator "-" を呼び出して、フィールド名を次のように表示できます。
Qty-1 Item-1 Description-1 Price-1
Qty-2 Item-2 Description-2 Price-2
Qty-3 Item-3 Description-3 Price-3
例
strPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".") & "\"
Set TK = CreateObject("APToolkit.Object")
TK.FormNumbering = 1
r = TK.OpenOutputFile("Output.pdf") 'newly generated PDF
r = TK.SetDBInputTemplate("Input.pdf")
For i = 1 To 5 'copy 5 pages of input to output
SQL = "Select * From Properties"
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& strPath & "ias.mdb;Persist Security Info=False"
TK.SetMasterQuery strConn, "Admin", "", -1, "select *" & _
"From Properties where bag=2" 'must find a record
TK.SetDBMultiRowSeparator "-" 'provides the delimiter that separates _
the # in form field names for serparate records
TK.AddRelatedQuery strConn, "Admin", "", -1, SQL, True
'this method allows multiple records placement
r = TK.DBToForm(False)
'executes the form filling allowing more _
than one record per page (false)
TK.ResetFormFields
'resets the fields of the form
Next
TK.CloseOutputFile
Set TK = Nothing