2017-09-27 93 views
1

我使用水晶报表创建PDF文件。该报告正在成功导出和创建。但是,如果这样做,我需要我的WPF应用程序自动打开给指定的路径报告:C#从WPF打开PDF文件

string path = svfl.FileName; <--SaveFileDialog 
//somecode here 
report.Export(); 


if (File.Exists(path)) 
{ 
    System.Windows.Forms.MessageBox.Show(path); 
    File.Open(path, FileMode.Open); 
} 

该文件存在,因为它进入状态,但它不会打开。我错过了什么?

回答

1

试试这个:

if (File.Exists(path)) 
{ 
    Process.Start(path); 
}