I want to run tabcmd.exe utility to publish views in tableau server. Manual step to do this is as follows, log file will be updated for every step in the location
"C:\Users[UserName]\AppData\Roaming\Tableau\tabcmd.log"
In the same session I have to perform this steps manually one by one order
- Run cmd.exe
- log in by using the command tabcmd login -s "http:/sales-server:8000" -t Sales -u administrator -p p@ssw0rd!
- Create Project Name using the command tabcmd createproject -n "Quarterly_Reports" -d "Workbooks showing quarterly sales reports."
- Publish views by using the command tabcmd publish "analysis.twbx" -n "Sales_Analysis" --db-user "jsmith" --db-password "p@ssw0rd"
- Refresh by using the command tabcmd refreshextracts --workbook "My Workbook"
- Log out by using the command tabcmd logout
Now I am trying to automate this steps from my .Net win form, so I used below code as a try and It is not working.
String path = @"C:\Program Files (x86)\Tableau\Tableau Server\7.0\bin\tabcmd.exe"
ProcessStartInfo startInfo = new ProcessStartInfo ();
startInfo.FileName = "\""+path+ "\"";
startInfo.Arguments = String.Format("login -s http://Server1:8000 --db-user "jsmith" --db-password "p@ssw0rd");
startInfo.UseShellExecute = false ;
startInfo.CreateNoWindow = false;
startInfo.WindowStyle = ProcessWindowStyle.Normal;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardError = true;
Process p = new Process();
p.StartInfo = startInfo;
p.Start();
using (StreamWriter sw = p.StandardInput)
{
if (sw.BaseStream.CanWrite)
{
sw.WriteLine("createproject -n \"MyProject\" -d \"MyProjectWorkbook\"");
//sw.WriteLine("My next Command");
//sw.WriteLine("My next Command");
}
}
I am able to log in successfully and I am not able to proceed consequent steps further, I have no clue how to proceed on this further, so I am looking forward some help on this. Thanks in advance!