Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

SaveAs Function not working correctly

10 posts in DataWindow Last posting was on 2009-12-08 19:17:07.0Z
Sheldon Thompson Posted on 2009-12-04 05:25:42.0Z
Sender: 54e3.4b189b36.1804289383@sybase.com
From: Sheldon Thompson
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: SaveAs Function not working correctly
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4b189d56.5508.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 3 Dec 2009 21:25:42 -0800
X-Trace: forums-1-dub 1259904342 10.22.241.41 (3 Dec 2009 21:25:42 -0800)
X-Original-Trace: 3 Dec 2009 21:25:42 -0800, 10.22.241.41
Lines: 9
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90396
Article PK: 409997

I have a datawindow which I am using to create a TXT file
that will be used with our check printing software. I
created a datawindow that includes the table "Apcheck". When
I run the SaveAs function to a text file, the columns do not
consistently fall in the same position. If the column
position changes from row to row the check will not print
correctly. Is there any way to get each column to start in
the same position or is this impossible? Any help would be
appreciated.


Ivaylo Ivanov Posted on 2009-12-04 07:40:12.0Z
From: "Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4b189d56.5508.1681692777@sybase.com>
Subject: Re: SaveAs Function not working correctly
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b18bcdc@forums-1-dub>
Date: 3 Dec 2009 23:40:12 -0800
X-Trace: forums-1-dub 1259912412 10.22.241.152 (3 Dec 2009 23:40:12 -0800)
X-Original-Trace: 3 Dec 2009 23:40:12 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90397
Article PK: 409998

The SaveAs() function with Text! parameter would create a text file with
rows consisting of all the DW columns' data in order they're stated in the
Column Specification (= your SQL Select query) separated by <Tab> character
(Ascii = 9) and return at the end of each row. Note that none of your visual
changes (eg. swapping columns, changing their style, adding computed fields,
dropdowns etc.) would be exported at all with this function.

So the position of each column on each row, measured as number of characters
may vary, but you know the exact number of <Tab> characters before the
column.

If you need a more precise control on the separator between columns and
rows, on quotation of the strings... and to have your visual modifications
saved, you might find SaveAsAscii or SaveAsFormattedText more useful.

Otherwise, if you're speaking of fixed column lengths, you might want to
modify your SQL Select to add some padding functions on the columns (or by
using SaveAsAscii/SaveAsFormattedText - to modify columns' Display Format
somehow).

Finally, you didn't mention how do you print this text file. Opening the
file contents and importing it in a control which supports adjustment of
tab-stop positions to make this indentation automatically for you is another
thing (for example, refer to TabStop[] property of the MultiLineEdit
control).

Regards,
Ivaylo

<Sheldon Thompson> wrote in message
news:4b189d56.5508.1681692777@sybase.com...
>I have a datawindow which I am using to create a TXT file
> that will be used with our check printing software. I
> created a datawindow that includes the table "Apcheck". When
> I run the SaveAs function to a text file, the columns do not
> consistently fall in the same position. If the column
> position changes from row to row the check will not print
> correctly. Is there any way to get each column to start in
> the same position or is this impossible? Any help would be
> appreciated.


Sheldon Thompson Posted on 2009-12-04 16:19:31.0Z
Sender: 465a.4b1800c0.1804289383@sybase.com
From: Sheldon Thompson
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: SaveAs Function not working correctly
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4b193693.6564.1681692777@sybase.com>
References: <4b18bcdc@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 4 Dec 2009 08:19:31 -0800
X-Trace: forums-1-dub 1259943571 10.22.241.41 (4 Dec 2009 08:19:31 -0800)
X-Original-Trace: 4 Dec 2009 08:19:31 -0800, 10.22.241.41
Lines: 54
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90399
Article PK: 410002


> The SaveAs() function with Text! parameter would create a
> text file with rows consisting of all the DW columns'
> data in order they're stated in the Column Specification
> (= your SQL Select query) separated by <Tab> character
> (Ascii = 9) and return at the end of each row. Note that
> none of your visual changes (eg. swapping columns,
> changing their style, adding computed fields, dropdowns
> etc.) would be exported at all with this function.
>
> So the position of each column on each row, measured as

I should point out that i am using PB6.5, but I have PB8(not
installed). The plan would be to have each column be a fixed
length. How do I go about implementing your idea of adding
some padding functions on the columns in my SQL Select. This
sounds like the best solution.
Thanks
> number of characters may vary, but you know the exact
> number of <Tab> characters before the column.
>
> If you need a more precise control on the separator
> between columns and rows, on quotation of the strings...
> and to have your visual modifications saved, you might
> find SaveAsAscii or SaveAsFormattedText more useful.
>
> Otherwise, if you're speaking of fixed column lengths, you
> might want to modify your SQL Select to add some padding
> functions on the columns (or by using
> SaveAsAscii/SaveAsFormattedText - to modify columns'
> Display Format somehow).
>
> Finally, you didn't mention how do you print this text
> file. Opening the file contents and importing it in a
> control which supports adjustment of tab-stop positions
> to make this indentation automatically for you is another
> thing (for example, refer to TabStop[] property of the
> MultiLineEdit control).
>
> Regards,
> Ivaylo
>
> <Sheldon Thompson> wrote in message
> news:4b189d56.5508.1681692777@sybase.com...
> >I have a datawindow which I am using to create a TXT
> > file that will be used with our check printing software.
> > I created a datawindow that includes the table
> > "Apcheck". When I run the SaveAs function to a text file
> > , the columns do not consistently fall in the same
> > position. If the column position changes from row to row
> > the check will not print correctly. Is there any way to
> > get each column to start in the same position or is this
> > impossible? Any help would be appreciated.
>
>


