[AccessD] Report Replacing Text with Image

John Bodin jbodin at sbor.com
Sun Mar 27 18:17:26 CDT 2016


Yeah, wasn't sure exactly what you were trying to do on the report layout, with wrapping text or not.

I am not familiar with the RTF structure and how the code looks when an image is linked or embedded in an RTF document.  I had thought you could do something as simple as a replace statement replacing {Image} with Link to C:\Foo\Foobar.Jpg.  Or even create a temporary table with some code before the report runs to put the contents of each record already merged into a field in that temp table and report off of that.  But looking at the structure of an RTF, I can see where and how to locate text {Image}, but no idea the code to replace it with the image.  Good luck.

John

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson
Sent: Sunday, March 27, 2016 6:46 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Report Replacing Text with Image

Hi Rocky and John,

John - Looked at Lebans site but I think this is more than needed (want to avoid installing extra files if possible) and I couldn't see a reference to Images being included in the text.

Rocky - Your solution may be able to be used.  Will experiment.

Thanks all

David

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Monday, 28 March 2016 11:24 a.m.
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Report Replacing Text with Image

David:

In the detail section of the report I would place two text boxes and the image - one text box above the image, one below.  Then, in the format event of the detail section of the report I would split the rtf text with the word [image] in it.  Using Instr, find the end of the first section of text put that in the text box above the image, and the second part of the rtf after [image] in the second text box.

Would that work?

Rocky Smolin
Beach Access Software
858-771-1869
www.bchacc.com
www.e-z-mrp.com
Skype: rocky.smolin
 


-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Bodin
Sent: Sunday, March 27, 2016 3:13 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Report Replacing Text with Image

Hi David,

I seem to remember Stephen Lebans had something that would allow you to do this but there was a limitation as to where the picture was to be placed (like text could not wrap around it or something like that.)  That would be old Code as he stopped doing Access a while ago.  I used it in an app some time ago (http://www.lebans.com/richtext.htm)

Had this in a .Net link that might give some insight into RTF fields (too much for me)

http://www.codeproject.com/Articles/4544/Insert-Plain-Text-and-Images-into-R
ichTextBox-at-R

Good luck,

John

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson
Sent: Sunday, March 27, 2016 5:31 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Report Replacing Text with Image

Hi Listers,

Access 2013, SQL 2012 BE.

I have a report with a subreport.  The subreport is a continuous report with a single field representing a paragraph of text.  The data is stored in Rich Text format.  In the middle of one of the paragraphs is the text "{Image}".
When the report is printed I want the text "{Image}" to be replaced with an actual image.  The image is the same for all reports.  However the location of the paragraph on the report is not fixed as it depends on what paragraphs are selected for the report.

Any suggestions how I can achieve this?

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list