BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
avvy
Quartz | Level 8

Hi All,

 

I am using VA 7.3, is there any way or work around to display the images in VA dashboard. Suppose I selected a employee ID or Name in VA dashboard and I do have his image stored in the database. Now I want to display his/her image in the image object or some other way.

 

Any help is really appreciated.

 

Thanks & Regards,

Abhishek Pathak 

1 ACCEPTED SOLUTION

Accepted Solutions
RichardPaterson
Obsidian | Level 7

how many images are we talking about? This number would help determine the approach.

 

These are the possible solutions. None of this code is tested. 

 

1. transfer images to local file system and display the image using the Image object in VA. This is only practical for a small number of images. 

 

 

2. transfer images to a WebDav server. Then add a stored process to VA with a parameter for the employee name. The stored process will write HTML code to reference the image on the webDav server. 

 

data _null_ ;
  file _webout;
  set pics;
 
  put '<HTML>';
   put '<HEAD></HEAD>';
   put '<BODY>';
  
  put "<h3>Employee &employee</h3>";
 
  put '</BODY>';
  put '</HTML>';
 
run;

 

3. If you want to read the images directly from the database, there your stored process will look something like this, 

 

Libname pics "<to source database>";

 

proc sql noprint;

  create table pics as

  select photo as img format=$32767. informat=$32767.

  from pics.picstable

  where employee="&employee";   /* macr o variable passed from stored process in VA */

quit;

 

/* transfer image from database to a temporary location that can be referenced by your SAS web server */

/* this will be something like - /opt/sas/config/Lev1/Web/WebServer/htdocs/pics */

 

data _null_;

  set pics;

  file "/temp/somewhere on your VA server.jpg" LRECL=32767 NOPRINT NOTAB; 

  put img;

run;

 

/* again use HTML to display the picture */

data _null_ ;
  file _webout;
  
  put '<HTML>';
  put '<HEAD></HEAD>';
  put '<BODY>';
 
  put "<h3>Employee &employee</h3>";
 
  put "<IMG src='http://localwebserver/pics/employee&..jpg'"></IMG>";
  put '</BODY>';
  put '</HTML>';
 
run;

 

 

 

RIchard

View solution in original post

6 REPLIES 6
RichardPaterson
Obsidian | Level 7

Hi, 

 

can you elaborate on "database". Is it a Webdav store? If so then you can display the image using the url reference. 

 

Richard

avvy
Quartz | Level 8

Hi Richard,

The databases will be like oracle and mssql..

Can you please help out by letting us to know how to display the images using URL( some sort of steps)

 

Thanks & Regards,

Abhishek Pathak 

RichardPaterson
Obsidian | Level 7

how many images are we talking about? This number would help determine the approach.

 

These are the possible solutions. None of this code is tested. 

 

1. transfer images to local file system and display the image using the Image object in VA. This is only practical for a small number of images. 

 

 

2. transfer images to a WebDav server. Then add a stored process to VA with a parameter for the employee name. The stored process will write HTML code to reference the image on the webDav server. 

 

data _null_ ;
  file _webout;
  set pics;
 
  put '<HTML>';
   put '<HEAD></HEAD>';
   put '<BODY>';
  
  put "<h3>Employee &employee</h3>";
 
  put '</BODY>';
  put '</HTML>';
 
run;

 

3. If you want to read the images directly from the database, there your stored process will look something like this, 

 

Libname pics "<to source database>";

 

proc sql noprint;

  create table pics as

  select photo as img format=$32767. informat=$32767.

  from pics.picstable

  where employee="&employee";   /* macr o variable passed from stored process in VA */

quit;

 

/* transfer image from database to a temporary location that can be referenced by your SAS web server */

/* this will be something like - /opt/sas/config/Lev1/Web/WebServer/htdocs/pics */

 

data _null_;

  set pics;

  file "/temp/somewhere on your VA server.jpg" LRECL=32767 NOPRINT NOTAB; 

  put img;

run;

 

/* again use HTML to display the picture */

data _null_ ;
  file _webout;
  
  put '<HTML>';
  put '<HEAD></HEAD>';
  put '<BODY>';
 
  put "<h3>Employee &employee</h3>";
 
  put "<IMG src='http://localwebserver/pics/employee&..jpg'"></IMG>";
  put '</BODY>';
  put '</HTML>';
 
run;

 

 

 

RIchard

avvy
Quartz | Level 8

Thank you Richard for such a great solution.

The only doubt I am having...using the method propsed, if I am not wrong - I suppose the image will open in seperate browser...is there any way that we can display the image in the VA dashboard itself?

 

Thanks & Regards,

Abhishek Pathak

RichardPaterson
Obsidian | Level 7

yes this is unfortunately correct. And there is also no interactivity possible between a stored process object and another VA object. I think this is VERY easy for SAS to implement. I really hope this is in a next version, then we can make some really nice dashboards using the power of stored processes. 

 

I do not have the knowlegde, but it may be possible for a piece of javascript to 'scrape' the current value of a drop down list for example and then pass this into the stored process..... If you know how to do this I would be grateful to learn how. 

 

Richard

avvy
Quartz | Level 8

Hi Richard,

 

I will try to do some R&D on it....if I get some solution definately I will share it.

For the time being may be somebody from community can help us on it..

 

Thanks & Regards,

Abhishek Pathak

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 3028 views
  • 2 likes
  • 2 in conversation