我想要运行tabcmd.exe实用程序来在Tableau服务器上发布视图。手动操作步骤如下,日志文件将在以下位置更新每个步骤:
在同一会话中,我必须按照一个接一个的顺序手动执行这些步骤:"C:\Users[UserName]\AppData\Roaming\Tableau\tabcmd.log"
- 运行 cmd.exe
- 使用命令 tabcmd login -s "http:/sales-server:8000" -t Sales -u administrator -p p@ssw0rd! 登录
- 使用命令 tabcmd createproject -n "Quarterly_Reports" -d "Workbooks showing quarterly sales reports." 创建项目名称
- 使用命令 tabcmd publish "analysis.twbx" -n "Sales_Analysis" --db-user "jsmith" --db-password "p@ssw0rd" 发布视图
- 使用命令 tabcmd refreshextracts --workbook "My Workbook" 刷新
- 使用命令 tabcmd logout 退出登录
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");
}
}
我能成功登录,但无法继续进行后续步骤,我不知道该如何进一步操作,因此希望得到帮助。 提前感谢!