This was previously posted on Jan 19 by another user but there was no response:
“I have used SaveAsText with forms with previous versions. It’s no longer supported. What is the best solution to replace that can include headers, footers and calculations?”
I now find myself with the same dilemma. This information used to be saved as a simple text doc that could be imported to a website database. I can successfully print to .pdf and print to postscript from the print dialog and get the report formatted the way I want, but I don’t believe either can be imported to a database. Is there another way to massage either into a text document that can be importable?
Use filesave with arraybuild(. Here’s an example of exporting tab delimited data with a header and a footer.
filesave "~/Documents/somefile.txt",
"Name"+tab()+"Phone"+lf()+
arraybuild(lf(),"",{Name+tab()+Phone})+lf()+
"Exported on "+datepattern(today(),"Month ddnth, yyyy")
This approach wasn’t practical in Panorama 6 and earlier except for small databases. But Panorama X allows pretty much unlimited length output generated from a formula, so this will work for any database.
Will this work with information on summary tiles as well? The records are grouped, summarized and need to be exported with the info on a header tile, data tile and summary tile.
Yes, you just need to adjust the arraybuild( to your needs. If you look that up in Help you’ll see it optionally includes a query term. Which like the formula term in Jim’s example needs to be quoted, ie. surrounded in curly braces. To include only first level summary records you’d use {info(“summary”)=1} as your query. With creativity you can file save any data subset you want with fixed text before and/or after it.
I think it could be done. The tricky one would be to mimic a group header tile. Your formula needs to know that the record is the first record of a group. I would give the database an integer field, and sequence the field with a sequence "" command. The sequence starts over again with each new group.
This code has nothing to do with summary tiles, or any other kind of tile. The ability to export text thru a form no longer exists, and won’t exist.
However, you can adjust your formula to the same effect by using the info(“summary”) function. You would probably want to use it with the switch( or ?( functions. Here’s an example that you could use if your database has been grouped by month, also with a grand total.
Ok, it’s been awhile but the need to do this report was dropped. It’s now required again. I almost have this, however, I can’t get the group headers to work. Dave, when the records are grouped and I fill an integer field with sequence “”, the result is that all records are filled with 0. If I try “fill with formula” and use seq(), the records are number sequentially 1,2,3… The switch idea works great for the summary info, but the group header is only generated once for whatever record is highlighted when the report is run. This is an example:
Ok, I was using a fill on the integer field manually. If I tell the procedure to groupup on Name field, then go to the integer field and do sequence “”, it works. Now I just need to see if I can get it to integrate with the rest of the procedure. Thanks Dave.