Export multiple views to .MHT - InfoPath Dev
in

InfoPath Dev

Export multiple views to .MHT

Last post 12-14-2011 06:32 AM by rcant. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-14-2006 09:56 AM

    Export multiple views to .MHT

    I am trying to export 2 views to separate .MHT files. I can export the first view, then I call 'View.SwitchView' and in the 'OnSwitchView' event I can then export the second view, but I can't seem to then switch back to the main view, I get the following error:

    'InfoPath cannot execute any view-related object model calls. The view is not ready.'

    Is there a way I can export a view without first call 'SwitchView'? If not, is there a way to call 'SwitchView' several times in a row without getting this error?

    Thanks!
    p.s. - I am doing this in a button OnClick event
  • 04-14-2006 09:31 PM In reply to

    Re: Export multiple views to .MHT

    From what I know, you cannot call SwitchView() twice in the same method. You could probably do something really tricky with an OnAfterChange event, but otherwise I do not know what advice to give you.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-16-2006 12:31 AM In reply to

    Re: Export multiple views to .MHT

    Have you tried using rules and actions to do this:
    1. Create a button for your double export (if you don't have one)
    2. Add a rule to the button with a condition that checks "The Expression" where the right-hand side calls xdExtension:ExportViewAsMHT()
    3. Set the action to switch to the new view
    4. Add another rule that does the same thing and swiches back in the action

    Not sure this will work, but it's worth a try.
    Patrick Halstead
    Project Manager at Qdabra
  • 12-14-2011 06:32 AM In reply to

    • rcant
    • Top 500 Contributor
      Male
    • Joined on 03-24-2008
    • Rochester
    • Posts 27

    Re: Export multiple views to .MHT

    Has anyone figured out a nice Jscript solution to this issue? 

     I have been trying with out any real positive results

    Similar to above i want to Export "View 1" to MHT from a button click in "View 2".  (and perahps export a few other views from the same click)

     

     

    Thanks

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.