Using InfoPath Form Web Part to Display Existing Form (not a New One) - sharepoint-2010

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)?

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);
}

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.

You can do this with web part connections. Watch the following video for details: http://channel9.msdn.com/Blogs/laurhar/InfoPath-2010-Manage-data-in-your-SharePoint-Lists-using-the-InfoPath-Form-Web-Part?format=auto

Related

How to get html page content on button click in Xamarin.Forms?

I am creating an application in that it gets data from the web view that opens from the page and when the user enters data and then save into that then it saves data into the database using c#.
I have to try to make a local Html webpage and on click of button try to get the value of Html page content but when I try with that I am not able to do that.
I also try with the hosted web URL but can't do that.
I am using .Net standard 2.0.3
Can anyone look into this and suggest to me what should I to do to achieve that?

Custom Windows workflows with inforpath task forms-Switching Multiple views in same form

I am customizing a developed windows workflow by adding more views to the task form. And in Workflow.xml there are task forms defined as "Task0_FormURN,Task1_FormURN,Task2_FormURN,Task3_FormURN,Task4_FormURN,Task5_FormURN" (Tags were Removed here). And each of these forms works fine with current workflow.
But when I add a new view and increment the form as "Task6_FormURN" in workflow xml and set the "TaskType" property as "6" in the code behind of the workflowproperies it only shows the default view. The currently added view is not shown as the next form rather it shows the default view.
I already published and deployed the inforpath form and it is correctly updated in the central administration inforpath templates folder as well.I used Sharepoint 2007, Visual Studio 2008,Inforpath 2007.
Is there any configuration to be done in the Inforpath form to view the newly added view?
How can I get the connection between workflow and Inforpath view other than these?
Great Help Friends.
This can be done via a Rule. The Rule can be specified in the inforpath form Options section.
Form Options -> Open and Save ->Rules Section you can Define a rule to Switch Views depending on the TaskType.
Hope this will help you.

Create RDL(C) with WCF datasource for ASP.NET MVC2 using Visual Studio 2010?

We've got two C# apps, one providing several WCF web services and the other, an MVC 2 web app, consuming them. We plan for the web app to provide numerous reports based on existing or new operations on the web services, using the WebForms ReportViewer. We need to use a report designer tool - the one used for RDLC files would be just fine. We're using VS 2010 and deploying to Azure.
I've spent a couple of days looking for a way to do this, without much progress.
There seem to be two routes to accomplishing this:
Use the ReportViewer in local mode - create RDLCs as part of the web app and use a local data source, either XML feeds from the web services or objects that are part of the web app (perhaps the from the clients created when the web services are added to the project as web references).
Have the ReportViewer show reports from an SSRS report server. It seems like RDLs can have XML data sources, including WCF services.
The first would be simpler, especially as I'm not sure we're going to need the extra infrastructure of setting up a report server to meet other requirements. But I simply haven't been able to connect to either an XML or object data source.
The second way seems to have a number of problems in addition to the added infrastructure: I haven't gotten the XML connection to work yet here either, but it seems like a little more reading and trial and error should get me there. Also, there's no Visual Studio 2010 tool that I could find that supports this type of report - you need to create them in SQL Server Business Intelligence Development Studio. Which is a flavor of VS 2008. So there's some significant extra work to get this set up to work with TFS 2010 so we can include our reports in version control, builds and deployment.
(Then there's also the complications of integrating WebForms into an MVC app. But I think those are manageable).
Any suggestions for other approaches to these requirements would be most appreciated.
Or, if you've gotten this to work, hearing how you did would be great.
I was able to use ReportViewer in local mode and reasonably meet the requirements we had. I'll describe how to do this in case anyone looking at this question was having similar problems.
Outline:
Create a data access object for the report.
Create a report (RDLC file).
Create a WebForm to display the report using the ReportViewer
control.
One thing it took me a while to understand: There are two phases of creating a report that seem very similar but have different purposes. When creating the RDLC file, there is a "design-time" binding to a data object that allows you to associate placeholders in report controls (tables, lists, etc) with data elements. Then, later, when adding a ReportViewer to the WebForm, there is another data binding that will connect the report with an instance of a data object to pull the report data from.
I. Create a data access object.
In step II.5 below, you will need to choose the namespace of this object. Here it also took me a while to realize is that Visual Studio has a predetermined set of namespaces for this and you just have to work within this. Fortunately one of them is your MVC project's Models namespace, which seemed like a logical place to put this. Actually, I created a child namespace, MyProjectWebRole.Models.ReportModels, which was okay with Visual Studio.
Here's an outline of my access object:
namespace MyProjectWebRole.Models.ReportModels
{
public class DataThing
{
public DataThing()
{
}
public int ThingId{ get; set; }
public decimal ThingCost { get; set; }
public DateTime ThingAcquisitionDate { get; set; }
public string ThingType { get; set; }
public static IList<DataThing> GetEveryThing()
{
ServiceClient client = null;
ThingsRequest request = null;
ThingsResponse response = null;
string errorID = "";
IList<DataThing> things = new List<DataThing>();
client = new ServiceClient();
request = new ThingsRequest();
response = client.ThingsReport(request);
}
foreach (ResponseThing rt in response.Things)
{
DataThing theThing = new DataThing();
theThing.ThingId = rt.Id;
theThing.ThingCost = rt.Cost;
theThing.ThingAcquisitionDate = rt.Date;
theThing.ThingType = rt.Type;
things.Add(theThing);
}
if (client != null) client.Close();
return things
}
}
}
ServiceClient, ThingsRequest, ThingsResponse and ResponseThing are defined when you add a ServiceReference to the web service where the data originates.
II. Create the report.
From a project folder's context menu:
Click on "Add" -> "New Item ..."
Select the "Reporting" template set in the left pane.
Select the "Report" template. A design surface for the new report appears.
Drag controls from the Toolbox to design the report. The first time
you drag a control that requires a dataset (table, matrix, guage,
graph, list) the Dataset Properties dialog will open:
Choose the data source.The "Data source" dropdown shows the
namespaces in which report data sources can be named.Choose the one
in which you defined your data access object.
Choose the dataset:The "Available datasets" dropdown includes all
the appropriate methods in the selected Data source namespace. The
method(s) of the data access object intended for this should be
among the choices. Select the one needed for this report. The data
it makes available will be displayed in the "Fields" list.
Configure the report control that triggered the Dataset setup.The
fields from the selected dataset can now be used as placeholders for
elements of controls added to the report.
Complete the report definition by including and configuring any
other report controls needed.
III. Create a WebForm to display the report.
Once the WebForm is created, add a ScriptManager control (from the
AJAX Extensions section of the Toolbox).
Add a ReportViewer control to the WebForm (from the Reporting
section of the Toolbox)
In the Design view of the WebForm, click on the ReportViewer control
to make it active.
Click the Smart Tag to open a "ReportViewer Tasks" dialog.
Open the "Choose Report" dropdown and select the RDLC file of the
report designed above.
Click "Choose Data Sources" to open a "Choose Data Sources" dialog.
The dataset you created and named in part II should be listed as a
"Report Data Source" and there should be a dropdown for it under
"Data Source Instance".
Open the dropdown for your data source and click the choice that
says ".
That brings up a "Data Source Configuration Wizard. Click on the
"Object" data source icon and, if you want, give it a more
meaningful ID than the default provided.
That brings up a "Configure Data Source" dialog for the new Object
data source you just created. In the "Choose your business object"
dropdown, you will again select
MyProjectWebRole.Models.ReportModels.DataThing
Click Next and then choose the "Select" tab.
Again, choose the method from you business object that will provide
the data to be bound to the report.
That's all there is to it. When you browse to your WebForm, it should query the web service and populate the report with the data provided.
Any additions and corrections to this are most appreciated!

