Jump to content
Server Maintenance This Week. ×

Export Header/Detail Info in same file....


This topic is 8501 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi Guys,

I'm trying to write information to a single ACSII file. I would like the very first record to contain descriptive information about the file. i.e. external filename, number of detail records, totals, and possibly a transaction date. The detail records containing information found within a specific subset from the database. Is this possible?

Thanks

Link to comment
Share on other sites

I'm not aware of any direct way of doing this, but you can do it with a calculated field and a dummy header record. The header record is just another record but is sorted to the top of the set.

To make sure that this record is the first to export, create a field called 'Header'. Put some value in that field in the header record, and leave it blank in all others. Put Header at the top of your sort order and set it to sort in descending order.

Then you create a calculated field to export.

Eg, if you have the following fields that you want to export:

text1

text2

text3

numbr1

numbr2

numbr3

and your header information is in a global field called 'gHeaderInfo'

then your calculated field 'Export' would be:

Export =

Case(not(IsEmpty(Header)),gHeaderInfo,

1,

text1 & "," & text2 & "," & text3 & "," & NumToText(numbr1) & "," & NumToText(numbr2) & "," & NumToText(numbr3),

Kind of messy huh? tongue.gif

[This message has been edited by BobWeaver (edited January 12, 2001).]

Link to comment
Share on other sites

This topic is 8501 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.