Embed Image in report

nvermanverma Member Posts: 396
Is there any way of embedding an image in a report. Within the report there is an image (BLOB) and some texts.

I saved the report as an HTML using SAVEASHTML function and then I am reading the generated (HTML) file and sending the read information to the Body of an email. All the texts show up properly, however the image (i.e. company logo) is not displayed. All I see an a "Red X" for the image.

How can I embed that image in the body along with the text?

Comments

  • geordiegeordie Member Posts: 655
    Did you ensure to call CALCFIELDS to retrieve the data from the blob field?
  • nvermanverma Member Posts: 396
    Yup Yup.

    When I open the saved HTML file in internet explorer I can see the image. However, when that data is passed to the body of the email, it displays a Red X for the image.

    The reason my manager told me is because the image is not actually embeded in the report. In Order to display an image in an HMTL file, I have to give a location and name of the image(s) URL in the report and when outlook displays the data it will automatically fetch the image. However, the client does not want to upload those images anywhere. Thats why I wanted to know if there is a way to actually embed the image in the report or any other way around this situation.
  • geordiegeordie Member Posts: 655
    The only thing that comes to my mind is using an Image control instead of a PictureBox and set in Bitmap property the path of a bitmap accesseble from every client running the SAVEASHTML of this report :-k
  • vaprogvaprog Member Posts: 1,141
    It is technically possible to embed resources in a html-document, but NAV will not do this for you. You would need to find or write a tool for this yourself.

    But then, think about the format of your document. It is called Hypertext Markup Language, a text document hyperlinking to other resources by design. You should generate your report as PDF or XPS instead.

    If the report will be the body of your email, not an attachment, there are ways to link the image in the report to the image that is included into the mail as another part. Don't ask me how to do this in NAV, though.

    Yet another option with html is to bundle up the report and all referenced objects in some way, attach that bundle to the mail and instruct the recipient how he must reconstruct the file system structure so the user agent, displaying the html document find it's resources. This is often done using a zip-archive.

    But then PDF is so much easier to handle ...
  • DenSterDenSter Member Posts: 8,307
    Expandit has a tool to embed images in emails, check it out here. This is not an endorsement of the product, I've only seen a short demo years and years ago.
  • SavatageSavatage Member Posts: 7,142
    We just uploaded our logo to our ftp site.

    Then added code to the email that pulls the logo from internet using it's link.

    <img src="http://www.yourserver.com/email/images/logo.gif">.
Sign In or Register to comment.