PrintOut() Question - InfoPath Dev
in

InfoPath Dev

PrintOut() Question

Last post 10-06-2008 02:21 AM by feliks. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 08-28-2007 06:43 AM

    PrintOut() Question

    Hi. I am extremely new to Infopath, so this question probably sounds pretty uninformed, but I have looked around and have not been able to get anything to work.

    What I am trying to do is to have a button that, when pressed, submits the form then prints it out.  I wrote a web service that accepts the form data, and processed it before my customers added this new requirement on.  I am doing the programming in VB and this is a Web Enabled Form. 

    My Code:

    Public Sub CTRL84_5_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
        Me.Submit()
        Sender.PrintOut()

    End Sub

    Neither of these lines of code work however, and I'm not sure what I should be doing.  I see every where people using thisXDocument.PrintOut(), but when I try that it does not recognize thisXDocument.

    Thank you in advance

  • 08-28-2007 09:17 AM In reply to

    First and foremost your form must be fully trusted for printing to work. thisXDocument.PrintOut() is what works so I'm not sure why it's not being recognized. I would check to make sure you're importing the right namespaces. Comment out your submit and see if that works.

    Shaun Nieves
    Sharepoint Manager
  • 08-28-2007 10:26 AM In reply to

    Imports Microsoft.Office.InfoPath
    Imports System
    Imports System.Xml
    Imports System.Xml.XPath

    Those are the name spaces I am importing.  It cannot find thisXDocument in any of them, nor have my guesses at what it is been fruitful.  I'm sorry to be asking such uninformed questions, but I am frustrated because printing should be one of the easiest things to do I would think.  As for the trust level, I had read earlier that I needed to do that, so that isn't the issue.

    Any help is greatly appreciated.

  • 08-28-2007 11:56 AM In reply to

    Do you have this installed? http://www.microsoft.com/downloads/details.aspx?familyid=7e9ebc57-e115-4cac-9986-a712e22879bb&displaylang=en

     By default when you create a vs solution it creates Private thisXDocument As XDocument by default. If you have it installed try adding it manually. Hope that helps..

     

    Cheers!

    Shaun Nieves
    Sharepoint Manager
  • 08-28-2007 01:53 PM In reply to

    my first guess would have been that you are using 2007 where thisXDocument doesn´t exist but xPathNavigator
    Listen to Motörhead cos they play Rock'n Roll :)
  • 08-29-2007 10:15 AM In reply to

    nukkumatti:
    my first guess would have been that you are using 2007 where thisXDocument doesn´t exist but xPathNavigator

    I hadn't realized this mattered.  Yes, actually I am using Infopath 2007.  Is that why nothing I try works?  It is possible that some one could tell me how to do it in 2007 or point me at a good reference?

  • 08-30-2007 12:37 AM In reply to

    Yes that could be the reason why nothing you try works :) . I haven't worked with 2007 a lot myself but what usually helps is to just check the object model and you should find the method you need to do your printing. just keep in mind as mentioned before already your form needs to be in full trust mode.
    Listen to Motörhead cos they play Rock'n Roll :)
  • 10-06-2008 02:21 AM In reply to

    • feliks
    • Not Ranked
    • Joined on 10-06-2008
    • Posts 1

    In the object model i found no method comparable with "PrintOut()".

    Is there another useable solution for realising a "print"-button in 2007 by now ? 

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