problem with multiple SwitchView / problem with print to pdf-file - InfoPath Dev
in

InfoPath Dev

problem with multiple SwitchView / problem with print to pdf-file

Last post 03-09-2009 05:56 AM by jb.mulder. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-13-2008 03:02 AM

    problem with multiple SwitchView / problem with print to pdf-file

    Hi,

    I have an infopath form with 20 print views. I want to print this views automatically to pdf files (see below). Every View is printed to it´s own pdf file.  With the second view change appears the following error message:

    ("Von InfoPath können keine ansichtsbezogenen Objektmodellaufrufe ausgeführt werden. Die Ansicht ist nicht bereit") 

    error-message: "No view-related object model calls can be explained by InfoPath. The view is not ready"    (my translation!)

    :

    this.ViewInfos.SwitchView („View03“);

    this.Print();                                                //  print pdffile03.pdf

    :

    this.ViewInfos.SwitchView („View17“);         // Error: The view is not ready!!!!!!!!!!!!!!!!!!!!

    this.Print();                                                //  print pdffile17.pdf

    :

    this.ViewInfos.SwitchView („View18“);

    this.Print();                                                //  print pdffile18.pdf

    :

    PDF Software: 

    Which software can you recommend to me?
    I need PDF software which should be able to specify file name. (Sample Code?)

    Thanks for your help 

     

  • 02-13-2008 06:18 AM In reply to

    Re: problem with multiple SwitchView / problem with print to pdf-file

    Typically you would want just one print view, and in your case very large. Use page breaks to keep the pages seperate.

    I believe the issue is with the switching of the views. I have seen this before where trying to change to multiple views. I am assuming that you can get one view to work.

    We use CutePDF writer, it is a free PDF creator.  I am not sure what the options are for automation.

  • 02-13-2008 07:25 AM In reply to

    Re: problem with multiple SwitchView / problem with print to pdf-file

    Thanks for your answer!

    Yes, I can get one view to work (the first SwitchView and the following print).

    Then I have a problem with the second SwitchView - it failed.

    Program source code:

    --------------------

    SwitchView    //  it works

    this.Print        //  it works and the first pdf file is created

    SwitchView    //  it failed  (error-message: view not ready)

    --------------------

    Example for Test:

    public void buttonx_Clicked(object sender, ClickedEventArgs e)

    {

        this.ViewInfos.SwitchView("View1");     // it works 

        this.ViewInfos.SwitchView("View2");     // failure -  why?

    }

    I need a multiple SwitchView, because I need for each view it´s own pdf file.  (Sequence: Switch - Print - Switch - Print - Switch - Print - ...)

    With page breaks I cannot generate several pdf files - or?

    Perhaps I need for this the following hotfix?

    http://www.infopathdev.com/blogs/agni/archive/2006/04/24/Improve-Rendering-Performance-for-a-Slow-View.aspx

    Cheers

  • 03-09-2009 05:56 AM In reply to

    Re: problem with multiple SwitchView / problem with print to pdf-file

    InfoPath can not switch views more than once within the same method call.

    Maybe you could try putting the view switch logic in an separate method and then call that method.

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