Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / August 2007

Tip: Looking for answers? Try searching our database.

thisXDocument is not declared?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AirDuster101 - 14 Aug 2007 09:48 GMT
Hi,

I am using InfoPath 2007, trying to add print function to my browser form
(InfoPath Services).   I am writing custom code in VB.NET.  However, I don't
know where and how the "thisXDocument" should be declared in order to call

thisXDocument.PrintOut()

Thanks

AD
K.Ramana Reddy(GGK Tech) - 14 Aug 2007 10:24 GMT
Hi,

when you create the project using visual studio, by default it will defined
public void _Startup.

public void _Startup(Application app, XDocument doc)
        {
            thisXDocument = doc;
            thisApplication = app;

            // You can add additional initialization code here.
        }

there is no need to define.
Signature

k.Ramana Reddy
http://www.GGKtech.com

> Hi,
>
[quoted text clipped - 7 lines]
>
> AD
AirDuster101 - 14 Aug 2007 10:34 GMT
Hi, but I am getting the error message that " name 'thisXDocument' is not
declared"... where should I look for public void_Startup?  FYI, I am not
using full version of visual studio, just VSTO. I didn't have to create a
"project"...

AD

> Hi,
>
[quoted text clipped - 22 lines]
> >
> > AD
S.Y.M. Wong-A-Ton - 15 Aug 2007 11:32 GMT
In InfoPath 2007, this would be the Print() method or this.Print() if you're
using C# and Me.Print() if you're using VB.NET, but this method is not
available if your form template is browser-compatible, so cannot be used in
browser forms.
---
S.Y.M. Wong-A-Ton

> Hi,
>
[quoted text clipped - 7 lines]
>
> AD
AirDuster101 - 15 Aug 2007 16:38 GMT
... I see.  My form is browser-enabled and it has to stay that way.  I notice
I can enable the "Print View" function on the form, but I don't want it to
show on every view of my form and when I click on it to print after data
entry, it keeps on messaging that you can't print until you click on the OK
to update. I don't have an ok button on the form.   Is there anyway to
control this Print View function from programming code?

Much appreciation...

AD

> In InfoPath 2007, this would be the Print() method or this.Print() if you're
> using C# and Me.Print() if you're using VB.NET, but this method is not
[quoted text clipped - 14 lines]
> >
> > AD
S.Y.M. Wong-A-Ton - 17 Aug 2007 02:21 GMT
If you're referring to the "Print View" button on the toolbar of a form
running in Forms Services, you cannot get to it through code from within the
form itself, since it is driven by JavaScript and print functionality in a
component of Forms Server. I saw the OK you were referring to. That looks
like a bug to me. If you click OK and then click Print View again, it works.
It seems like it detects changes made on the form and somehow cannot print
without doing some update (a Postback to probably update the ViewState),
which it does when you click OK.

If you want to print a form from within the browser and not use the standard
print functionality offered by Forms Services, you will have host your forms
in your own ASP.NET page, add a button to your ASP.NET page, and write code
behind that button to print the form. I haven't yet found an easier way to do
it...
---
S.Y.M. Wong-A-Ton

> ... I see.  My form is browser-enabled and it has to stay that way.  I notice
> I can enable the "Print View" function on the form, but I don't want it to
[quoted text clipped - 25 lines]
> > >
> > > AD
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.