{{sidenavigation.sidenavigationExpandLabel}}
{{getMsg('Help_YouAreHere')}}: {{page.title}} {{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}} {{helpModel.downloadHelpPdfDataStatus}}

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 created 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.

To prevent security issues with uploaded report templates, this function is limited. A non-administrative user can use it only for:

  • valid report locations if enabled
  • if it comes from the file system, then it must be from the same directory or subdirectory as the report itself
  • both, rpt file and specified file need to use the same protocol (e.g. file protocol)

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("images/test.jpg");	// Returns the image in test.jpg relative to the report 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/reports/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:

i-net Clear Reports
This application uses cookies to allow login. By continuing to use this application, you agree to the use of cookies.


Help - BytesFromFile