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 XL, SAS Innovate 2024 Recap
Wednesday, May 15, 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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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