Greetings, I am in desperate need of your help, I need to be able to export to pdf two views, one input other summary format - InfoPath Dev
in

InfoPath Dev

Greetings, I am in desperate need of your help, I need to be able to export to pdf two views, one input other summary format

Last post 11-21-2013 12:42 AM by Nana111. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-21-2013 10:25 PM

    Greetings, I am in desperate need of your help, I need to be able to export to pdf two views, one input other summary format

    I have looked and done some searching fo the last month and half. I have visited many site, this one has been the closet.

    I am not sure if this is possible, it seems simply enough This is what my outcome should be.

     I have one main where data is entered. then the infoormation is copied to another view, I have that working fine.

    but that view does not need to be viewed but it most accomapy the first view.

    So I have two pdf one is the meat and patatoes the other is the summary.

    I tried to use the print multple but it only exports the main view. If I do all views it is no good cause then I have to go and remove the summary.

    The code is repeatative what I mean is the code will be cloned, I just have to get it working.

    I have about 308 views to apply this to, the views are different but the context is the same.

    It will be a copy and paste for the code. I can take either VB or C# I am not fussy.

    I have it partially working in C# here is my test code.

    I want to be able to select the view and export using the this.currentview, but I want to use a variable for currentview, so tell IP to export this view instead, is that possible? here is a sample code:

  • 05-21-2013 10:47 PM In reply to

    Re: Greetings, I am in desperate need of your help, I need to be able to export to pdf two views, one input other summary format

    I was trying to make the code eaiser to read:

    I want to be able to export two views one after the other, I want to define my export view via variable. Or type it in if possible.

    like this.actionview("this view is going to pdf" + ,,,,,,)

    Sorry for the double post, I don't know how to delete the first:
    public void CTRL11_5_Clicked(object sender, ClickedEventArgs e)
            {
                // Write your code here.

                {
                    // declare variables:
                    string fileName;
                    XPathNavigator nameNode;
                    string viewName = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:view2", NamespaceManager).Value;
                    nameNode = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:field1", NamespaceManager);
                    fileName = nameNode.Value + ".pdf";

                    MessageBox.Show("Loading the view: " + this.CurrentView.ViewInfo.Name);
                    MessageBox.Show(this.CurrentView.ViewInfo.Name);
                    MessageBox.Show(this.CurrentView.Window.Caption);
                   
                    MessageBox.Show("Going to: " + viewName);// Jumping to new view for exporting
                    ViewInfos.SwitchView(viewName);
                    // attempt to use a variable and export to pdf. Trying to replace current with variable viewname
                   

                    //Do the work -- notice we use the variable fileName as part of the path for the file.
                   //this.viewName.Export(@"C:\moc\" + fileName, ExportFormat.Pdf);


                }

            }

            public void CTRL4_9_Clicked(object sender, ClickedEventArgs e)
            {
                // Write your code here.

                string viewName3 = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:View3", NamespaceManager).Value;
                MessageBox.Show("Going to: " + viewName3);// Jumping to new view for exporting
                ViewInfos.SwitchView(viewName3);
            }

  • 11-21-2013 12:42 AM In reply to

    Re: Greetings, I am in desperate need of your help, I need to be able to export to pdf two views, one input other summary format

     HI there

    That sounds a little bit complicated for me.I am new here ,and i am not so good at computer.Actually ,i am not so clear about your question.I just know that you can try to a pdf processing program to do that.

    There are many powerful pdf program.They offer powerful function for  pdf issues.Best wishes.

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