Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I am looking for a cross platform way to export the name/address block from within a FMP table and import it into a Word template. I can see a way to do this in a Mac only environment using Applescript, but that won't help in a mixed environment. Is there a cross platform plugin that will help?

Posted

You could try creating an rtf format export file from Filemaker. The method is described in the Colombre and Price book.

Basically, you set up your "template" document in MSWord with dummy text. Let's call it "<<DummyText>>". Then save your word document in rtf format. Open that file in a simple text editor and copy all of the text from there into a global text field gRTFformatting in Filemaker. Create a calculated field cExportFormatted with this formula:

Substitute(gRTFformatting, "<<DummyText>>",MyDataField)

Then, export cExportFormatted as text.

Posted

I tried doing something very similiar. In fact pretty much the same thing. It didn't work well. I did an experiment of saving an RTF, doing a straight copy and best of plain text into a text field in FileMaker and then exporting the field and opening in word. I got style sheet after style sheet errors. It seemed that without line breaks or something the RTF export fails.

Posted

Thank you I'll take a look. The big problem it seems is getting FM to export the RTF with the correct carriage returns. It seems trivial, but has proved very difficult for me.

Posted

That is the beauty of this product.

The RTF is used, 'only' to create the style sheet.

To generate the word document it becomes the work of the export for the XML data and the XSLT to create the formatted word document.

Posted

It seemed that without line breaks or something the RTF export fails.

Actually, what has happened is that Word saved the template document with hard returns which is unnecessary. When Filemaker exported the formatted text, it converted the hard returns into vertical tab characters (which is what Filemaker always does with hard returns).

So, there is actually an extra step involved when you set this up. Before you paste the rtf formatting from the text editor into the global field, do a search and replace for the hard returns, replacing them with nothing. These are not a required part of the document anyway since "par" is used for paragraph markers. Then it should work okay.

Posted

I was able to format an export in RTF format from Filemaker with some success. Although it looks like exporting more than one record from a found set into a document may prove quite difficult, considering the nestedness of styles and carriage returns across multiple records. Maybe I don't know enough about RTF. Any case I'll take a look at this XML plug-in

Posted

I found exporting to RTF can produce excellent results, but you do have to watch out in your calculations. One surprise is that you can't break up your calculation with carriage returns -- the way you may be used to doing to make it easier to read -- unless you insert another ampersand and pair of quotes. E.g.

"<tag>

<tag>" won't work, but

"<tag>" &

"<tag>" is ok.

I also found it was worth experimenting to clean up the RTF Word generates on its own. You don't need half the crap that's in there (e.g. [color:"red"]R[color:"green"]G[color:"blue"]B colors), and it sure makes your code easier to read.

It's also not that hard to use multiple records, you can just loop through them and add them to your global field. However, with the amount of text it takes to generate RTF code, I found that my particular application would max out the character limit after about 80 records or so. I'm going to revisit it one of these days to try exporting the records in a more standard way, instead of just one massive global calc.

Posted

To export multiple records to an rtf file, I wouldn't try to dump it all into one global field, I would do the following:

1. Create a template drawing in your word processor, formatted as required. Assuming that your intended document will be one page per record, set up the document to be two pages long, each page identically formatted with a page break between, and showing sample data on each.

2. Save as rtf.

3. Open in a text editor and look at the rtf formatting. You need to break the rtf formatting into two (or maybe three) chunks. The first chunk will be the part from the beginning of the document to where the sample data starts. Call this the header chunk. The next part is the formatting that is between the two pieces of sample data. Call this the separator chunk. The final chunk is what follows the last sample data text. There may be nothing there. But if there is, call this the trailer chunk.

4. Paste these chunks of rtf into three globals, gHeader, gSeparator, and gTrailer.

5. Set up a calculated export field cExport with the formula:

Case(Status(CurrentRecord)=1,gHeader,"")

& MyDataField &

Case(Status(CurrentRecordNumber)=Status(CurrentFoundCount),gTrailer,gSeparator)

6. Export the cExport field as tab delimited.

If all goes well, you should end up with an rtf document with as many pages as you had records, each page containing the data for one record.

One final note. I'm still using WriteNow 4.0 which seems to save much cleaner and smaller rtf files than MSWord. Even if you are using MSWord as your main word processor you might want to use something else to create your original template document.

PS: If your export data contains hard returns, you might want to use the following for your cExport field formula to convert the hard returns to paragraph tags:

Case(Status(CurrentRecord)=1,gHeader,"")

& Substitute(MyDataField,"

This topic is 7945 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.