Convert a print to Rtf or doc

User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Convert a print to Rtf or doc

Post by MarcoBoschi »

Hi to all
I have a print

PRINT oPrn NAME "My Print" PREVIEW

PAGE
WHILE !EOF()
some instruction like
Prn:Say( nRow, nCol , bla bla )

ENDPAGE
PAGE
ENDDO
ENDPAGE
ENDPRINT

I need some hints about the possibility to save the print into rtf for or doc You know for instance when you have a report in Access you see preview you can export in RTF. Simple but functional. Many thanks to all!
Marco Boschi
info@marcoboschi.it
User avatar
karinha
Posts: 7932
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Convert a print to Rtf or doc

Post by karinha »

richedit ?? no sirve?

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Convert a print to Rtf or doc

Post by nageswaragunupudi »

I need some hints about the possibility to save the print into rtf for or doc
You can save to MSWord doc.
In the preview click "W" button or Click SaveAs and then choose "Doc format". You will see the document in MSWord,
Then you many save as docx,doc or rtf from the Word application.

If you want to save as docx without seeing PREVIEW

Code: Select all | Expand

PRINT oPrn [PREVIEW] FILE "name.docx"
Regards

G. N. Rao.
Hyderabad, India
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Convert a print to Rtf or doc

Post by Enrico Maria Giordano »

Doing so, you get a Word document with images. Marco needs a Word document with text that can be selected.
User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: Convert a print to Rtf or doc

Post by MarcoBoschi »

EMG,
that's right I need an editable document, Thank you to have specified the question.
Thinking that the program creates an Rtf in a easy way maybe it's simple also for us (for you :lol: )
Marco Boschi
info@marcoboschi.it
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 22 times
Been thanked: 2 times
Contact:

Re: Convert a print to Rtf or doc

Post by Otto »

Hello Marco,

This is how we do it:
https://forums.fivetechsupport.com/view ... f80#p69231

A DOCX file is essentially a ZIP file, and inside it, there's an XML file which is, in practice, a pure text file.

Best regards,
Otto


*************
But if you need a modern reporting tool, then you should use HTML. Everything else currently has no future.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Convert a print to Rtf or doc

Post by Enrico Maria Giordano »

Otto wrote:Hello Marco,

This is how we do it:
https://forums.fivetechsupport.com/view ... f80#p69231

A DOCX file is essentially a ZIP file, and inside it, there's an XML file which is, in practice, a pure text file.
The problem is not just to produce a docx file but to save a print preview as editable Word file.
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 22 times
Been thanked: 2 times
Contact:

Re: Convert a print to Rtf or doc

Post by Otto »

Hi Enrico,

Have you read the link? As far as I remember, I explained everything there. The XML file inside the DOCX is for that.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 22 times
Been thanked: 2 times
Contact:

Re: Convert a print to Rtf or doc

Post by Otto »

DOCX-Format
The DOCX format is an XML-based file format for Word documents, used by Microsoft Word, especially since Word 2007. It replaces the older binary DOC format. DOCX files are actually ZIP archives containing multiple files and folders that collectively represent the entire document.

One key file within a DOCX archive is word/document.xml. This XML file contains the actual text of the document, along with information about its structure and formatting. The content of word/document.xml is written in a special markup language called WordprocessingML, designed for representing Word documents.

In word/document.xml, you will find:

Text Content: The actual text of the document, including paragraphs, headings, etc.

Formatting: Information about fonts, colors, alignment, paragraph formats, list formats, etc.

Structure: Tags defining the document's structure, such as section headings, footnotes, endnotes, margin notes, etc.

Elements like Tables and Images: References to other files in the DOCX archive that contain images, tables, and other non-text elements.

Special Tags: These are used to represent special features like tables of contents, hyperlinks, embedded objects, etc.

To view the contents of word/document.xml, you can open a DOCX file with an archiving program like WinRAR or 7-Zip, and then view the word/document.xml file with a text editor or an XML viewer. Knowledge of XML is helpful to understand the content and structure of this file.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 22 times
Been thanked: 2 times
Contact:

Re: Convert a print to Rtf or doc

Post by Otto »

Enrico, Please describe again exactly what you want to do. I'm sure it can be solved.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Convert a print to Rtf or doc

Post by Enrico Maria Giordano »

Ok. You have a normal FWH print preview. You can save the preview to Word but the result is not editable (it is a series of images). How to get an editable Word result instead?
User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: Convert a print to Rtf or doc

Post by MarcoBoschi »

Otto,
what can I do with the xml inside the word file?
In Access (microsoft) when yo have a preview of a report you can export as rtf
it's very very beautiful
Marco Boschi
info@marcoboschi.it
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 22 times
Been thanked: 2 times
Contact:

Re: Convert a print to Rtf or doc

Post by Otto »

Enrico,
You need to create a WORD document in parallel. The question then is whether you should use WORD as a preview.

If you want to convert a FW report, you must build the WORD document in any case.

However, by manipulating the document.xml, you can use WORD as a report generator. You create your report in WORD and insert your own placeholders. We use [NAME] [etc] which is only necessary once when creating the template.

When you then run a report, you replace the placeholders with the values.

But I can only recommend switching to HTML right away.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Post Reply