R
rzwahr
I am trying to accomplish the following things in infopath and have had
problems: In a nutshell here's what I want to do:
User clicks a "Print Out View A" button I have created and that view
gets displayed as a print preview, they select the printer they want,
print it, and are still on the default view when they are done. No
switching around (at least manually) between views.
This, at least to me thus far, is WAY easier said than done. It seems
like this should be very simple though.
The way it seems this should work is, in the code, you could change the
designated print view to Print View A, print the form (using the
PrintOut method), then change the designated print view back to its'
default. I have several different print views depending on the
audience, so I have to be able to toggle between print views, based on
which view the user wants to print and which button is pressed. It
seems that this should be easy, and my first attempt was to try and
programmatically switch views, print, then switch back. I attempted to
use SwitchView to go to Print View A, issue a PrintOut, then SwitchView
back to default view. As you may guess, that bombed with the "view not
ready" error, which I still don't understand. Infopath itself switches
views with the click of a button, so why can't I make my form do it???
Anyway, the only way I can get infopath to switch views aside from
clicking the View button and selecting the desired view, is to attach a
switch view rule to a button. I'd love to know how to do all this in
pure code, but I am a rookie when it comes to this stuff. The way the
documentation talks about SwitchView, it should just switch your view
if you use it. This isn't the case, and I can't for the life of me
figure out how to get the view "ready" so I can switch to and from it.
How do I accomplish what I am trying to do - I am positive it can be
done.
problems: In a nutshell here's what I want to do:
User clicks a "Print Out View A" button I have created and that view
gets displayed as a print preview, they select the printer they want,
print it, and are still on the default view when they are done. No
switching around (at least manually) between views.
This, at least to me thus far, is WAY easier said than done. It seems
like this should be very simple though.
The way it seems this should work is, in the code, you could change the
designated print view to Print View A, print the form (using the
PrintOut method), then change the designated print view back to its'
default. I have several different print views depending on the
audience, so I have to be able to toggle between print views, based on
which view the user wants to print and which button is pressed. It
seems that this should be easy, and my first attempt was to try and
programmatically switch views, print, then switch back. I attempted to
use SwitchView to go to Print View A, issue a PrintOut, then SwitchView
back to default view. As you may guess, that bombed with the "view not
ready" error, which I still don't understand. Infopath itself switches
views with the click of a button, so why can't I make my form do it???
Anyway, the only way I can get infopath to switch views aside from
clicking the View button and selecting the desired view, is to attach a
switch view rule to a button. I'd love to know how to do all this in
pure code, but I am a rookie when it comes to this stuff. The way the
documentation talks about SwitchView, it should just switch your view
if you use it. This isn't the case, and I can't for the life of me
figure out how to get the view "ready" so I can switch to and from it.
How do I accomplish what I am trying to do - I am positive it can be
done.