Pergunta

InfoPath form web part can be used to fill out a published InfoPath form (a new instance). I want to use the web part to open an already filled form to do some modifications. Can this be achieved (using this web part or any other solution)?

The reason behind this requirement is that I want to have multiple web parts in my page, content editor, query string filter and InfoPath web part. I want to use these to open a form (new or existing) in a certain mode / view.

Edit
I will try to simplify:
1- I have an InfoPath form that is saved in a SharePoint library. The form have multiple views.
2- Using a URL like http://mySite/myPage.aspx?form=myForm-20110613.xsn&view=View3, I want the form myForm-20110613.xsn to be opened and switched to View3.

How can I achieve this (preferably without writing any code)?

Foi útil?

Solução

I have done that using a custom application ASPX page. The page has an Iframe that I set its src to the viewing URL as follows

private void SetIFrameSource_View(HtmlControl frame, string libraryName, string formName)
{
    string formServerPage = "http://servername/_layouts/FormServer.aspx";
    string xmlLocation = string.Format("/{0}/{1}", libraryName, formName);
    string source = "http://servername/SitePages/Home.aspx";
    frame.Attributes["src"] = string.Format("{0}?XmlLocation={1}&Source={2}&DefaultItemOpen=1", formServerPage, xmlLocation, source);
}

Outras dicas

What version of InfoPath are you using? With 2013, you can insert a rule on form opening with no conditions and add action "switch views" to the view you prefer.

Click Data Form Load New Add Action Switch Views (select view).

Create a page and add InfoPath form webpart and save the page. Do not configure any properties for the webpart (library name or content type). Navigate to the page including your existing InfoPath form XmlLocation. eg. http://siteurl/yourpage.aspx?XmlLocation=/sites/teamsites/TestFormLibrary/aaaaa.xml

https://devdotnotes.wordpress.com/2012/01/29/sharepoint-caculated-column-and-hyperlink-no-workflow-or-script-needed/

follow this link if you want to build this url dynamically in your view.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top