Hi Again,
I'm a relative newbie with SAS Viya and just starting using the VA SDK.
Here's my previous question on the matter where I was directed to the SDK, which I thin is the best solution:
What I'm trying to do is to take an existing report/dashboard that was created by another user and export it programmatically, probably to PDF. This is what I've pieced together through research:
<html>
<head>
<script async src="https://unpkg.com/@sassoftware/va-report-components@0.12.0/dist/umd/va-report-components.js"></scrip...>
<style>
html {
background-color: #f0f0f0;
}
sas-report {
width: 75%;
height: 75%;
--sas-report-padding: 10px;
display: block;
}
</style>
</head>
<body>
<sas-report
authenticationType="guest"
url="https://dev.server.com"
reportUri="/reports/reports/91941d76-xxxx-xxxx-xxxx-xxxxxxxxxx"
></sas-report>
</body>
</html>
The documentation for VA SDK says that an "HTML document" is required. I was hopeful that I could just create a new job in Viya and use the HTML form associated with the job as a document and UI.
But the response is 'Object not found':
Any input would be appreciated.
Hi @rmedlin,
The error you showed seems to be that the Job execution can not find the resulting content (html page?) to display, resulting in that error. So that in itself has nothing to do with the Visual Analytics SDK. @joeFurbee, maybe you can help direct this aspect of the problem.
Now back to what you are trying to achieve, I'm a bit confused on exactly what it is you are doing? Are you using Viya Jobs for the sole purpose of hosting an html page that contains the SDK? I assume this would work, but I've never seen that done. Usually one would just write HTML and JavaScript directly to utilize the SDK and host that page on a web server. Also, you mention exporting the report to PDF. Is your intention to use the SDK not for display, but only to cal the exportToPDF api?
Hi @rmedlin,
To address the 'Object not found' error, have you tried to run the straight API call for the report? Something like:
curl -X GET https://dev.server.com/reports/reports/91941d76-xxxx-xxxx-xxxx-xxxxxxxxxx \ -H 'Accept: application/vnd.sas.report+json'
Join us for SAS Community Trivia
SAS Bowl XLIII, The New SAS Developer Portal
Wednesday, August 14, 2024, at 10 a.m. ET | #SASBowl
@joeFurbee and @rmedlin,
What 'Object not found' error is being referred to here? In the original post it mentioned this, but then showed the error coming from the Job, which was "The file could not be found", referencing /files/files/{uid}/content. When a Job runs it's output gets placed in under /files, which I think is what is being referenced here. That has nothing to do with the report object.
@rmedlin, you mentioned not being able to get the VASDK working with a static HTML page, so then trying it through a Viya Job. Adding a Job into the mix is only going to complicate things, so my advice would be first to get a working static example of the VASDK working. What errors were you getting when trying to use the VASDK? Most problems occur due to improper or incomplete configuration of Viya. Did you follow the instructions here, https://developer.sas.com/sdk/va/docs/getting-started/#sas-viya-setup?
@BradMorris , I'm not the SAS admin for our organization, but I will ask the person who did the SDK deployment. Thank you.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.