Tuesday, July 24, 2018

Export SSAS diagram as single image

Visual studio doesn't give option to SSAS Database / Cube diagram in JPG, until micrsoft come with their own option to export it to image - here is the workaround.

1. Export to PDF
2. PDF to JPGs
3, Crop jpgs (Irfanview Portable)
4. Create HTML page to view all images in table. (assuming diagram name is mydiagram)
code

<html> <head> <style> td, tr, img { padding: 0px; margin: 0px; border: none; } td { width:1694;height:2149;} table { border-collapse: collapse; background-color:red; border-spacing: 0px; } </style> <script language="javascript" type="text/javascript" > function padDigits(number, digits) { return Array(Math.max(digits - String(number).length + 1, 0)).join(0) + number; } document.write('\r\n\t<table'); for (var i = 0; i < 10; i++) { document.write('\r\n\t<tr>'); for (var j = 0; j < 6; j++) { document.write('\r\n\t\t<td style="border: 0px none black "><img src="mydiagram-' + padDigits(((i * 6) + j) + 1, 2) + '.jpg" class="cropimg" /> </td>'); } document.write('\r\n\t</tr>'); } document.write('\r\n\t</table>'); </script> </head> <body> </body> </html>

5. Export web page with chrome extension Full Page Screen Capture offered by mrcoles.com ( Grant local page file permission)

No comments:

Post a Comment