0
votes
***Process Date From:           
01/05/2012 0:00         
Group;Member        

 Status:****            
 Rcp Cd    Health Num        Rcp Name          Rcp Dob
1042231         1                  MARIA TOVAR DIAS 14-Feb-05
1042256         2                  KHALID KHAN      04-Mar-70
1042257         3                  SAMREEN ISMAT    25-Mar-80
1042257         5                  SAMREEN ISMAT    25-Mar-80
1042257         4                  SAMREEN ISMAT    25-Mar-80

I want my Powerbuilder datawindow Save As text look like this Bold text are the additional text want to add and rest is the current save as text result.

3
I cannot understand what your are trying to say. Try to improve your formulation by adding some punctuation. Also, I see not bold text in your question.Seki
the text between star is the additional text want to add in the save as text fileuser1788373
fyi - if you want to bold something in your question, you can use two asterick before and after the word for some reason you have three/four. Three is bold/italic. Or you may select a word or phrase and click the bold button. :)Rich Bianco

3 Answers

2
votes

Text files cannot contain formatting. There's no way to get bold text in a plain text file. I suggest adding the text to your datawindow header band (bolded, with an expression to make sure it only displays on the first page), then saving the results as HTML.

1
votes

Well, you didn't mention which version of PB you are using, so I'll assume a recent one in which case you have some better options such as SaveAsAscii and/or SaveAsFormattedText which offer more flexibility in displaying column headers, computed fields, etc.

If you want to add the top section, I would add one or more additional dummy columns (or computed fields) to your dataobject for the additional data. Then either populate the dummy columns manually after retrieve, or via expression in computed field. You could put all of it in one computed field that wraps, or use four different ones (e.g. process_date_label, process_datetime, group_status, status).

The two newer versions of SaveAs will work better for you as they display column header values instead of the column header name. SaveAsAscii came out pretty early somewhere around version 7 of PowerBuilder. SaveAsFormattedText is relatively new and came out somewhere around PB version 11 and it is a lot like SaveAsAscii but it lets you choose file encoding.

If you need more explicit detail let me know but I am sure you can get something to work using SaveAsAscii and extra columns.

0
votes

Pseudo code

Do the SaveAs to temp file
Open the temp file for read in line mode
Open output file for write (replace) in line mode 
Write your additional text lines to the output file (note: you can include CRLF to
write multiple lines at once)
Loop:
  Read line from temp file
  If EOF exit loop. Note: 0 is not EOF, -100 is EOF
  Write line to output file
Close temp file, output file
Delete temp file