Jump to content

Export with Header and Footer


benk
 Share

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

Recommended Posts

Is there any way to export selected records, keeping the header and footer from appearing only where the should, at the first and end. The trick to all this is that I need the out put to be in something similar to .txt I am using FM 5.5

[ February 13, 2002, 05:17 PM: Message edited by: ben1777 ]

Link to comment
Share on other sites

When you export, you are spitting out raw data from the found set of records. Headers and Footers are layout stuff, not applicable to export.

If you want a "header" and "footer" (a better term might be preamble and postamble) you're best bet is to edit the exported text.

Or, make some arrangement where the first record in the found set contains the header data, and the last record contains the footer data. (The more I think about this suggstion the more difficult and complicated it becomes; but it is possible.)

I guess you might want to tell us WHY you want such a function, so we can suggest alternatives.

[ February 13, 2002, 06:01 PM: Message edited by: Vaughan ]

Link to comment
Share on other sites

Thanks for the reply, the goal of this database is to generate a PAP(Preauthorised Payment) file that can be transmitted to the bank. The problem is that the file that must be generated has to be space sensitive, making reproduction of a monthly file cumbersome as data changes frequently. I have been able to set up my records so that they work, now the hard part is the headers and footers. I have already tried the first/last record approach, but it is not dummy proof and as I won't be the end user, it worries me. Let me know if there is something you can think of. My initial feeling is that maybe through a related file, but I am not sure.

Link to comment
Share on other sites

Maybe copy the found set's data to the clipboard (using copy command, an old trick) then pasting the data into a global field. Make a caculation field that joins the header text (in a global field), record data, and footer text (in another global field).

Note that FMP can only work with a limited amount of data in text fields. I'm not sure of the text size limitation on global fields, nor on the clipboard. But it might work.

Link to comment
Share on other sites

  • 8 months later...

You would make ONE field of what you want to export. The beginning of the field should say If(Status(CurrentRecordNumber)=1,header here,"") and the end of the field should say If(Status(CurrentRecordNumber) = Status(CurrentFoundCount), footer here,""). This will put it all as one field and the header will only occur at the FIRST record and the footer will only populate on the last record. Just remember to add paragraph marks (returns) where you want them added.

GOOD LUCK!

Link to comment
Share on other sites

The most general way to generate an arbitrary text file is to create a FM database with one text field. Upon export, each record becomes one line of text with a carriage return. Scripting is used to "build" the report line by line (record by record). In this case the contents of the text field in the first record would be the first line of the header. Likewise, the contents of the last record would the the last line in the text file.

Sounds like a lot of fun, but it can create virtually any text only file.

-bd

Link to comment
Share on other sites

This topic is 6947 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
 Share

×
×
  • Create New...

Important Information

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