Page 1 of 1

DCBROWSEHTML TO E-MAIL

Posted: Tue Mar 23, 2010 9:08 am
by pauldewet
I use DCBROWSE to create reports in table format with up to 7 columns and anything up to 200 records which I want to e-mail to clients. I save the browse to a html file which I then e-mail as an attachement. The html file looks clumsy when opened. Attaching a stylesheet does not work with e-mails. Would it be possible to imbed a style sheet in the html file to make its appearance more appealing?

Re: DCBROWSEHTML TO E-MAIL

Posted: Tue Mar 23, 2010 9:46 am
by rdonnay
You can embed a style sheet in your html the same way I do it in the Instant Messenger Client program.
The IMCLIENT.PRG uses the XbpHtmlViewer() control to display the IM window. I load a style sheet as part of the HTML loaded into the window.
This style sheet is \exp19\im\imclient\imclient.css.

This is the code in IMCLIENT.PRG:

Code: Select all

::conversationHeader := MemoRead(DC_Path(AppName(.t.)) + '\IMCLIENT.CSS')
You would code yours something like this:

Code: Select all

cHtml := MakeHtmlFromBrowse()
cStyle := MemoRead('mystyle.css')
cHtml := cStyle + cHtml
SendEmail( cHtml )

Re: DCBROWSEHTML TO E-MAIL

Posted: Wed Mar 24, 2010 12:51 am
by pauldewet
Thank you very much!