Export View to not working on XPS

  • Thread starter Mikael Andersson
  • Start date
M

Mikael Andersson

Hi

I have a form code connected to a button to automate creation of a xps file
from a view.

public void CTRL158_30_Clicked(object sender, ClickedEventArgs e)
{
string id =
root.SelectSingleNode("/my:myFields/my:LabTest/@my:Id",
NamespaceManager).Value;

Microsoft.Office.InfoPath.View rptView = this.CurrentView;

rptView.Export(@"\\Myserver\FTC LabTest Reports\Reports\" + id +
".xps", ExportFormat.Xps);
}

My problem is that this works fine on Vista and Windows 7 but not on XP.
(Same user and office version etc.)

The exporting seems to work ok (export message comes up ent the progress bar
gets all blue)

Then I get this error message on XP:

InfoPath has encountered an error. The operation failed.
InfoPath cannot export the form.
at Microsoft.Office.Interop.InfoPath.SemiTrust.View.Export(String
bstrURL, String bstrFormat)
at
Microsoft.Office.Interop.InfoPath.SemiTrust.ViewObjectWrapper.Export(String
bstrURL, String bstrFormat)
at Microsoft.Office.InfoPath.Internal.ViewHost.Export(String
fileLocation, ExportFormat format)
at JBTLabTest.FormCode.CTRL158_30_Clicked(Object sender, ClickedEventArgs
e)
at
Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)


Any help would be appreciated

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top