2016/2/25 Created.
2019/9/17 Updated.
In smaconne's Form Info, it is usually configured to allocate one field at a time, so the Notes form displayed with table will look like the following.

This section describes how to display this in the same way as Notes, with the following table

As you can see in the screen capture above, the Notes form has five
columns in one row: ride station/drop-off station, one-way trip cost,
one way/round trip, and memo.
The contents of each column are as follows.
Field Title
| Field Name | Type | Control |
---|
Ride Station/Drop-Off Station
| station01~station16 | Text
|
|
One-Way Trip Cost
| fee1~fee8
| Number
|
|
One Way/Round Trip
| return_sw1~return_sw8
| Radio button
| One Way|0 Round Trip|1
|
memo
| memo1~memo8
| Text |
|
In smaconne's Form Info, insert a field row anywhere, enter "Detail" as the label name, leave the field name blank, and set up the formula that generates HTML code to display the following table.
Note that the following sample code does not display the row where both the boarding and the alighting stations are not entered.
tmp_0 := {<table border="0" cellpadding="0" cellspacing="0"><tr><th>Ride Station</th><th>Drop-Off Station</th><th>One-Way Trip Cost</th><th>One Way/Round Trip</th><th>Memo</th></tr>};
tmp_9 :={</table>};
tmp := "";
@For(n := 1; n <= 8; n := n + 1;
tmpFrom := @If( n < 6; @GetField( "station0" + @Text( n * 2 - 1 ) ); @GetField( "station" + @Text( n * 2 - 1 ) ) );
tmpTo := @If( n < 5; @GetField( "station0" + @Text( n * 2 ) ); @GetField( "station" + @Text( n * 2 ) ) );
tmpFee := @GetField( "fee" + @Text( n ) );
tmpReturn := @GetField( "return_sw" + @Text( n ) );
tmpMemo := @GetField( "memo" + @Text( n ) );
@If( tmpFrom != "" & tmpTo != "";
tmp := tmp + {<tr>
<td style="background: #f0f0f0;">} + tmpFrom + {</td>
<td>} + tmpTo + {</td>
<td style="background: #f0f0f0;">} + @Text( tmpFee; "C,0" ) + {</td>
<td>} + @If( tmpFee = 0; ""; @If( tmpReturn = "0"; "One Way"; tmpReturn = "1"; "Round Trip"; "" ) ) + {</td>
<td style="background: #f0f0f0;">} + tmpMemo + {</td>
</tr>};
tmp := tmp
)
);
tmp_0 + tmp + tmp_9
If you save the smaconne App Configuration document and display with smaconne, it will be displayed in a table as shown in the following image.
Related Pages:
