In SAS Viya 4, you can create reports in SAS Visual Analytics that you may want to move around between machines. For example, what if you want to copy a report for from a development environment folder to a production environment folder? You may want to work on the report in one system before putting it onto a final system and making it generally available. Or, you may want to have a backup copy saved for recovery purposes.
There are a couple of ways you can save off reports in SAS Viya. You can use the SAS transport services in SAS Environment Manager to export the report package and then import it again to the target machine in SAS Environment Manager. However, import is controlled via permissions and if you are going into some environment where a permission has not been granted, you won't be able to do the import, even into your own personal folder. In this post, I will show you a handy trick you can use to copy a report so you can move it around to different folders, even on different machines.
Pulling from the diagnostics window
In SAS Visual Analytics, when you are editing your content, you can access a "diagnostics" window. It will show you the JSON (or XML) used the render the report. To open the diagnostics window, use the Ctrl-Alt-B key combination.
You can use this diagnostics window to save your report as a file to then import it into another folder. You may just need to fix up the library where the report data table exists, and then voila, your report is available in the target location! Here's how you do it...
Open the report you want to copy SAS Visual Analytics. Bring up the diagnostics window with Ctrl-Alt-B. The Diagnostics window shows you the JSON (or XML) of the report.
Save the JSON as a text file on your local machine and close the dialog window. The JSON file will be stored in your browser's default Downloads folder.
Moving to the target environment
Go to the target environment. Make sure you have a folder in that environment you can save the report into. I plan to store mine into My Folder.
I've also uploaded the dataset that the report depended upon into my CASUSER library.
In the target environment, open SAS Visual Analytics and click New to create a new report. Use the Ctrl-Alt-B key combination on the empty report. Clear out the existing XML and existing JSON by pressing the Clear on both windows. Then, paste your new JSON into the window.
I had to modify the JSON in the window with the new target library which was only in one place.
Load the json. The diagnostics window will close and the report should open successfully. Once loaded, check the Report to make sure all the pages are rendering correctly.
Once you have confirmed the report is working, be sure to click Save As to save the report to any folder in your target location that you have write permission to.
Voila! Your report is now in both machines. You can also save off the JSON so you have a backup copy if you need it.
I hope you found this tip helpful. Thanks for reading!