BookmarkSubscribeRSS Feed
rmedlin
Fluorite | Level 6

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:

https://communities.sas.com/t5/Developers/Exporting-an-existing-dashboard-from-Viya-to-Powerpoint/m-...

 

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':

 

rmedlin_0-1611706844313.png

 

Any input would be appreciated.

 

5 REPLIES 5
BradMorris
SAS Employee

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?

rmedlin
Fluorite | Level 6
Yes, I'd like to use the HTML form in the Viya job to display the report in question and then allow the user export it to PDF. Currently, we're using the SAS Add In for PowerPoint to import the data and it takes forever. @joeFurbee is familiar with my previous attempt and posts.

I don't know if it can be done, either. I tried the code in a plain HTML document and it didn't work, so I figured that an HTML form associated with a job might work better. Thanks for your response.
joeFurbee
Community Manager

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

BradMorris
SAS Employee

@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?

rmedlin
Fluorite | Level 6

@BradMorris , I'm not the SAS admin for our organization, but I will ask the person who did the SDK deployment.  Thank you.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2266 views
  • 2 likes
  • 3 in conversation