I am having a problem with exporting to PDF from InfoPath 2010 Filler. It appears that the call to CurrentView.Export("c:\Temp",ExportFormat.PDF) is not executing until I exit the method that it is called from.
The exported file (and the progress bar) is not appearing until I exit the method, and hence the file is not available to subsequent code.
Is this a known problem?
Has anyone found a solution?
I am trying to export a PDF file and then send the filename to a custom web service that will do some further processing, but the web service cannot find the file as it is called in the same method and the file is not being created until I exit the method.
Dim formAssessmentNo As System.Xml.XPath.XPathNavigator = nav.SelectSingleNode("/my:AddressChangeData/@my:AssessmentNumber", Me.NamespaceManager)
Dim formPdfFilename As System.Xml.XPath.XPathNavigator = nav.SelectSingleNode("/my:AddressChangeData/my:PdfFilename", Me.NamespaceManager)
Dim fileName As String = String.Format("{0}.pdf", formAssessmentNo.Value.ToString)
Dim filePath As String = String.Format("{0}\{1}", "\\ServerName\Testing", fileName)
formPdfFilename.SetValue(filePath)
If System.IO.File.Exists(filePath) Then System.IO.File.Delete(filePath)
Me.CurrentView.Export(filePath, ExportFormat.Pdf)
Dim ws As WebServiceConnection = Me.DataConnections("SendEmailAttachment")
ws.Execute()