Creating and deploying infopath forms in in sharepoint 2010 form libraries

I have created infopath form library in SharePoint sever2010. I am using Windows server 2008R2 OS and MS-Office 2010. When i clicked on "Add new document" in form library, it is asking a .xsn template.
I created a template using infopath 2010 and assigning to it.
But it is saying that:
The element 'comment' is used but not declared in the DTD/Schema..
I tried to publish it by using Infopath 2010, it is saying that :
The element 'comment' is used but not declared in the DTD/Schema.
again.
Can any one explain the procedure how to solve these errors....
This error could occur if:
The template you created with InfoPath designer is not published to SharePoint - therefore when you click New -> New Document, you are asked to provide a template to use. Now if you supply any arbitrary template, you will get this error.
You can try following steps:
Publish the template you created to sharepoint Server. Check 'Enable this form to be filled by browser'.
You said very simple template so I am assuming there is no custom code associated.
Select publish to form library. Create a new form library, if not already done so; else use existing form library.
If you create new Form library from InfoPath, things are easy, when you click on 'new document' in your 'form library', you will see the form in browser.
If you publish to existing Form Library then follow these steps:
In your form library click settings -> Advanced settings.
Select 'Yes' for 'Allow management of content types?'.
For 'Default open behaviour for browser-enabled documents:'
Select Use the server default (Open in the browser).
Click Ok.
Back on the settings page you should see: 'Add from existing site content types' in the 'content type' section. Click it and on the ' Add Content Types' page select group 'Microsoft Office Infopath' or 'Microsoft Infopath', which ever your content group is, and you should see the name of your form. Add this and click ok.
Back in your Form Library, you should see two InfoPath forms on your New button.
Well that's that, you can get rid of one of them.

SharePoint 2010 custom display form like publishing page?

I want to display a list item in a different detail page, not dispform.aspx, not in modalbox. Page must be inherit site masterpage, layout page and must be in portal sitemap like publishing page.
Breadcrumb must be like this:
Company Intranet > Announcements > Product request formm updated!
Is there any way for do that?
Chaning the System Master to publishing master page will render all the forms with Same UI as you see in Home page.
You can change it in this Location http://yousite/_layouts/ChangeSiteMasterPage.aspx You have to do this in site where you what to see this change.
To Prevent the popup forms Go to List Settings->Advanced Settings and turn off the Dialog.
Also to change default Form of List you have multiple forms
Create a New Form (Link is for 2007 same applies for 2010 as well) in SharePoint Designer and Associate it to the List.
Use Infopath to create a Custom Form
Develop a new Webpart that will do Add Edit etc and Add it to the Default Forms.