By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,139 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,139 IT Pros & Developers. It's quick & easy.

Seeking reliable Add-In or other solution to create RTF files from A97 & A2.0???

P: n/a
MLH
Anyone tried something reliable. Need to implement
sol'n to reliably create RTF's of Access reports readable
by WordPad.
Nov 12 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
"MLH" <CR**@NorthState.net> wrote in message
news:53********************************@4ax.com...
Anyone tried something reliable. Need to implement
sol'n to reliably create RTF's of Access reports readable
by WordPad.


It's not something I would want to do a lot of, but for a few reports I had where
even Snapshot Format was sometimes dropping data I used the File I/O commands to loop
through my query and write my own data and RTF tags to a file and then attach that
file to an Email. I had to find a copy of the RTF spec on the internet and also
experimented quite a bit with making simple RTF documents in WordPad and then
examining the tags in NotePad.

Each report was a bit of an undertaking, but the result was a fast and perfect RTF
document. Quite a bit smaller than the other formats as well. I found I could even
include embeded images with this method which was another bonus.
Nov 12 '05 #2

P: n/a
MLH
Sounds promising... would you be willing to share some of the
fruits of your labors. It seems as though it'll be quite a project.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxx
On Wed, 17 Sep 2003 12:50:32 -0500, "Rick Brandt" <RB*****@Hunter.Com>
wrote:
"MLH" <CR**@NorthState.net> wrote in message
news:53********************************@4ax.com.. .
Anyone tried something reliable. Need to implement
sol'n to reliably create RTF's of Access reports readable
by WordPad.


It's not something I would want to do a lot of, but for a few reports I had where
even Snapshot Format was sometimes dropping data I used the File I/O commands to loop
through my query and write my own data and RTF tags to a file and then attach that
file to an Email. I had to find a copy of the RTF spec on the internet and also
experimented quite a bit with making simple RTF documents in WordPad and then
examining the tags in NotePad.

Each report was a bit of an undertaking, but the result was a fast and perfect RTF
document. Quite a bit smaller than the other formats as well. I found I could even
include embeded images with this method which was another bonus.


Nov 12 '05 #3

P: n/a
"MLH" <CR**@NorthState.net> wrote in message
news:dd********************************@4ax.com...
Sounds promising... would you be willing to share some of the
fruits of your labors. It seems as though it'll be quite a project.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxx


It's more time-consuming than difficult. Start out with a routine that just writes
all of the data for your report to a standard text file. This will still involve
adding line returns and tab characters etc., to get a basic layout that looks like a
report rather than a table. Once you have that you modify the procedure to add an
RTF header tag at the top of the file. Mine looks like this...

