infopath 07 print multiple views issue. - InfoPath Dev
in

InfoPath Dev

Qdabra® Training

Use our Google Custom Search for best site search results.

infopath 07 print multiple views issue.

Last post 06-22-2010 01:08 PM by Joemanc. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-28-2009 12:25 PM

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

    infopath 07 print multiple views issue.

     

     Have a business need that I am having a difficult time addressing.

    We have a large form template that we need to allow the user to print multiple views. However, we need the views that are printed to be printed based on selections in the form.  i.e.. Check  Box "A" than view 2 gets printed; Check Box "B" then view 3 gets printed. Check both then both get printed and so on...  We currently do this by setting all views to print by default in the print multiple views dialog; Then we just hide all the content in a view so it wont print based on the check box is selected or not..(i.e. if check box "A"  is blank then  sectionview1 is hidden which hides all content in that view and therefore the view does not get printed) However, our form is very large with 70 plus views. So having all the views to default to be printed makes it VERY VERY slow for the print dialog box to appear even though the majority of the views are blank(content is hidden via conditional formatting) so only the few views with content print. 

     So my question is there anyway to have the views chosen more dynamically. We really want the print dialog  >Multiple views > Settings functionality in the form and not in the print dialog.

     Please help!!!

    Regards

     

    rcant

     

  • 06-10-2010 12:09 PM In reply to

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

    Re: infopath 07 print multiple views issue.

     anyone have any thoughts on this issue above??  still no resolution

  • 06-21-2010 09:54 AM In reply to

    Re: infopath 07 print multiple views issue.

    rcant- I'm having the same issue as you are. If I find anything, I will post it here.

  • 06-21-2010 11:19 AM In reply to

    Re: infopath 07 print multiple views issue.

    Under View, Print Multiple Views, you need to check all the Views that can be printed. I unchecked 'Use these settings as the default settings for printing the form'. 

    In code under a button, if you Switch Views to your print view and then call the Me.Print command, then InfoPath will Print the view you switched to and only that view(see code below). The only problem with this is that in that same code, you can't switch back to the view that holds/called the me.print command as you get the error message: "InfoPath cannot execute any view-related object model calls. The view is not ready." A quick search on this error message doesn't yield anything promising.

    I'll keep plugging away and see if I can come up with a better way. Otherwise, I may just force the user to hit a 'Back' button on the Print View.

    'switches to your Print View

    Me.ViewInfos.SwitchView("PrintView")

    'Prints out your Print View.

    Me.Print()

    'Can't do this - you get error message

    Me.ViewInfos.SwitchView("SelectExistingRecord")

  • 06-22-2010 01:08 PM In reply to

    Re: infopath 07 print multiple views issue.

    I came up with a solution. This is for 2 views.

    Under the View Properties, then Print Settings, make sure you have set the view that is your Print View for each of your views.

    Under the Toolbar option View, Print Multiple Views, I no longer have any views checked.

    Under a button that prints 1 of the views, you simply need Me.Print.  That's it.

    Under a button that prints my other view, I switch to the view that I would like to print, then call Me.Print. Now we need to switch back to the calling view, where we were getting the error message.

    To be able to switch back, you need to write a little event handler. I have posted the code at the bottom of this thread:

    http://www.infopathdev.com/forums/p/533/1252.aspx

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