ken bohnenkamp
4th December 2016, 20:08
I want to put a tab as a delimiter in my report layout. Normally I just put a pipe "|" as a delimiter but I have a special circumstance where I have to supply the report with a tab delimiter. I want to send this report to an ascii file that I will want to contain the tab delimiter with various other fields. I have tried defining a field using chr$(9) and including this field in the report layout but am not having much luck. Does anyone know of a way to create a tab delimiter in a baan report layout ?

bhushanchanda
5th December 2016, 09:54
You can declare a new variable and assign value like " " which is basically a tab. Now, use this variable as a delimiter in your report layout. That should do the trick. Other way is by using chr$(009) but not sure why its not working in your case. How are you using it? This (http://www.baanboard.com/baanboard/showthread.php?t=13793) is a similar thread.

ken bohnenkamp
5th December 2016, 14:11
Here is what I am doing


extern domain tccom.sepa hold.tab

hold.tab = chr$(9)

And then I am including hold.tab in my report layout.

oirfeodent
6th December 2016, 08:05
Here is what I am doing


extern domain tccom.sepa hold.tab

hold.tab = chr$(9)

And then I am including hold.tab in my report layout.

tccom.sepa should be a string domain, inorder to accomodate chr$(9).
I dont have the details, if it is a std domain... but, doesnt look like part of std.

shah_bs
10th December 2016, 01:59
The report writer system of BAAN will NOT output the TAB character. The TAB character will be converted into SPACE before output to ASCIF device.

One possible solution is to continue to use the PIPE character and then after saving the output to a file, to run another little script at the OS command prompt to REPLACE the PIPE with the TAB character. Not very clean but should be possible to automate somehow.

Assuming that this will be set up as a job that runs automatically, the first step in the job will be the session that is creating the output. The second step will be a shell script that can use the unix sed command to replace all PIPES by TAB.

ALTERNATIVELY, IF you have developers license, it would be possible to write a completely custom session that will output the file exactly as required, TAB as field delimiter. It will possibly run much faster too, since all the overheads of the report writer as not required.

ken bohnenkamp
10th December 2016, 17:54
Thanks, kind of thought that might be what was going on. Was wondering if I could put some kind of code in the report script like below. What do you think ?

detail.1:
before.layout:
do tab conversion here

shah_bs
12th December 2016, 05:47
I have not had any occasion to try that. My best guess is that the conversion happens 'late' in the processing of the report writer processing logic, so it will probably not matter how the TAB character is embedded, the later processing will convert it to space before handing over to the ASCII or ASCIF driver or even an actual printer.

günther
12th December 2016, 07:33
I also found out that TAB will be replaced by SPACES, we're on IVc4.

Regards
Günther

mark_h
12th December 2016, 14:23
Have you tried adding the tab to your fields? I know in my tag library for one of the tags I append "$I" to the end of each field. Let me see if I can print one to an ascii file and see what happens.

mark_h
12th December 2016, 14:56
LOL - it works but it is not a tab. I forgot the $I is picked up by the scan guns. And on top of that we no longer use those tabs. Well if you are any good with unix commands you can always run sed or something like that to switch |'s to tab's. Not really sure how that works. Just a thought.