{\rtf1\ansi
\paperh15840\paperw12240
\margl720\margr720\margt720\margb720\psz1

{\colortbl
\red0\green0\blue0;
\red255\green255\blue255;
\red255\green0\blue0;
\red0\green255\blue0;
\red0\green0\blue255;}

{\fonttbl
\f0\fcharset0\fnil Arial;
\f1\fcharset0\fnil Arial Narrow;}

Here is an example then of a Report Header...
{\pard\plain\qc\fs36\b\f0\cf0\cb1ENGINEERING DEVIATION {\par}}

If you paste the two strings above into a NotePad file and then open it with WordPad
you will see the header and how I have specified a font, font size, font color, and
made the paragraph centered. The building of the document just progresses from
there. Your original routine that created a simple text file just needs to have
appropriate RTF Tagging added in at the appropriate locations to produce the layout
and look desired.

You just want to take it a step at a time and verify after each change. One of the
hardest things is making sure that every opening brace "{" has a corresponding
closing brace "}" and at the proper location. Otherwise you get incorrect output (or
no output at all). Obviously some report designs would lend themselves to this
method easier than others.
Nov 12 '05 #4

P: n/a
> You just want to take it a step at a time and verify after each change. One of the
hardest things is making sure that every opening brace "{" has a corresponding
closing brace "}" and at the proper location. Otherwise you get incorrect output (or
no output at all). Obviously some report designs would lend themselves to this
method easier than others.


Of course, you could write a stupid function to count the open and
close braces and see if the count for the two match... Something
along the lines of
Function CountOccurrences(byval strSearchChar as string, byval strText
as string) As Long

dim lngPos as long 'position in string

for lngPos = 1 to len$(strText)
if mid$(strText,lngPos,1)=SearchChar then
CountOccurrences=CountOccurrences+1
end if
next lngPos

End Function

if CountOccurrences("{",strText)<>CountOccurrences("} ",strText) Then
Msgbox "Too many..."
else
Msgbox "Good to go"
End if
Nov 12 '05 #5

P: n/a
MLH
Great suggestions, guys. Thx a lot.
Nov 12 '05 #6

P: n/a
MLH
On Wed, 17 Sep 2003 12:50:32 -0500, "Rick Brandt" <RB*****@Hunter.Com>
wrote:
"MLH" <CR**@NorthState.net> wrote in message
news:53********************************@4ax.com.. .
Anyone tried something reliable. Need to implement
sol'n to reliably create RTF's of Access reports readable
by WordPad.


It's not something I would want to do a lot of, but for a few reports I had where
even Snapshot Format was sometimes dropping data I used the File I/O commands to loop
through my query and write my own data and RTF tags to a file and then attach that
file to an Email. I had to find a copy of the RTF spec on the internet and also
experimented quite a bit with making simple RTF documents in WordPad and then
examining the tags in NotePad.

Each report was a bit of an undertaking, but the result was a fast and perfect RTF
document. Quite a bit smaller than the other formats as well. I found I could even
include embeded images with this method which was another bonus.

I like the idea of embedding the images. That'll come in handy.
Nov 12 '05 #7

P: n/a
MLH <CR**@NorthState.net> wrote in message news:<53********************************@4ax.com>. ..
Anyone tried something reliable. Need to implement
sol'n to reliably create RTF's of Access reports readable
by WordPad.


MLH,

I don't have Access 2.0 around, but in my 97 and 2k-version the
rtf-export facility is available and seems to work when I test
something and open the results in Win 98 Wordpad. What is so
unreliable about it ?
I don't do this normally, but I think it would be a very useful option
for distributing reports.

Marc
Nov 12 '05 #8

P: n/a
"Marc" <M.***********@uva.nl> wrote in message
news:ae**************************@posting.google.c om...
MLH <CR**@NorthState.net> wrote in message

news:<53********************************@4ax.com>. ..
Anyone tried something reliable. Need to implement
sol'n to reliably create RTF's of Access reports readable
by WordPad.


MLH,

I don't have Access 2.0 around, but in my 97 and 2k-version the
rtf-export facility is available and seems to work when I test
something and open the results in Win 98 Wordpad. What is so
unreliable about it ?


Total loss of all graphical objects (not necessarily a big problem depending on the
report).

Imperfect implementation of tab positions.

The horizontal real estate requirements are not the same for phrases in the Access
Report versus the same phrases in Word. This leads to the following problems:

Following the same rules as word-wrap, words at the far right of controls can be
truncated. If even one letter won't fit, the entire word is dropped. Making all
controls wider than they need to be in Access "might" avoid this one.

Any control that has CanGrow enabled can experience truncation of entire lines.

Extra Line-Returns inserted into the content usually leaving just one or two words on
the previous line.

Troubleshooting these problems is complicated by the fact that the issues vary from
record to record, report to report, and might even be influenced by the default
printer driver being used by the person doing the export. I have definitely seen
cases where user A would produce an RTF report that looked ok, while user B's output
of the identical report would suffer loss of data.

AFAIK the only way to avoid the above problems is to use a mono-spaced font like
Courier. I can't even be positive about that as I never tested it thoroughly. The
main problem found in my investigation of this is that Word tends to use a slightly
narrower (or is it wider?) space character for a given font than the Access report.
Actual characters seem to be sized the same. I "assume" that this would not be the
case with a mono-spaced font which would then avoid the problem. Most users though
find mono-spaced fonts too unattractive to want to use them.

Nov 12 '05 #9

P: n/a
MLH
On Fri, 19 Sep 2003 07:54:21 -0500, "Rick Brandt" <RB*****@Hunter.Com>
wrote:
AFAIK

I concur totally. Personally, I get the dropped lines, as all my
controls are enabled for CS/CG.
Nov 12 '05 #10

P: n/a
Rick Brandt previously wrote:
Total loss of all graphical objects

I agree with your other problems but I don't really class this as a
'problem' given that one is exporting to a text format.

However, I do think it is very misleading for the uninformed user to be
presented with the 'Publish to Word' option which appears to offer full
export but doesn't because of the rtf limitations.

Regards

Peter Russell

Nov 12 '05 #11

P: n/a
"Peter Russell" <pr******@russellscott.co.uk> wrote in message
news:me**********************@russellscott.btinter net.com...
Rick Brandt previously wrote:
Total loss of all graphical objects

I agree with your other problems but I don't really class this as a
'problem' given that one is exporting to a text format.


Depends on your definition I guess. RTF is perfectly capable of handling graphical
objects. The Access export routine just doesn't support exporting them.
Nov 12 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.