Page 1 of 3

Convert a print to Rtf or doc

PostPosted: Wed Nov 29, 2023 12:59 pm
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!

Re: Convert a print to Rtf or doc

PostPosted: Wed Nov 29, 2023 4:49 pm
by karinha
richedit ?? no sirve?

Regards, saludos.

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 1:31 am
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 view
PRINT oPrn [PREVIEW] FILE "name.docx"

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 8:00 am
by Enrico Maria Giordano
Doing so, you get a Word document with images. Marco needs a Word document with text that can be selected.

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 8:09 am
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: )

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 8:17 am
by Otto
Hello Marco,

This is how we do it:
viewtopic.php?f=3&t=13495&p=69231&hilit=word+zip&sid=62c130be6eb450bc2a0aad7749c99f80#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.

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 9:11 am
by Enrico Maria Giordano
Otto wrote:Hello Marco,

This is how we do it:
viewtopic.php?f=3&t=13495&p=69231&hilit=word+zip&sid=62c130be6eb450bc2a0aad7749c99f80#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.

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 9:17 am
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

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 9:48 am
by Enrico Maria Giordano
And where do you get the XML file?

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 10:11 am
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.


Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 10:17 am
by Enrico Maria Giordano
Otto, you did not get the point.

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 10:28 am
by Otto
Enrico, Please describe again exactly what you want to do. I'm sure it can be solved.
Best regards,
Otto

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 10:34 am
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?

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 10:48 am
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

Re: Convert a print to Rtf or doc

PostPosted: Thu Nov 30, 2023 10:54 am
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