Configure Tableau Server URL to Take Directly to Workbook using LUID - sql

I am trying to use my workbook LUID coming from the public.workbooks table to link me directly to the Tableau Server workbook I am interested in. However, I keep getting page unavailable when configuring the link.
My structure looks like this:
https://<my_tableau_server_name>/#/site/<site_name>/workbooks/<luid>

Related

How to use SQL Server Reporting Services URL Access to save rendered PDF-Reports as varbinary into Table

I'm trying to store rendered pdf-reports from the Report Server back into a table of the origin database as a varbinary. My current approach would be to use URL-Access inside of an external python script to get the rendered reports and then save them into the corresponding table. The following URL works as expected in the browser:
http://localhost/reportserver?/ReportingServicesTest/Report_Test&rs:Format=PDF
However when I tried to access that URL inside of the external python script I received a 401 error.
So I then tried to use the requests_ntlm library to pass the username and password, but somehow it still doesn't work.
import requests
from requests_ntlm import HttpNtlmAuth
url = 'http://localhost/reportserver?/ReportingServicesTest/Report_Test&rs:Format=PDF'
session = requests.Session()
session.auth = HttpNtlmAuth('Domain\\Username','password')
response = session.get(url,stream=True)
open('C:/Path/Report_Test.pdf', 'wb').write(response.content)
Is my approach in principle correct or are there better ways to accomplish the same thing?
I'm fairly new to SQL Server Reporting Services, so I'm open to your suggestions and appreciate your help in advance.
IMHO if you need to historic data for safekeeping or auditing purposes I'd strongly recommend to keep the data in the database. Use a staging environment to add a timestamp to the report data so the snapshots make more sense. In this way you can use the SSRS portal later on to filter on a particular historic version (parameterized) and you don't have to build a bespoke PDF viewer. It would also save some database storage. As an alternative, you could create a subscription in SSRS, have the PDF send to a file share. Then configure a listener to that directory to get your meta information and store that reference in a database table. Needless to say I'm not a big fan of storing files in the database as file storage is cheaper than database storage most of the time.
To solve your authentication issue you might want to check up on your rsreportserver.config file on your web server as your current code suggests that your local host is unknowing of any domain. In any case you can try changing your <Authentication/> section so that it looks like this:
<Authentication>
<AuthenticationTypes>
<RSWindowsBasic>
<LogonMethod>3</LogonMethod>
<Realm></Realm>
<DefaultDomain>putyourfullyqualifieddomainnamehere</DefaultDomain>
</RSWindowsBasic>
</AuthenticationTypes>
<RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
<RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>
<EnableAuthPersistence>true</EnableAuthPersistence>
</Authentication>
This will also work if your web server is behind a proxy or firewall.
Important: the content of DefaultDomain should be a FQDN, such as contoso.microsoft.com or myprimarydomain.lan

make Sql Server database public (allow read and write within network)

How can I modify an Sql Server database properties to make it public so that all users within the network can read and write to it? (they will do so through VBA code)
The method I used until now was granting access from DB Security to the network logins/users.
Desired method: I would like to have the database as public and alter the VBA code so that some actions are allowed/restricted based on network username.
What I would do is retrieve the user_id of the user in VBA with
environ('username')
and access the database via a server script.
Create table where you store the users of your internal network (via Active Directory you could use LDAP, otherwise you store the id's yourself);
Create an Ajax call from VBA to the server script and check if the user exists;
I refer to this answer I formulated before on how to create the Ajax call:
Updating Oracle Table from Excel VBA Macro using ODBC connection
Perform all database transactions from the server script (not from VBA directly to the db). You can send the necessary sql criteria with as GET parameters with the url string (check the link on how to do this via Ajax);
Additionally you can embed an extra security by sending a self created key from the vba tool to the server script (this can be hard coded in the VBA code) and verify this before performing any supplementary actions.
This in order to verify if the VBA tool at the client side should have access to the script.

How to see Tableau Custom SQL on server without downloading workbook?

Oftentimes I need to troubleshoot a workbook that another person at my company has created and published to our server. To troubleshoot, I need to see their connection details, specifically their Custom SQL, to understand what data they are using in their extract.
Is there any way to view this connection info (specifically their SQL code) when viewing the published workbook on the server (web) version?
I am an admin and I am able to download their workbook to my desktop version of tableau, then open it, then reconnect to the data, then look through the data connections they created, to see their SQL. But it's a really cumbersome process.
All I'm looking to do is, when looking at a published workbook, see the data connection details so that I can see the Custom SQL, without going through the process of downloading I described above.
You can get some details on the SQL statement by creating a performance recording.
From the Tableau Server Admin Guide:
Enable Performance Recordings:
Choose the Admin button in Tableau Server.
Choose Site.
Select a site.
Choose Edit.
In the Edit Site dialog box, select Allow Performance Recording.
Choose OK.
You start performance recording for a specific view by adding ?:record_performance=yes to
the url. For example:
http://server.site.com/views/Variety/BaseballStatistics?:record_performance=yes
Now, notice a new link at the top of your view called "Show Performance Recording".
Click this to open the generated performance workbook dashboard. Click on the bar chart and observe the SQL appear at the bottom of the view. Note, the SQL text will truncate after about 250 characters.
The admin guide suggests viewing the "Tableau Log" to find the full SQL statement.. I have looked at all the server side logs in C:\ProgramData\Tableau\Tableau Server\data\tabsvc\logs but cannot locate the SQL. (please reply if you know where to find this?)
You can also run a database trace to see the SQL that the database sees. For example, for MS SQL Server, run the Profiler tool, setup a default trace, and filter on "Application Name" = "Tableau Protocol Server 8.0" or similar.
I have version 8.1 and this is how I got around this problem. Tableau shows a 'Custom SQL Warning' when you open a workbook that contains the custom SQL. You can copy all the text in this message by simply Ctrl + C as this is any other Windows warning message. And then paste it your editor of choice to analyze it.
I do not know if this works on earlier versions.
I thought you could do this easily, and originally answered that you could, but I didn't pay close attention to your question. You can change some things about data connections without editing the workbook, including the ip address or name of the database server, but there doesn't appear to be a simple way to access custom sql without downloading the workbook.
Go to the Administrator page and select Data Connections.
You can enter some search criteria to filter the list of data connections shown (or not).
Find the workbook in question by scanning the second column -- you can sort the column if that helps.
Then select the corresponding data connection in the 4th column to see the details of the connection.
If it makes sense for the connection, you can also modify the connection directly at the server. This is really useful if you, say, need to move your enterprise database to a new IP address or change a database password, without downloading, modifying and republishing alot of workbooks.
An even better practice is to start using shared data connections hosted on Tableau server instead of having each workbook have its own local copy of connection and related info.

Use ReportingService API to read custom data source credentials

We have an SQL 2008 R2 server running reporting services and I would like to identify reports that use specific credentials to connect to a data source. In this situation, the reports connect to the data source using a custom data source with a specific user account that has the proper security on the SQL server to run the reports.
Plan plan was to query [ReportServer].[dbo].[Catalog] to get a list of reports. Then run it through the code below to identify the reports using credentials I'm interested in. All of this would be done in an SSIS package.
Using the ReportingService API, I can read the user name of the credentials in the connection strings of shared data sources. The code is listed below. However, in my case, I need to load the data source credentials from a custom data source specific to the report, not a shared data sources. The GetDataSourceContents method doesn't seem to support this. If I supply the report name & path instead of the shared data source, it generates an error.
Is there another way to approach this? We have hundreds of reports, so using the UI to look this information up would be impractical.
Thanks in advance.
NOTE: "web_service" is the web service reference to the report server (http://[servername]/ReportServer/ReportService2005.asmx?WSDL)
Dim rs As New web_service.ReportingService2005()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim ds_def As web_service.DataSourceDefinition
ds_def = rs.GetDataSourceContents("/Data Sources/data_source_1")
With MyCredentialsOutputBuffer
.AddRow()
.UserName = ds_def.UserName
End With
You will need to pull down the rdl content and parse it:(
Embedded data source information is stored in the .rdl and not a shared data set item obtained via the api. Even then you can't retrieve data source passwords.

Web site not pulling data properly from SQL after server transfer

We have a website we would like to transfer to our Server 2008, IIS7 site which uses NOPCommerce. We imported the database, set up the web.config and the database connects. The issue, it seems, is that it's not pulling the data.
For example: The registration page should be like:
First Name
Last Name
Gender
Birth Date
Instead its like
account.firstname
account.lastname
account.gender
account.dob
We ensured the site has proper access to the DB and it does connect(it yields an error page if it doesn't)
Anyone have any ideas?
Seems the issue was related to mounting the database. It seems the primary keys were set to the lowest available value instead of the proper one,