Dealing with HTML Code in a memo field.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report I'm trying to create that gets it's data from an underlying
SQLServer Database. One of the fields I need to include on the report is a
memo field.(that's the data type Access is using when I link to the table)
The data in the field is formatted as HTML so that it displays with
formatting in the software product that owns the SQL server database. How can
I handle this in Access. I see only two options, neither of which I know how
to accomplish myself. One is to strip all the html code out of the memo field
and display the data as normal text with no formatting the second is to
somehow incorporate the HTML into my Access Report to maintain the formatting.

I know one of you geniuses has a solution to this so please accept my
sincere thanks in advance.

Quack!
 
Actually, I would take the value from the SQLServer database and write
it to a *.HTML file on a file server. Then I would use a hyperlink to
open your default webbrowser and display the text. Since every record in
the DB will have a unique key, the files would use a naming scheme such
as [memoText][recordNumber].HTML. Creating the HTML file is simply a
matter of creating a text file adding <HTML><HEAD><BODY> followed by the
value from the SQLServer field then adding </BODY></HEAD></HTML> and
saving the file. (Assuming the opening & closing tags don't already exist)

David H
 
Unfortunately there is currently no method to integrate and output HTML on
an Access report. If plain text is acceptable then you could load the HTML
string into the Web Browser control on say a hidden form, grab the Text only
prop of the HTML document object within the control, and copy that back to
an unbound TextBox control on your report. You would do this in the Format
event of the relevant section.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Once again... you guys (I'm a yankee so that really means guys and gals) are
life savers.

Thanks
--
Michal Joyce
Project Management IS Analyst
Aflac - Project Management Office


Stephen Lebans said:
Unfortunately there is currently no method to integrate and output HTML on
an Access report. If plain text is acceptable then you could load the HTML
string into the Web Browser control on say a hidden form, grab the Text only
prop of the HTML document object within the control, and copy that back to
an unbound TextBox control on your report. You would do this in the Format
event of the relevant section.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
This points out something I failed to mention in my previous post which is as
it turns out pertinent... The report I am generating is a sub report. I have
some straight project data that I am pulling as a report and then the sub
report containing the field that is stored as html. The data does contain all
the appropriate html tags. If I copy it into a txt file and then save it as
an html document it displays exactly as I would like to display it in my
report.

I thought I might just be able to output the whole report as html but even
then the tags show...

Sorry I didn't mention this before.
--
Michal Joyce
Project Management IS Analyst
Aflac - Project Management Office


David C. Holley said:
Actually, I would take the value from the SQLServer database and write
it to a *.HTML file on a file server. Then I would use a hyperlink to
open your default webbrowser and display the text. Since every record in
the DB will have a unique key, the files would use a naming scheme such
as [memoText][recordNumber].HTML. Creating the HTML file is simply a
matter of creating a text file adding <HTML><HEAD><BODY> followed by the
value from the SQLServer field then adding </BODY></HEAD></HTML> and
saving the file. (Assuming the opening & closing tags don't already exist)

David H
I have a report I'm trying to create that gets it's data from an underlying
SQLServer Database. One of the fields I need to include on the report is a
memo field.(that's the data type Access is using when I link to the table)
The data in the field is formatted as HTML so that it displays with
formatting in the software product that owns the SQL server database. How can
I handle this in Access. I see only two options, neither of which I know how
to accomplish myself. One is to strip all the html code out of the memo field
and display the data as normal text with no formatting the second is to
somehow incorporate the HTML into my Access Report to maintain the formatting.

I know one of you geniuses has a solution to this so please accept my
sincere thanks in advance.

Quack!
 
OK... I put a web browser control in a hidden form but can't find the
appropriate property of that control to dump the text into and I can't find
any documentation on the control either.

Any guidance?
--
Michal Joyce
Project Management IS Analyst
Aflac - Project Management Office


Stephen Lebans said:
Unfortunately there is currently no method to integrate and output HTML on
an Access report. If plain text is acceptable then you could load the HTML
string into the Web Browser control on say a hidden form, grab the Text only
prop of the HTML document object within the control, and copy that back to
an unbound TextBox control on your report. You would do this in the Format
event of the relevant section.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
To read/write the control with HTML see:
http://www.lebans.com/htmleditor.htm

I have not had to read the plain text component of Elelments on a Web page
in years. If you look at my sample MDB, bring up the Object browser window
and look at the Browser library. Find the HTML Document object. From here
you probably have to examine each relevant Element and see if a Text prop is
exposed. Perhaps a GoogleGroups search would yield some sample code.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
MJatAflac said:
OK... I put a web browser control in a hidden form but can't find the
appropriate property of that control to dump the text into and I can't
find
any documentation on the control either.

Any guidance?
 
Back
Top