Range to Bitmap
The Range to Bitmap function is used to export a range of cells to a bitmap image file (.bmp). The range can contain text, values, formatting, formulas, charts, and any other object that can be put into a worksheet. This can be used to take information from the report worksheet and make it available to other applications that can display bitmap images.
This function can be used to generate snippets that can be delivered using the TemplateSnippet method in the XLReporter REST API. The snippet can also be displayed in the dashboards of WIN-911’s Control Center.
Settings | |
|---|---|
Directory | The directory where the bitmap is saved. If this is left blank, the Reports Directory of the current project is used (as defined in the Project Explorer). If this is not a full path reference, the setting is used as subfolders of the Reports Directory. If any part of the directory does not exist, it is created. This can be a fixed name or cell reference where the cell reference contains the directory. Fixed names can contain XLReporter Name Types like {YYYY}, {MMM}, etc. See the Name Types chapter for the full list of supported keywords. Note that some keywords, such as {DATIM} contain illegal directory characters when evaluated. These keywords cannot be used for the directory. If the bitmap is to be used as a snippet, the Directory must either be empty or a fixed name. If the snippet is generated from a report template and instance, the variable {Instance} can be used for Directory in order to create a set of snippets for each instance of the template configured. |
File | The name of the bitmap file to export the range to. If no file extension is specified, .bmp is used. If this setting is left blank, the bitmap file is named after the target workbook in the format Workbook.bmp. If this is run on demand the target workbook is the name of the template. Note that keywords for the date and time can be entered for the file name e.g., entering {MMM}_{DD}_{YYYY} will name a report generated on June 1st 2020 as Jun_1_2020.bmp. Note that some keywords, such as {DATIM}, contain illegal file name characters when evaluated. These keywords cannot be used for the file name. This setting may also be specified as a cell reference. If the bitmap is to be used as a snippet, the File must either be empty or a fixed name. If the snippet is generated from a report template and instance, the variable {Instance} can be used for File in order to create a set of snippets for each instance of the template configured. |
Pixel Format | This defines the pixel format of the rendered bitmap. For details on the available formats and what they mean, see the Microsoft documentation for the System.Drawing.Imaging.PixelFormat enumeration. |
Example
A daily report is generated to report on OEE for different pieces of equipment across the plant as well as an overall OEE score for the entire plant for the day. The overall OEE is shown as a value as well as a “meter” indicating how good or bad it was. This information is found within the range $I$2:$L$7. To render this as a bitmap image that can then be displayed on a dashboard, the following would be configured:
Apply To | |
|---|---|
Cell | $I$2:$L$7 |
Direction | None |
End | All cells are empty |
Setting | Value |
|---|---|
Directory | |
File | |
Pixel Format | No Format |