 | | From: | Hugh | | Subject: | report layout over word docucment | | Date: | Thu, 30 Dec 2004 10:33:00 -0500 |
|
|
 | Not sure what to correctly call the ability referenced above, but an inexpensive form fill type program called Formdocs has an excellent implementation. To create the report load a MS word document on the screen and begin to place fields where needed. This program doesn't save the field data just prints the form after user tabs from field to field.
If something like this was implemented within dBase with the ability to link to data fields, you would put many form using bureaucrats in form producing heaven.
|
|
 | | From: | Michael Nuwer [dBVIPS] | | Subject: | Re: report layout over word docucment | | Date: | Thu, 30 Dec 2004 11:05:30 -0500 |
|
|
 | Hugh wrote: > Not sure what to correctly call the ability referenced above, but an inexpensive form fill type program called Formdocs has an excellent implementation. To create the report load a MS word document on the screen and begin to place fields where needed. This program doesn't save the field data just prints the form after user tabs from field to field. > > If something like this was implemented within dBase with the ability to link to data fields, you would put many form using bureaucrats in form producing heaven. >
The following is a small example of using Word form fields from dBASE:
// Create a new document for this demo if file( "C:\WordFieldsTest.doc" ) delete file "C:\WordFieldsTest.doc" endif oWord = new oleAutoclient("word.application") oWord.documents.add() oWord.Selection.TypeText( "The Top" ) oWord.Selection.TypeParagraph() oWord.Selection.TypeText( "Field1: Text1 " ) oRange = oWord.Selection.Range() #define wdFieldFormTextInput 70 oWord.Selection.FormFields.Add( oRange , wdFieldFormTextInput ) oWord.Selection.TypeParagraph() oWord.Selection.TypeText( "Field2: Text2 " ) oRange = oWord.Selection.Range() oWord.Selection.FormFields.Add( oRange , wdFieldFormTextInput ) #define wdAllowOnlyFormFields 2 oWord.ActiveDocument.protect( wdAllowOnlyFormFields ) oWord.ActiveDocument.saveAs("C:\WordFieldsTest.doc") oWord.quit()
// Fillin the form document oWord = new oleAutoclient("word.application") cFile = "C:\WordFieldsTest.doc" odoc = oWord.documents.open( cFile , false, false ) oWord.visible := true oWord.ActiveDocument.unprotect()
// Select form field by element number oWord.ActiveDocument.FormFields(1).select() // enter text into selected oWord.Selection.text = "Some Data"
// Select form field by name oWord.ActiveDocument.FormFields("Text2").select() oWord.Selection.text = "Some Data"
-- Michael Nuwer http://www.ChelseaData.ca/dLearn/ http://www.nuwermj.potsdam.edu/dSamples/
|
|
 | | From: | Hugh | | Subject: | Re: report layout over word docucment | | Date: | Thu, 30 Dec 2004 17:05:09 -0500 |
|
|
 | Thanks Michael for such a quick reply with code. I' ve seen some of the examples in dBullentin and they are very helpful, but I like your example even more because it's targeted to just what I need to do. The reason I placed my question in the wishlist section is that I would like to see all that coding (remember us government agencies can have forms with lots of small words and lots of fields to complete) replaced by the report (fill-in form) designer using a complicated existing word document and then use drop in fields from component tray.
|
|
 | | From: | Marty Kay | | Subject: | Re: report layout over word docucment | | Date: | Mon, 3 Jan 2005 12:30:17 -0500 |
|
|
 | Hugh,
> Thanks Michael for such a quick reply with code. I' ve seen some of the examples in dBullentin and they are very >helpful, but I like your example even more because it's targeted to just what I need to do. The reason I placed my >question in the wishlist section is that I would like to see all that coding (remember us government agencies can have >forms with lots of small words and lots of fields to complete) replaced by the report (fill-in form) designer using a >complicated existing word document and then use drop in fields from component tray.
Please tell me if this is correct:
You are wishing for the ability to insert field links from a table into a Word document (any other kinds?). Then when printed (from Word?) data would be inserted in place of the field links in the document.
This sounds alot like a mail merge function.
Thanks,
- Marty Kay (dBI) -
|
|
 | | From: | Hugh | | Subject: | Re: report layout over word docucment | | Date: | Tue, 04 Jan 2005 11:09:52 -0500 |
|
|
 | Marty,
That's exactly what it is, however I have yet to find anyone that will admit that they enjoy using mail merge (ms word) The software I eluded to earlier (and I'm trying to avoid plugging them too much) is called formdocs. You may want to take a look at their downloadable demo. What I think would be a great asset to dbase would be a similar form generating process using existing word documents and dropping in the fields, with the BIG difference being that these would be data linked fields to dbfs. (That other program has no build-in data linking methods) I know this is belaboring this simple point way to much, but I feel that if this feature were present in dbase it would fulfill a niche not completedly filled by anyone else.
Marty Kay Wrote:
> Hugh, > > > Thanks Michael for such a quick reply with code. I' ve seen some of the > examples in dBullentin and they are very >helpful, but I like your example > even more because it's targeted to just what I need to do. The reason I > placed my >question in the wishlist section is that I would like to see all > that coding (remember us government agencies can have >forms with lots of > small words and lots of fields to complete) replaced by the report (fill-in > form) designer using a >complicated existing word document and then use drop > in fields from component tray. > > Please tell me if this is correct: > > You are wishing for the ability to insert field links from a table into a > Word document (any other kinds?). > Then when printed (from Word?) data would be inserted in place of the field > links in the document. > > This sounds alot like a mail merge function. > > Thanks, > > - Marty Kay (dBI) - > >
|
|