我正试图强制本地Tableau Server从视图创建pdf。
当我使用以下命令通过tabcmd尝试时:
tabcmd export "Book1/AutheticationTypePerHour" --pdf -f "C:\Weekly-Reports.pdf"
它按预期工作。
当我尝试使用以下代码通过c#控制台应用程序进行操作时:
var process = new Process();
var startInfo = new ProcessStartInfo
{
WorkingDirectory = _workingDir,
WindowStyle = ProcessWindowStyle.Normal,
FileName = "cmd.exe",
RedirectStandardInput = true,
RedirectStandardOutput = true,
UseShellExecute = false,
Verb = "runas"
};
process.StartInfo = startInfo;
process.Start();
using (StreamWriter sw = process.StandardInput)
{
if (sw.BaseStream.CanWrite)
{
foreach (var command in commands)
sw.WriteLine(command);
}
}
string output = process.StandardOutput.ReadToEnd();
我的output
动词得到以下结果:
C:\\Program Files\\Tableau\\Tableau Server\\2018.1\\bin>tabcmd export Book1/AutheticationTypePerHour --pdf -f C:\\Weekly-reports.pdf\r\n
===== Continuing previous session\r\n
===== Server: http://localhost\r\n
===== Username: etian\r\n
===== Requesting 'Book1/AutheticationTypePerHour' from the server...\r\n
\r\n
C:\\Program Files\\Tableau\\Tableau Server\\2018.1\\bin>"
我的问题是为什么我缺少以下行:
=====正在从服务器请求“ Book1 / AutheticationTypePerHour” ... \ r \ n
=====已将Book1 / AutheticationTypePerHour保存到'C:\ Weekly-reports.pdf'\ r \ n
我可以直接通过Tabcmd获得
顺便说一句,我也没有收到我的pdf文件。