0

I'm developing a GUI for Infopath. I'm using Microsoft Visual Studio Tools for Applications with C# as developing language. I have two views in my project, one is the result of the other. I'm getting problem with print button (as PDF): I'm trying to print the resulting view (modified over the first) from the editing one. What I got until now is a code that prints the current view. How can I print the second one !

public void PrintBtn_Clicked(object sender, ClickedEventArgs e)
    {
         this.CurrentView.Export("TestFileName.pdf", ExportFormat.Pdf);
    }

Thanks. Best regards.

4

1 回答 1

1

看起来 Export 方法仅在 View 对象上可用,不幸的是 InfoPath des 不会为您公开视图集合。我认为你最好的选择可能是切换到你想通过打印的视图

ViewInfos.SwitchView("view name");

然后,您可以调用导出。最后,如果需要,您可以切换回上一个视图...

我希望这会在导出过程中为用户打开第二个视图片刻,但我无法测试它,因为我在机场:p

于 2013-10-18T01:56:42.770 回答