Tableau Rest Api special characters - api

I'm using Tableau Rest API to retrieve the list of workbooks from Tableau Server and show the list on a webpage. The problem is that special characters in workbook names have invalid encoding (or at least encoding that I do not expect).
Name set in Tableau server web UI:
Book ó
Name retrieved from rest API:
Book ó
As far as I can tell this issue occured after we upgraded Tableau server to 2018.1.
Is there a way to specify the encoding in Tableau Rest API? Or determine the encoding used to store the workbook name in Tableau Server web UI?

Turns out that after Tableau Server was updated to 2018.1 C# WebClient needs to have encoding set explicitly to UTF8 to handle special characters properly when querying Tableau REST API.

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

How can I use Google Translate API to Translate text in Microsoft Excel

I am hoping someone here can help me with the google translator API. I have an excel file with about 80k rows, and I am trying to build a macro where it translates everything in a column except for the first row. As an example I have six columns in Microsoft Excel such as the below
Excel Column Headers
Column A = Name
Column B = Address
Column C = Phone Number
Column D = Request
Column E = Google Translated Request
Column F = Notes
and I want to use the google translator API to take what is in column D and translate it to column E without translating what is in the first row as those are my column titles. Is this possible to do within an Excel Macro using the google translate API, and if so how would one do this?
In order to translate content from your Excel spreadsheets, your options would be one of the following:
Use built-in Microsoft text translation
Write a VBA script that communicates with the Microsoft Text Translator API
Write a VBA script that communicates with the Google Translation API
Depending on the use case and how confident you are with Microsoft's translation feature, I'd probably use the built in solution as it would likely be the simplest route. Depending on the version of Excel you have, it could even be built into the menus.
If not, you could use VBA script to use the Microsoft Text Translator REST API as suggested by #sysmod in a previous answer. As I'm not entirely familiar with that API, I'd strongly recommend reading the linked documentation.
If you prefer to use the Google Translation API, there is a REST API that you can use as linked above. You'd essentially need to use VBA script to issue a GET or POST request to https://translation.googleapis.com/language/translate/v2.
Keep in mind that in the case of both REST APIs (Microsoft and Google alike), you would need very specific query parameters as shown in their respective linked documentation and you'd also need to authentication your project/application using a subscription key or API key. This is the only way for Microsoft of Google to keep track of how much free quota your application has used.
Built into Excel 2016:
https://www.microsoft.com/en-us/translator/excel.aspx
Not Google, but using the free Microsoft Azure API:
https://sysmod.wordpress.com/2017/01/20/vba-code-for-microsoft-text-translator-api/
Solution without VBA:
Using Power Query in Excel to Translate Data Using the Google Translation API
https://www.mrexcel.com/board/excel-articles/using-power-query-in-excel-to-translate-data-using-the-google-translation-api.33/

ColdFusion and saving Chinese chars and changing Admin settings

I need to be able to save Chinese chars in my active database with ColdFusion 9
I have already figured out how to do it set the field types to NVARCHARS and NTEXT.
I have checked off Enable High ASCII characters and Unicode for data sources configured for non-Latin characters under the Datasources section.
It works great but... here is the question.
Changing the option Enable High ASCII characters and Unicode for data sources configured for non-Latin characters - will this create any other downstream issue with the current application? We will need to update the database structure - I am not sure what effect this option will have to my legacy code.
That should not have any effect on your database or your code. It's just a setting on how the application server (coldfusion) communicates to your database server.

Need information on SQL Injection in ASP.Net MVC 4

I have a report generated by IBM appscanner tool. It scanned my mvc application and on some urls it gave me high alerts. I'm trying to figure out how to perform parameter manipulation on my page like above information provided in the report to find the issue.Example of the link on which the above report is based : localhost:46887/Myproject/country/edit/1
As a rule of a thumb:
Aways cast the values (provided through Request) to concrete type which are you using in the application logic.
If you are using ORM/ODM to access the data storage you recieve built in SQL injection protection :).
This tool may be examins only the the query string and just assumes that injection is possible.

How do I access netsuite data using SQL language

A company uses netsuites to make purchase orders and store sales information. The only way this company is able to access this information at the moment is through building netsuites reports
Is there a way SQL language could be written to access the netsuites data as some of the questions asked by the business need something a bit more complex than what netsuites reporting provides - and sound very easy using SQL language
I have experience in Oracle, mysql, and many other SQL languages so I would like to know how to set up a connection to the companies netsuites data so I can help write custom queries
Netsuite has SuiteAnalytics Connect, which is ODBC. It can be downloaded from a link at the very bottom the home screen of your Netsuite account.
After installation of the application bundle and connecting it to your Netsuite, you can write ORACLE SQL queries via Excel, Access, etc. My experience is that Netsuite uses Oracle SQL in ODBC queries and in Saved Search custom queries.
The way I understand it, the ODBC driver is a separately priced item from NetSuite. Once you have that, you could use Excel, Access, Crystal Reports or anything else that can use the ODBC driver to read the data and write queries against it.
The normal way to access NetSuite data is with SuiteScript -- javascript code that uses the nlapi* calls to get to the data.
You can access Netsuite backend using a number of different tools and it allows running Oracle SQL directly.
Netsuite provides JDBC, ADO.NET and ODBC if it was included in your licensing purchase. You can find the downloads from the main menu - lower left hand of the screen in Settings - Set Up SuiteAnalytics Connect.
ADO.net however is pretty worthless in SSIS as it doesn't allow parameter mapping or SQL from a variable value. I have yet to get the ODBC driver to work correctly - it can connect and show columns of a table but it won't validate saying "The ODBC Source.Outputs[ODBC Source Error Output].Columns[...] on the error output has properties that do not match the properties of its corresponding data source column."
The other options I'm looking into are Cozyroc and Kinsgwaysoft adapters for Netsuite. You could also do SOAP or REST connections if desired.
I've not used this, but there should as of 2014.2 there is an ODBC driver available for read access.
http://www.netsuite.com/portal/landing/2014-2/suiteanalytics.shtml
As previously mentioned, if you have it licensed you can download the ODBC driver from the Netsuite application. I tested some other adapters but found Netsuite's at least as good as the competitors and they provide timely security updates to the drivers as well as both 64 and 32 bit versions.
There are also metadata browsers that are on the net (example is URL below), the type of browser being based on which kind of access you are looking at (web services, verses ODBC, etc).
https://system.sandbox.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_2/odbc/record/account.html
Within the application GUI there is information you need to connect using their ODBC connection (you need the account id and the role id). The URL is just odbcserver.xxxx.netsuite.com where xxx is specific to your environment you are accessing. Note that other adapters such as Cozyroc, etc. require the admin to setup connections in Netsuite for those.
Here is a list of the main metadata tables:
OA_FKEYS
OA_TABLES
OA_COLUMNS
In addition, note that the URL above does NOT include customization. Plus its not easily consumed by automation tools. But Netsuite provides a set of metadata views within the repository which you can use ODBC to pull from which includes all keys - foreign and primary. AND it does include customizations! I built simple set of ETL jobs that use standard ADO.NET driver within SSIS and the ODBC DSN to pull all the metadata and then use BIML to automatically generate all the extract ETL and related staging tables. You can also easily then use the metadata to detect changes in the underlying database.
Let me know if I can be any help with doing any of this.
There are 3rd party tools, like CData ODBC Adapter for NetSuite: http://www.cdata.com/drivers/netsuite/odbc/ . This tool allows you to run standard SQL against the NetSuite API. Note that the NetSuite API presents a very different data model from that of the native NetSuite ODBC.
With this tool, you install in onto your machine (Win in my case) and then after you configure the driver, you can run SQL against it (the driver config is where you specify your NS credentials, etc.).
It revolutionizes access to NetSuite data IMHO.
Download the Netsuite ODBC drivers, set up your DSN locally with server/credentials, Use SSIS pkgs to automate data extract and load onto you local DB. Use ADO.NET drivers if preferred. Then utilize those tables to create/deliver your complex reports using SQL (stored procedures) and Reporting Services. This will require SQL Standard license at minimum though.
Only API call can access the NetSuite data
You can't access to Netsuite data using sql language.
The only way to gain access to Netsuite from third party systems is to use SOAP request or PHP toolkit.