Categories > TinyButStrong general >

Field data

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Jim
Date: 2003-09-16
Time: 13:20

Field data

Hi

All fields in my database have a space in the end.

Like
Prodnr '10101 '
Vernr '1 '

Complete prodnumber should always be prodnr+vernr
like 101011

If i use TBS then
it shows up as '10101 1 '

<?
include_once("tbs_class.php") ;
$cnx_id = odbc_connect('','','') ;
$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate("tbs_us_examples_dataodbc.htm") ;
$TBS->MergeBlock("blk1",$cnx_id,"SELECT PRODNR,VERNR FROM PRDATA WHERE STATUS='1'") ;
odbc_close($cnx_id) ;
$TBS->Show() ;

?>
[blk1.RU_PRODNR][blk1.VERNR] wil be 10101 1

Is there a change or something I can do in tbs_class so it wil be fixed?

Thanks Jim
By: Jim
Date: 2003-09-16
Time: 13:22

Re: Field data

I mean how can i easilly trim data without havign redundance of doing same thing in every form, like doing it on same place perferable changing inparam or chaning tbs_class
By: Skrol29
Date: 2003-09-16
Time: 13:26

Re: Field data

Hello Jim,

What ever the reporting tool, the best way to solve this is to make the query return the data the way you whant.

SELECT trim(PRODNR) as prodnr2,VERNR FROM PRDATA WHERE STATUS='1'

or

SELECT trim(PRODNR)+VERNR as prodid FROM PRDATA WHERE STATUS='1'
By: Skrol29
Date: 2003-09-16
Time: 13:32

Re: Field data

You can also wotk on data before to display them using the 'onformat' parameters.
'onformat' enables you to use a custom php function to read/write current info.

NB: because of a bug, you may not place the 'onformat' parameter in a TBS tag that is a data field with a 'block' paramater.
This will be solved in next version.
Sorry for that.
By: Jim
Date: 2003-09-16
Time: 13:46

Re: Field data

Thx, ill do that