Ivaylo Ivanov Posted on 2009-12-04 16:23:31.0Z
From: "Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4b18bcdc@forums-1-dub> <4b193693.6564.1681692777@sybase.com>
Subject: Re: SaveAs Function not working correctly
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b193783$1@forums-1-dub>
Date: 4 Dec 2009 08:23:31 -0800
X-Trace: forums-1-dub 1259943811 10.22.241.152 (4 Dec 2009 08:23:31 -0800)
X-Original-Trace: 4 Dec 2009 08:23:31 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90400
Article PK: 410007

Uhhh, rather old version.

Just modify your Select statement to return not just the columns from your
"Apcheck" table, but computed columns calculating padded values. Check your
DBMS documentation for string manipulation functions and also check the DBMS
for data conversion functions (if your columns are not of character type).

Regards,
Ivaylo

<Sheldon Thompson> wrote in message
news:4b193693.6564.1681692777@sybase.com...
>> The SaveAs() function with Text! parameter would create a
>> text file with rows consisting of all the DW columns'
>> data in order they're stated in the Column Specification
>> (= your SQL Select query) separated by <Tab> character
>> (Ascii = 9) and return at the end of each row. Note that
>> none of your visual changes (eg. swapping columns,
>> changing their style, adding computed fields, dropdowns
>> etc.) would be exported at all with this function.
>>
>> So the position of each column on each row, measured as
>
> I should point out that i am using PB6.5, but I have PB8(not
> installed). The plan would be to have each column be a fixed
> length. How do I go about implementing your idea of adding
> some padding functions on the columns in my SQL Select. This
> sounds like the best solution.
> Thanks
>> number of characters may vary, but you know the exact
>> number of <Tab> characters before the column.
>>
>> If you need a more precise control on the separator
>> between columns and rows, on quotation of the strings...
>> and to have your visual modifications saved, you might
>> find SaveAsAscii or SaveAsFormattedText more useful.
>>
>> Otherwise, if you're speaking of fixed column lengths, you
>> might want to modify your SQL Select to add some padding
>> functions on the columns (or by using
>> SaveAsAscii/SaveAsFormattedText - to modify columns'
>> Display Format somehow).
>>
>> Finally, you didn't mention how do you print this text
>> file. Opening the file contents and importing it in a
>> control which supports adjustment of tab-stop positions
>> to make this indentation automatically for you is another
>> thing (for example, refer to TabStop[] property of the
>> MultiLineEdit control).
>>
>> Regards,
>> Ivaylo
>>
>> <Sheldon Thompson> wrote in message
>> news:4b189d56.5508.1681692777@sybase.com...
>> >I have a datawindow which I am using to create a TXT
>> > file that will be used with our check printing software.
>> > I created a datawindow that includes the table
>> > "Apcheck". When I run the SaveAs function to a text file
>> > , the columns do not consistently fall in the same
>> > position. If the column position changes from row to row
>> > the check will not print correctly. Is there any way to
>> > get each column to start in the same position or is this
>> > impossible? Any help would be appreciated.
>>
>>


Sheldon Thompson Posted on 2009-12-04 16:23:36.0Z
Sender: 465a.4b1800c0.1804289383@sybase.com
From: Sheldon Thompson
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: SaveAs Function not working correctly
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4b193788.658d.1681692777@sybase.com>
References: <4b18bcdc@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 4 Dec 2009 08:23:36 -0800
X-Trace: forums-1-dub 1259943816 10.22.241.41 (4 Dec 2009 08:23:36 -0800)
X-Original-Trace: 4 Dec 2009 08:23:36 -0800, 10.22.241.41
Lines: 55
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90401
Article PK: 410004

I should point out that i am using PB6.5, but I have PB8(not
installed). The plan would be to have each column be a fixed
length. How do I go about implementing your idea of adding
some padding functions on the columns in my SQL Select. This
sounds like the best solution.
Thanks

> The SaveAs() function with Text! parameter would create a
> text file with rows consisting of all the DW columns'
> data in order they're stated in the Column Specification
> (= your SQL Select query) separated by <Tab> character
> (Ascii = 9) and return at the end of each row. Note that
> none of your visual changes (eg. swapping columns,
> changing their style, adding computed fields, dropdowns
> etc.) would be exported at all with this function.
>
> So the position of each column on each row, measured as
> number of characters may vary, but you know the exact
> number of <Tab> characters before the column.
>
> If you need a more precise control on the separator
> between columns and rows, on quotation of the strings...
> and to have your visual modifications saved, you might
> find SaveAsAscii or SaveAsFormattedText more useful.
>
> Otherwise, if you're speaking of fixed column lengths, you
> might want to modify your SQL Select to add some padding
> functions on the columns (or by using
> SaveAsAscii/SaveAsFormattedText - to modify columns'
> Display Format somehow).
>
> Finally, you didn't mention how do you print this text
> file. Opening the file contents and importing it in a
> control which supports adjustment of tab-stop positions
> to make this indentation automatically for you is another
> thing (for example, refer to TabStop[] property of the
> MultiLineEdit control).
>
> Regards,
> Ivaylo
>
> <Sheldon Thompson> wrote in message
> news:4b189d56.5508.1681692777@sybase.com...
> >I have a datawindow which I am using to create a TXT
> > file that will be used with our check printing software.
> > I created a datawindow that includes the table
> > "Apcheck". When I run the SaveAs function to a text file
> > , the columns do not consistently fall in the same
> > position. If the column position changes from row to row
> > the check will not print correctly. Is there any way to
> > get each column to start in the same position or is this
> > impossible? Any help would be appreciated.
>
>