Populate CSV database フォローする

0
Avatar
Boh B

Customer generates csv as below; seperated by comma. Would it be possible to populate the empty field (row 2-5) automatically with value in row 1?

ABC Corp,COMSAT MEDIA 37063,PC,USER1,11
,,,USER2,7
,,,USER3,3
,,,USER4,1
,,,USER5,1
DEF Ptd,DSTECH MYTI17-1832,FIREWALL,WALL01,1
,,,WALL02,2

2 コメント

1
Avatar
Gene Henson
モデレータ
コメントアクション Permalink

You can probably do this in VB Script and use a variable that will remember that last value that came from the database.

Basically, you can create a new text object with a data source of VB Script. 

The script should run on the "OnNewRecord" event. If the current record has data in "Field 1", then the variable will update to that. If the current record is blank, then the variable will use whatever the last value was. 

The script would basically look like this:

If (LEN(Field("test.test.Field 1")) > 0 ) Then
Value = Field("test.test.Field 1")
End If

You'd need to have a different object for each of the fields in the database that can be blank like that. There's probably a cleaner way to write the scripts up, that concept should work.

0
Avatar
Boh B
コメントアクション Permalink

Yes, that works if all records are selected for print. However if I select only the 1st and last record, the empty field of last data (supposingly DEF Ptd.) will follow data of 1st (ABC Corp).

ログインしてコメントを残してください。