{{getMsg('Help_YouAreHere')}}: {{page.title}} {{page.title}}

BytesFromFile

Reads a file from the specified path or URL and returns its binary data. This function may be very helpful to load images from a file or an URL. If you have create a formula with a return type of binary then you can drag and drop the formula in the report to show it as dynamic picture.

Usage:

BytesFromFile( String )

Parameters:

String An URL or a path to a file. The binary data of this file will be returned.

Returns:

Binary

Examples:

BytesFromFile("C:/test.jpg");	// Returns the image in c:/test.jpg as a byte array.
BytesFromFile("http://myserver.com/images/logo.gif")
// Returns the image which can be found at the URL http://myserver.com/images.logo.gif
// Relative path to the location of the report
BytesFromFile("./myimage.png")

// Absolute file path
BytesFromFile("/opt/var/images/myimage.png")

// URL
BytesFromFile("http://myserver.com/images/myimage.png")

The supported picture formats are:

  • Gif
  • Jpg, Jpeg
  • Png
  • Bmp
  • Wmf, Emf

See also: