• Home
  • About Us
  • Contact Us
  • DMCA
  • Sitemap
  • Privacy Policy
Saturday, April 1, 2023
Insta Citizen
No Result
View All Result
  • Home
  • Technology
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Artificial Intelligence
  • Home
  • Technology
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Artificial Intelligence
No Result
View All Result
Insta Citizen
No Result
View All Result
Home Artificial Intelligence

Export a Visible Analytics report utilizing REST APIs

Insta Citizen by Insta Citizen
October 16, 2022
in Artificial Intelligence
0
Export a Visible Analytics report utilizing REST APIs
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


In my earlier weblog Programmatically export a Visible Analytics report back to PDF – SAS Customers, I exploit the SAS Visible Analytics SDK to export a report back to PDF, which is sort of easy if now we have primary information with JavaScript programming. It really works for each the most recent model of SAS Viya and model 3.5. The brand new model of SAS Viya provides enhancements and now we have the choice to export VA report back to PDF — utilizing REST API, with out want of JavaScript programming. That is what I’ll focus on on this publish.

The API underneath Visible Analytics class in newest SAS Viya, supplies the flexibility to export a report, or a report object, to a PDF file. It additionally supplies the flexibility to create and run a job to do the exporting. Truly, we are able to export a report PDF, picture, package deal, and information utilizing the APIs. All are fairly straight ahead. On this article, I’ll present how you can export a report or report object to PDF file instantly, and how you can create and run a job to export to a PDF.

Get all of the API hyperlinks of Visible Analytics

The API underneath Visible Analytics supplies the flexibility to retrieve all of the API hyperlinks by way of the http ‘GET’ methodology. You’ll want to set the “Settle for” = “software/vnd.sas.api+json” within the HEADERS of PROC http. Beneath is my pattern code snippet, I outline a json library so we are able to view the output of PROC http visually.

%let BASE_URI=%sysfunc(getoption(SERVICESBASEURL));
FILENAME vaJason TEMP ENCODING='UTF-8';
FILENAME hdrout TEMP ENCODING='UTF-8';
PROC HTTP METHOD="GET" oauth_bearer=sas_services out=vaJason headerout=hdrout
    URL = "&BASE_URI/visualAnalytics/";
    HEADERS "Settle for" = "software/vnd.sas.api+json";
RUN;
LIBNAME vaJason json;

If we see the message of ‘200 OK’ returned (one thing like under), we all know the PROC runs efficiently.

Now in SAS Studio, if I’m going to the ‘Libraries’ tab, double click on the LINKS desk within the VAJASON library, all of the API hyperlinks of Visible Analytics are listed within the ‘href’ columns as proven under. We see the assist of exporting the report PDF, picture, package deal, and information with corresponding methodology and href.

Export a report or report object to PDF

Now, let me export a report back to PDF instantly. Beneath is the code snippet I used. With the FILENAME assertion, the exported PDF might be saved in a bodily location (I reserve it as rpt.pdf file within the /tmp/ folder). You’ll want to set the “Settle for” = “software/pdf” within the HEADERS of PROC http. In my instance, I export a report with two report objects: a bar chart and a forecasting object.

%let BASE_URI=%sysfunc(getoption(SERVICESBASEURL));
FILENAME rptFile "/tmp/rpt.pdf"; 
PROC HTTP METHOD="GET" oauth_bearer=sas_services OUT=rptFile headerout=hdrout 
    URL = "&BASE_URI/visualAnalytics/stories/d940126c-f917-4a13-8e1a-51b6729f50ec/pdf";
    HEADERS "Settle for" = "software/pdf"
            "Settle for-Language" = "*"
            "Settle for-Locale" = "en-US";
RUN;

Run the code, and if we see the message of ‘200 OK’ returned, we all know the export succeeded. We are able to go to the /tmp/ folder and verify the rpt.pdf file there.

Subsequent, let me export a report object to PDF. In case you are not accustomed to objects composition of a VA report, confer with my earlier publish Uncover Visible Analytics Report Paths with REST APIs. Completely different from exporting a report, I must set the parameter ‘reportObjects’ for the exported object. With the ‘GET’ methodology in PROC http, I exploit the QUERY choice to set all of the parameters I wish to use for the article. For instance, I set some cowl web page textual content. Beneath is the code snippet for report object exporting.

%let BASE_URI=%sysfunc(getoption(SERVICESBASEURL));
FILENAME rptFile "/tmp/rpt.pdf"; 
PROC HTTP METHOD="GET" oauth_bearer=sas_services OUT=rptFile headerout=hdrout 
    URL = "&BASE_URI/visualAnalytics/stories/d940126c-f917-4a13-8e1a-51b6729f50ec/pdf"  
    QUERY = ("reportObjects"="ve58" "includeCoverPage"=true "coverPageText"="That is cowl web page for a report object.");
    HEADERS "Settle for" = "software/pdf"
            "Settle for-Language" = "*"
            "Settle for-Locale" = "en-US";
RUN;

Equally, if we see the message of ‘200 OK’ returned, we all know the export runs efficiently. The next screenshots present the exported report PDF and the exported report object PDF, respectively.

Create and run a job to export a PDF

In addition to exporting a report or report object instantly, the API underneath Visible Analytics supplies the flexibility to asynchronously execute the export job. The variations between instantly export and job export are:

  • The ‘POST’ methodology is used for the job export motion.
  • To export a report or report object by working a job, we have to apply the rendering choice values within the request object, in addition to choices for the creation of the PDF.
  • Job export will save the export pdf file to the SAS Viya Content material server folder, not a bodily disk location. The PDF file might be then downloaded to native disk from SAS Studio or SAS Drive.

Beneath is the code snippet of making a job to export report pdf. You’ll want to set the “Settle for” = “software/vnd.sas.visible.analytics.report.export.pdf.job+json”, and “Content material-Sort” = “software/vnd.sas.visible.analytics.report.export.pdf.request+json” within the HEADERS of PROC http.

%let BASE_URI=%sysfunc(getoption(SERVICESBASEURL));
FILENAME hdrout TEMP ENCODING='UTF-8';
 
PROC HTTP METHOD="POST" oauth_bearer=sas_services headerout=hdrout 
    URL = "&BASE_URI/visualAnalytics/stories/d940126c-f917-4a13-8e1a-51b6729f50ec/exportPdf"  
     IN = '{
            "resultFolder": "/folders/folders/9d78f045-e7d9-4e82-b4aa-c7220cb85558",
            "resultFilename": "Exported PDF File.pdf",
            "nameConflict": "exchange",
            "wait": 30,
            "timeout": 60,
            "choices": {
                "orientation": "panorama",
                "paperSize": "A4",
                "showPageNumbers": true,
                "includeCoverPage": true,
                "coverPageText": "That is cowl web page for export pdf job."
                },
            "model": 1
            }'
      ;
    HEADERS "Settle for" = "software/vnd.sas.visible.analytics.report.export.pdf.job+json"
            "Content material-Sort" = "software/vnd.sas.visible.analytics.report.export.pdf.request+json" 
            "Settle for-Language" = "*"
            "Settle for-Locale" = "en-US";
RUN;

If we see the message of ‘201 Created’ returned as proven under, we all know the export job runs efficiently.

Beneath screenshot exhibits the exported report PDF.

Lastly

In abstract, for the most recent model of SAS Viya, the REST API underneath Visible Analytics class supplies a straightforward strategy to export a report or a report object to a PDF file, both instantly, or by a job asynchronously. We are able to additionally simply export the report object to picture, the report information to CSV, TSV, XLSX, and the report sources to a package deal. You might be inspired to search out extra at Visualization – Visualization API Reference (sas.com).



Source_link

READ ALSO

Discovering Patterns in Comfort Retailer Areas with Geospatial Affiliation Rule Mining | by Elliot Humphrey | Apr, 2023

Scale back name maintain time and enhance buyer expertise with self-service digital brokers utilizing Amazon Join and Amazon Lex

Related Posts

Discovering Patterns in Comfort Retailer Areas with Geospatial Affiliation Rule Mining | by Elliot Humphrey | Apr, 2023
Artificial Intelligence

Discovering Patterns in Comfort Retailer Areas with Geospatial Affiliation Rule Mining | by Elliot Humphrey | Apr, 2023

April 1, 2023
Scale back name maintain time and enhance buyer expertise with self-service digital brokers utilizing Amazon Join and Amazon Lex
Artificial Intelligence

Scale back name maintain time and enhance buyer expertise with self-service digital brokers utilizing Amazon Join and Amazon Lex

April 1, 2023
New and improved embedding mannequin
Artificial Intelligence

New and improved embedding mannequin

March 31, 2023
Interpretowalność modeli klasy AI/ML na platformie SAS Viya
Artificial Intelligence

Interpretowalność modeli klasy AI/ML na platformie SAS Viya

March 31, 2023
How deep-network fashions take probably harmful ‘shortcuts’ in fixing complicated recognition duties — ScienceDaily
Artificial Intelligence

New in-home AI device screens the well being of aged residents — ScienceDaily

March 31, 2023
RGB-X Classification for Electronics Sorting
Artificial Intelligence

TRACT: Denoising Diffusion Fashions with Transitive Closure Time-Distillation

March 31, 2023
Next Post
Negroni Sbagliato: Why Emma D’Arcy’s Drink of Alternative Now a TikTok Pattern

Negroni Sbagliato: Why Emma D'Arcy's Drink of Alternative Now a TikTok Pattern

POPULAR NEWS

AMD Zen 4 Ryzen 7000 Specs, Launch Date, Benchmarks, Value Listings

October 1, 2022
Only5mins! – Europe’s hottest warmth pump markets – pv journal Worldwide

Only5mins! – Europe’s hottest warmth pump markets – pv journal Worldwide

February 10, 2023
Magento IOS App Builder – Webkul Weblog

Magento IOS App Builder – Webkul Weblog

September 29, 2022
XR-based metaverse platform for multi-user collaborations

XR-based metaverse platform for multi-user collaborations

October 21, 2022
Migrate from Magento 1 to Magento 2 for Improved Efficiency

Migrate from Magento 1 to Magento 2 for Improved Efficiency

February 6, 2023

EDITOR'S PICK

Enabling high-accuracy protein construction prediction on the proteome scale

Enabling high-accuracy protein construction prediction on the proteome scale

February 20, 2023
Tips on how to Set up Steam on Ubuntu

Tips on how to Set up Steam on Ubuntu

February 6, 2023
3 Straightforward Methods to Use ChatGPT in Your Cellular Keyboard

3 Straightforward Methods to Use ChatGPT in Your Cellular Keyboard

March 1, 2023
Program Integrates OYA Renewables Group Photo voltaic Initiatives for Underserved New Yorkers

Program Integrates OYA Renewables Group Photo voltaic Initiatives for Underserved New Yorkers

January 26, 2023

Insta Citizen

Welcome to Insta Citizen The goal of Insta Citizen is to give you the absolute best news sources for any topic! Our topics are carefully curated and constantly updated as we know the web moves fast so we try to as well.

Categories

  • Artificial Intelligence
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Technology

Recent Posts

  • GoGoBest E-Bike Easter Sale – Massive reductions throughout the vary, together with an electrical highway bike
  • Hackers exploit WordPress plugin flaw that provides full management of hundreds of thousands of websites
  • Error Dealing with in React 16 
  • Discovering Patterns in Comfort Retailer Areas with Geospatial Affiliation Rule Mining | by Elliot Humphrey | Apr, 2023
  • Home
  • About Us
  • Contact Us
  • DMCA
  • Sitemap
  • Privacy Policy

Copyright © 2022 Instacitizen.com | All Rights Reserved.

No Result
View All Result
  • Home
  • Technology
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Artificial Intelligence

Copyright © 2022 Instacitizen.com | All Rights Reserved.

What Are Cookies
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT