how to us tableau reports in c#.net

Posted by Plhkrishna under C# on 10/23/2017 | Points: 10 | Views : 560 | Status : [Member] | Replies : 1
hi,

i am dotnet developer,c#.net,requirement is developing tableau reports in c#.net,i want to work on Tableau reports in c#.net,
can any one gives me a sample for how to integrate Tableau in c#.net pls

.net developer


Responses

Posted by: Vedikaledange on: 12/27/2018 [Member] Starter | Points: 25

Up
0
Down
You will need:

Tableau Server
A separate web server, with some facility for dynamic web pages. Apache + PHP, or IIS + ASP.Net for example.
Visual Studio

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Permissions;
 
namespace Embedded_Tableau_Example
{
    [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
    [System.Runtime.InteropServices.ComVisibleAttribute(true)]
    public partial class Form1 : Form
    {
        int tab_count = 1;
        String username = ""; // Here you can get your username however you'd like
        public Form1()
        {
            InitializeComponent();
             
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
 
            string postData = String.Format("username={0}", username);
            byte[] Post = Encoding.UTF8.GetBytes(postData);
            string AdditionalHeaders = "Content-Type: application/x-www-form-urlencoded";
 
            var page_location = "http://{TableauServerLocation}/c_sharp_embed.php"; // HTTPS for security in final environment
            //webBrowser1.Navigate(page_location); // If using AD with automatic logon
            webBrowser1.Navigate(page_location, "_self", Post, AdditionalHeaders);
            webBrowser1.ObjectForScripting = this;
 
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            webBrowser1.Document.InvokeScript("pdfExport");
        }
 
        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
 
        }
 
        private void button2_Click(object sender, EventArgs e)
        {
             
            object[] args = { tab_count };
 
            webBrowser1.Document.InvokeScript("switchTab", args);
            tab_count++;
 
        }
 
        public void Test(String message)
        {
            MessageBox.Show(message, "client code");
        }
 
        private void button3_Click(object sender, EventArgs e)
        {
            webBrowser1.Document.InvokeScript("returnJSONString");
        }
 
        public void retrieveJSON(String json)
        {
            MessageBox.Show(json, "Stringy JSON");
        }
 
    }
}


DOT NET

Plhkrishna, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response