Automate Tableau Server Administration
Original Post: https://dev3lop.com/tableau-server-automated-dashboard-images/
We show you How to do Tableau Server Automated Dashboard Image or Images using Tab admin.
We are Tableau Developers with years of Tableau Consulting experience. Read my Resume if you'd like.
Dev3 will accomplish this with the very user-friendly PowerShell. There are many ways to solve this workload; this is one version of the solution.
[caption id="attachment_57723" align="aligncenter" width="437"] Automating Tableau Server Images with Dev3lop.[/caption]
It's a 100% successful script to automate content. In this instance - automated dashboard image or images.
It's enjoyable to pick up a new language if you have the time or like new puzzles.
The code is pasted into a .txt and save it as a .ps1, save and close after you add your edits and environment variables.
We can't offer you a .ps1 file because that would not work as a download, .ps1 files can have funky stuff in it, so be advised. However, this has been seen by thousands and used hundreds of times a day by 30+ clients. Ping
Update: I will come and upgrade the code to explain each segment.
We hope this helps your overcome the hard request! Scraping images or whatever you need for automated tableau server content can be accomplished with this code below. Have fun!
# PNG EXPORT Script
# A powershell script to pull down pngs of Tableau "views"
#
# Created By - Tyler Garrett
# Email - tyler@dev3lop.com
# Version 1
#
#
# || NOTES ||
# Create Directory C:\POSH\PNGExport
# This directory will store all content
# Script expects Tableau Bin directory to be set in Environment Variable Path
#_______________________________
#________________________________
# Set variables
#________________________________
$TS = "http://localhost" #Server
$username = "admin" #tableau server account
$pass = "admin" #tableau server password
$pgUSR = "readonly" #readonly account password must be setup beforehand
$pgPW = "admin" #postgres password
$SiteF = "BeepTest" #site you're pulling PNGs from
$ProjectF = "ProjectTest" #project you're pulling PNGs from
#_______________________________
cd C:\POSH\PNGExport
#_______________________________
#--------------=====================]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
# |
# Query postgresql and build CSV with workbook URL (3 steps)|
# |
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
# |
# 1.Connection info |
# |
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
function Get-Stuff
{
[CmdletBinding()]
param (
[string]$connectionString,
[string]$query
)
Write-Verbose 'Getting Tableau Server Extract'
$connection = New-Object -TypeName System.Data.Odbc.OdbcConnection
$connection.ConnectionString = $connectionString
$command = $connection.CreateCommand()
$command.CommandText = $query
$adapter = New-Object System.Data.Odbc.OdbcDataAdapter $command
$dataset = New-Object -TypeName System.Data.DataSet
$adapter.Fill($dataset)
$dataset.Tables[0]
}
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
# |
# 2.Query PostgreSQL |
# |
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
$query = @"
SELECT
v.view_url
FROM _views v
INNER JOIN _workbooks w on (w.id=v.workbook_id)
INNER JOIN _sites s on (s.id = v.site_id)
WHERE s.name = '$SiteF'
and w.project_name = '$ProjectF'
"@
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
# | Don't change anything in the syntax around the query above, I tried and it broke.
# 3.Build CSV to be used for tabcmd from the above query|
# |
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
Get-Stuff -connectionString $connectionString -query $query | `
Select-Object -Skip 1 -Property view_url | `
Export-Csv -Path "C:\POSH\PNGExport\Reports.csv" -NoTypeInformation -Delimiter ";"
#--------------=====================]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
#_________________________________
# Loop through CSV from above and export those views as PNG files
# -replace is used in the loop to save the file name with out a "/"
# because this value isn't allowed in a file naming convention
# error output will be generated in the folder
#_________________________________
#NOTE: Change Paths
tabcmd login -s $TS -u $username -p $pass -t $SiteF
ForEach ($wb in @(Import-Csv -Path C:\POSH\PNGExport\Reports.csv | select -expand view_url) )
{
Try
{
$newwb = $wb -replace "/", "_"
tabcmd export $wb --png -f $newwb 2>> C:\POSH\PNGExport\TabCmdGetWbErr.txt
}
Catch
{
Write-Error -Message “Error occured: $_”
}
}
#_________________________________
# Convert PNG to BMP - helps people who are moving these photos into Powerpoint
# Comment the Dir *.png.... line out of the script if you want to keep them as PNG files
#_________________________________
Dir *.png | rename-item -newname { $_.name -replace '\.png$','.bmp' }
tabcmd logout
#_______________________________End here
Our blog is the effect of that.
My wife is great and lets me, deep dive in new programming languages late into the night. It's exciting to build solutions and offer them as open source!
You may need a legit wife to get your environment variables working correctly in the code below. Took me awhile but hey it's commented now! Just copy and paste.
It's heavily commented out with hashtags and very user-friendly.
We do recommend telling people about it before hitting Tableau Server or testing it in a development environment. Tell others there may be an impact. If you're running a big list, it may be a significant impact.
[caption id="attachment_57727" align="alignleft" width="152"] Automated dashboard images need a folder. Be sure to set your folder location before running the script![/caption]
Automating images from Tableau server can offer some issues. Like storage. You may have upset your IT guy to get this far as is. Be sure to tell him you love him and could use a few gigs for those mega pulls!
If you've made it that far, you're not worried about that and probably the IT guy. (just play it safe)
So, if you need to learn how to save thousands of hours doing easy automation, I'm writing this as the golden ticket!
Now coming back I wanted to explain more about automating dashboard images or report images from Tableau Server using Tab Admin.
[caption id="attachment_57721" align="alignleft" width="205"] Dang, I got trolled because I built a badass script. So, here's Dev3lop's Png Export - Tableau Server Script Automated dashboard re-blog.[/caption]
My previous client from ages ago just used our chat and told me I should add it to the blog because the correct answer seemed to be given away by an account that has never used again...
I called the friends using it daily, and 100% have said they have never needed to change it.
That's great news for you; you just need to dive into some PowerShell. Ping us if you get stuck on anything.
[caption id="attachment_57722" align="alignleft" width="225"] Thousands of people have seen the automate dashboard image for years. They never were taken down a path of automation unless they scrolled past the correct answer.[/caption]
Loads were found online and chopped together with thousands and thousands of test runs.
Automated dashboard images in PowerShell is straightforward to handle, and it never breaks.
Automated dashboard image like a champion without the fluff.
Tableau server automated dashboard script that saves others thousands of hours automating pngs.
Truly automating dashboard image scrapes requires a bit of testing, after thousands of tests - here's a free app to help you scrape images from Tableau server.
If you know SQL, you will see the full range of flexibility this query carries for Postgres usage. It's nested in the PowerShell code posted below. It's used by lots of the clients you see in our portfolio.
You can utilize this to automate pictures or automate workbooks! Use our developer live chat to let us know how it works. We won't be able to support it, and also Tableau Support will not be able to support it. Happy to give advice and be careful not to break anything. Let your team know what you're doing.
Automate Tableau Server Administration
We show you How to do Tableau Server Automated Dashboard Image or Images using Tab admin.
We are Tableau Developers with years of Tableau Consulting experience. Read my Resume if you'd like.
Dev3 will accomplish this with the very user-friendly PowerShell. There are many ways to solve this workload; this is one version of the solution.
[caption id="attachment_57723" align="aligncenter" width="437"] Automating Tableau Server Images with Dev3lop.[/caption]
It's a 100% successful script to automate content. In this instance - automated dashboard image or images.
It's enjoyable to pick up a new language if you have the time or like new puzzles.
"You do not need prior programming knowledge to pick this up automate dashboard image script."Is this the best solution? No - it's a solution that I was able to hand to business users and did not need to support the script afterward - The script is just easy to support, that is why it was developed.
Quote date 7/15/20: Client User feedback
Automate Dashboard Image or PNG Export Script
Please, Note that in PowerShell the hashtag is a comment, and the script will not see this. You paste the code to win.The code is pasted into a .txt and save it as a .ps1, save and close after you add your edits and environment variables.
We can't offer you a .ps1 file because that would not work as a download, .ps1 files can have funky stuff in it, so be advised. However, this has been seen by thousands and used hundreds of times a day by 30+ clients. Ping
Update: I will come and upgrade the code to explain each segment.
We hope this helps your overcome the hard request! Scraping images or whatever you need for automated tableau server content can be accomplished with this code below. Have fun!
#Comment - Read Comments, Edit Variables, Run it!
.#_______________________________Start here# PNG EXPORT Script
# A powershell script to pull down pngs of Tableau "views"
#
# Created By - Tyler Garrett
# Email - tyler@dev3lop.com
# Version 1
#
#
# || NOTES ||
# Create Directory C:\POSH\PNGExport
# This directory will store all content
# Script expects Tableau Bin directory to be set in Environment Variable Path
#_______________________________
#________________________________
# Set variables
#________________________________
$TS = "http://localhost" #Server
$username = "admin" #tableau server account
$pass = "admin" #tableau server password
$pgUSR = "readonly" #readonly account password must be setup beforehand
$pgPW = "admin" #postgres password
$SiteF = "BeepTest" #site you're pulling PNGs from
$ProjectF = "ProjectTest" #project you're pulling PNGs from
#_______________________________
cd C:\POSH\PNGExport
#_______________________________
#--------------=====================]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
# |
# Query postgresql and build CSV with workbook URL (3 steps)|
# |
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
# |
# 1.Connection info |
# |
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
#Commented - Open connection to database to query repo
Set-Location "C:\POSH\PNGExport"function Get-Stuff
{
[CmdletBinding()]
param (
[string]$connectionString,
[string]$query
)
Write-Verbose 'Getting Tableau Server Extract'
$connection = New-Object -TypeName System.Data.Odbc.OdbcConnection
$connection.ConnectionString = $connectionString
$command = $connection.CreateCommand()
$command.CommandText = $query
$adapter = New-Object System.Data.Odbc.OdbcDataAdapter $command
$dataset = New-Object -TypeName System.Data.DataSet
$adapter.Fill($dataset)
$dataset.Tables[0]
}
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
# |
# 2.Query PostgreSQL |
# |
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
#Commented Utilize Driver and funnel query to repo through.
$connectionString = 'Driver={PostgreSQL ANSI(x64)};Server=localhost; Port=8060; Database=workgroup; Uid='+$pgUSR+'; Pwd='+$pgPW+';'$query = @"
SELECT
v.view_url
FROM _views v
INNER JOIN _workbooks w on (w.id=v.workbook_id)
INNER JOIN _sites s on (s.id = v.site_id)
WHERE s.name = '$SiteF'
and w.project_name = '$ProjectF'
"@
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
# | Don't change anything in the syntax around the query above, I tried and it broke.
# 3.Build CSV to be used for tabcmd from the above query|
# |
#¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
Get-Stuff -connectionString $connectionString -query $query | `
Select-Object -Skip 1 -Property view_url | `
Export-Csv -Path "C:\POSH\PNGExport\Reports.csv" -NoTypeInformation -Delimiter ";"
#--------------=====================]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
#_________________________________
# Loop through CSV from above and export those views as PNG files
# -replace is used in the loop to save the file name with out a "/"
# because this value isn't allowed in a file naming convention
# error output will be generated in the folder
#_________________________________
#Comment Loops in Powershell to export PNGs
#Comment; pay attention to this looping process and you will be able to tabcmd your way through anything.#NOTE: Change Paths
tabcmd login -s $TS -u $username -p $pass -t $SiteF
ForEach ($wb in @(Import-Csv -Path C:\POSH\PNGExport\Reports.csv | select -expand view_url) )
{
Try
{
$newwb = $wb -replace "/", "_"
tabcmd export $wb --png -f $newwb 2>> C:\POSH\PNGExport\TabCmdGetWbErr.txt
}
Catch
{
Write-Error -Message “Error occured: $_”
}
}
#_________________________________
# Convert PNG to BMP - helps people who are moving these photos into Powerpoint
# Comment the Dir *.png.... line out of the script if you want to keep them as PNG files
#_________________________________
Dir *.png | rename-item -newname { $_.name -replace '\.png$','.bmp' }
tabcmd logout
#_______________________________End here
End of your Tableau Server Automated Dashboard Image Script
Like we said, Tableau server automated dashboard images is very straight forward with the correct content!Cool wife helps with learning PowerShell to automate tableau server images for fun!
Yes, installing Tableau Server on the computer and building scripts was fun. These scripts work for countless clients.Our blog is the effect of that.
My wife is great and lets me, deep dive in new programming languages late into the night. It's exciting to build solutions and offer them as open source!
You may need a legit wife to get your environment variables working correctly in the code below. Took me awhile but hey it's commented now! Just copy and paste.
It's heavily commented out with hashtags and very user-friendly.
We do recommend telling people about it before hitting Tableau Server or testing it in a development environment. Tell others there may be an impact. If you're running a big list, it may be a significant impact.
[caption id="attachment_57727" align="alignleft" width="152"] Automated dashboard images need a folder. Be sure to set your folder location before running the script![/caption]
Automating images from Tableau server can offer some issues. Like storage. You may have upset your IT guy to get this far as is. Be sure to tell him you love him and could use a few gigs for those mega pulls!
If you've made it that far, you're not worried about that and probably the IT guy. (just play it safe)
So, if you need to learn how to save thousands of hours doing easy automation, I'm writing this as the golden ticket!
An Update on the Automated Dashboard Image Post from Ages Ago
Was a bit busy with Tableau consulting and did not notice what happened.Now coming back I wanted to explain more about automating dashboard images or report images from Tableau Server using Tab Admin.
[caption id="attachment_57721" align="alignleft" width="205"] Dang, I got trolled because I built a badass script. So, here's Dev3lop's Png Export - Tableau Server Script Automated dashboard re-blog.[/caption]
My previous client from ages ago just used our chat and told me I should add it to the blog because the correct answer seemed to be given away by an account that has never used again...
Does our automated dashboard image Tableau server script work?
Automated dashboard images from Tableau Server is the only way to do your .png pull.I called the friends using it daily, and 100% have said they have never needed to change it.
That's great news for you; you just need to dive into some PowerShell. Ping us if you get stuck on anything.
Dev3lop's Founder Tyler built most of the Tableau Server Automated Dashboard Image Script
The script posted below was bits and pieces found teaching myself the language PowerShell.[caption id="attachment_57722" align="alignleft" width="225"] Thousands of people have seen the automate dashboard image for years. They never were taken down a path of automation unless they scrolled past the correct answer.[/caption]
Loads were found online and chopped together with thousands and thousands of test runs.
Automated dashboard images in PowerShell is straightforward to handle, and it never breaks.
If you can't build the tableau server automated images script, copy and paste it and use it!
Saving thousands of hours! You can swap this out and automate across anything.Automated dashboard image like a champion without the fluff.
The Tableau ServerAutomated dashboard images Script
This Tableau Server automated dashboard images script was generated to help everyone automate using Tabadmin. Set your variables and automated image scrape will be an easy copy and paste task. You will be able to automate 1, 2, or thousands of pictures.Tableau server automated dashboard script that saves others thousands of hours automating pngs.
Truly automating dashboard image scrapes requires a bit of testing, after thousands of tests - here's a free app to help you scrape images from Tableau server.
If you know SQL, you will see the full range of flexibility this query carries for Postgres usage. It's nested in the PowerShell code posted below. It's used by lots of the clients you see in our portfolio.
You can utilize this to automate pictures or automate workbooks! Use our developer live chat to let us know how it works. We won't be able to support it, and also Tableau Support will not be able to support it. Happy to give advice and be careful not to break anything. Let your team know what you're doing.
This comment has been removed by the author.
ReplyDeleteI think you should try to know more about Tableau and Server Administration since it can help you in solving large set of database problems.
ReplyDeleteTableau Soap Connection
Excellent article!!! IntelliMindz is the best IT Training in Bangalore with placement, offering 200 and more software courses with 100% Placement Assistance.
DeleteTableau Online Course
Tableau Training In Bangalore
Tableau Training In Chennai
Fantastic post.
ReplyDeleteReally enjoyed reading it and it held my attention all the way through! Keep it up.
Read my Latest Post