Submitting info path form hosted in windows control


M

metaman

I'm having problems trying to submit an info path form that is hosted in the
windows 'formcontrol'. I'll tell you what I have done and hopefully someone
could point out any problem areas (I've not used InfoPath before so
struggling a bit).

1) Someone else wrote the InfoPath forms using C#. They work on his machine
pointing at his db

2) As the application that will display the forms could be hosted on any
machine when the user chooses to view the form I

i) Extract the files from the xsn
ii) Update the adoAdapter nodes' connection String to point at the db that
the user has selected through a custom dialog + Update the publish url so
that it points to the actual location of the xsn file we are loading
ii) Compact the files back into xsn and display using form control.

This is all seemed to work with a basic form that didn't have any code
behind and just did standard queries but not with the ones with code behind.
With these ones when you click a button nothing happens (as if the button
isn't wired up?).

(The reason that managed code was used as the author couldn't create a'LIKE'
query using the standard queries??)

Thanks in advance!!

Sorry for the size but thought the .xsf might help:

<xsf:xDocumentClass trustSetting="automatic" solutionFormatVersion="2.0.0.0"
dataFormSolution="yes" solutionVersion="1.0.0.32" productVersion="12.0.0"
name="urn:schemas-microsoft-com:eek:ffice:infopath:ContainerTypeForm:-dataFormSolution"
publishUrl="C:\temp\ContainerTypeForm.xsn"
xmlns:xsf="http://schemas.microsoft.com/office/infopath/2003/solutionDefinition"
xmlns:xsf2="http://schemas.microsoft.com/office/infopath/2006/solutionDefinition/extensions"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xdUtil="http://schemas.microsoft.com/office/infopath/2003/xslt/Util"
xmlns:xdXDocument="http://schemas.microsoft.com/office/infopath/2003/xslt/xDocument"
xmlns:xdMath="http://schemas.microsoft.com/office/infopath/2003/xslt/Math"
xmlns:xdDate="http://schemas.microsoft.com/office/infopath/2003/xslt/Date"
xmlns:xdExtension="http://schemas.microsoft.com/office/infopath/2003/xslt/extension"
xmlns:xdEnvironment="http://schemas.microsoft.com/office/infopath/2006/xslt/environment"
xmlns:xdUser="http://schemas.microsoft.com/office/infopath/2006/xslt/User"
xmlns:q="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields"
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-10-27T14:03:10"
xmlns:xdado="http://schemas.microsoft.com/office/infopath/2003/adomapping">
<xsf:package>
<xsf:files>
<xsf:file name="schema.xsd">
<xsf:fileProperties>
<xsf:property name="editability" type="string"
value="none"></xsf:property>
<xsf:property name="namespace" type="string"
value="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"></xsf:property>
<xsf:property name="rootElement" type="string"
value="myFields"></xsf:property>
<xsf:property name="useOnDemandAlgorithm" type="string"
value="yes"></xsf:property>
</xsf:fileProperties>
</xsf:file>
<xsf:file name="schema1.xsd">
<xsf:fileProperties>
<xsf:property name="namespace" type="string"
value="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"></xsf:property>
<xsf:property name="editability" type="string"
value="none"></xsf:property>
</xsf:fileProperties>
</xsf:file>
<xsf:file name="schema2.xsd">
<xsf:fileProperties>
<xsf:property name="namespace" type="string"
value="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields"></xsf:property>
<xsf:property name="editability" type="string"
value="none"></xsf:property>
</xsf:fileProperties>
</xsf:file>
<xsf:file name="template.xml"></xsf:file>
<xsf:file name="sampledata.xml">
<xsf:fileProperties>
<xsf:property name="fileType" type="string"
value="sampleData"></xsf:property>
</xsf:fileProperties>
</xsf:file>
<xsf:file name="view1.xsl">
<xsf:fileProperties>
<xsf:property name="lang" type="string" value="1033"></xsf:property>
<xsf:property name="queryView" type="string"
value="yes"></xsf:property>
<xsf:property name="componentId" type="string"
value="6"></xsf:property>
<xsf:property name="xmlToEditName" type="string"
value="5"></xsf:property>
</xsf:fileProperties>
</xsf:file>
<xsf:file name="781C38BD.png">
<xsf:fileProperties>
<xsf:property name="fileType" type="string"
value="viewComponent"></xsf:property>
</xsf:fileProperties>
</xsf:file>
<xsf:file name="ContainerTypeForm.dll">
<xsf:fileProperties>
<xsf:property name="fileType" type="string"
value="rootAssembly"></xsf:property>
</xsf:fileProperties>
</xsf:file>
<xsf:file name="ContainerTypeForm.pdb">
<xsf:fileProperties>
<xsf:property name="fileType" type="string"
value="pdb"></xsf:property>
</xsf:fileProperties>
</xsf:file>
</xsf:files>
</xsf:package>
<xsf:importParameters enabled="yes"></xsf:importParameters>
<xsf:documentVersionUpgrade>
<xsf:useTransform transform=""
minVersionToUpgrade="0.0.0.0"></xsf:useTransform>
</xsf:documentVersionUpgrade>
<xsf:extensions>
<xsf:extension name="SolutionDefinitionExtensions">
<xsf2:solutionDefinition runtimeCompatibility="client"
allowClientOnlyCode="no">
<xsf2:eek:ffline openIfQueryFails="yes"
cacheQueries="yes"></xsf2:eek:ffline>
<xsf2:dataConnections>
<xsf2:adoAdapterExtension ref="Container Type"
submitAdapterName="Main connection submit"></xsf2:adoAdapterExtension>
</xsf2:dataConnections>
<xsf2:managedCode language="CSharp" version="2.0"
enabled="yes"></xsf2:managedCode>
<xsf2:solutionPropertiesExtension branch="share">
<xsf2:share formName="ContainerTypeForm"
path="C:\temp\ContainerTypeForm.xsn"
accessPath="C:\temp\ContainerTypeForm.xsn"></xsf2:share>
</xsf2:solutionPropertiesExtension>
</xsf2:solutionDefinition>
</xsf:extension>
</xsf:extensions>
<xsf:views default="View 1">
<xsf:view name="View 1" caption="View 1">
<xsf:mainpane transform="view1.xsl"></xsf:mainpane>
<xsf:editing>
<xsf:xmlToEdit name="ContainerType_1"
item="/dfs:myFields/dfs:dataFields/d:ContainerType" container="/dfs:myFields">
<xsf:editWith caption="ContainerType" xd:autogeneration="template"
component="xCollection">
<xsf:fragmentToInsert>
<xsf:chooseFragment parent="dfs:dataFields"
innerFragment="d:ContainerType">
<d:ContainerType ID="" Name=""
Description=""></d:ContainerType>
</xsf:chooseFragment>
</xsf:fragmentToInsert>
</xsf:editWith>
</xsf:xmlToEdit>
<xsf:xmlToEdit name="ID_2"
item="/dfs:myFields/dfs:dataFields/d:ContainerType/@ID">
<xsf:editWith proofing="no" autoComplete="no"
component="xField"></xsf:editWith>
</xsf:xmlToEdit>
</xsf:editing>
<xsf:menuArea name="msoInsertMenu">
<xsf:menu caption="&Section">
<xsf:button action="xCollection::insert"
xmlToEdit="ContainerType_1" caption="ContainerType"></xsf:button>
</xsf:menu>
</xsf:menuArea>
<xsf:menuArea name="msoStructuralEditingContextMenu">
<xsf:button action="xCollection::insertBefore"
xmlToEdit="ContainerType_1" caption="Insert ContainerType before"
showIf="immediate"></xsf:button>
<xsf:button action="xCollection::insertAfter"
xmlToEdit="ContainerType_1" caption="Insert ContainerType after"
showIf="immediate"></xsf:button>
<xsf:button action="xCollection::remove" xmlToEdit="ContainerType_1"
caption="Remove ContainerType" showIf="immediate"></xsf:button>
<xsf:button action="xCollection::insert" xmlToEdit="ContainerType_1"
caption="Insert ContainerType" showIf="immediate"></xsf:button>
</xsf:menuArea>
<xsf:unboundControls>
<xsf:button name="ContainerTypeNameSearchButton"></xsf:button>
</xsf:unboundControls>
</xsf:view>
</xsf:views>
<xsf:query>
<xsf:adoAdapter connectionString="Provider=SQLOLEDB.1;Integrated
Security=SSPI;Persist Security Info=True;Initial Catalog=DBName;Data
Source=DBServer;Use Procedure for Prepare=1;Auto Translate=True;Packet
Size=4096;Workstation ID=Workstation;Use Encryption for Data=False;Tag with
column collation when possible=False" commandText="select
"ID","Name","Description" from "dbo"."ContainerType" as "ContainerType""
queryAllowed="yes" name="Container Type" submitAllowed="yes"></xsf:adoAdapter>
</xsf:query>
<xsf:submit caption="Su&bmit">
<xsf:useQueryAdapter></xsf:useQueryAdapter>
</xsf:submit>
<xsf:applicationParameters application="InfoPath Design Mode">
<xsf:solutionProperties
fullyEditableNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-10-27T14:03:10"
scriptLanguage="managedCode" lastOpenView="view1.xsl"
automaticallyCreateNodes="no"></xsf:solutionProperties>
</xsf:applicationParameters>
<xsf:documentSchemas>
<xsf:documentSchema rootSchema="yes"
location="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution
schema.xsd"></xsf:documentSchema>
<xsf:documentSchema
location="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields
schema1.xsd"></xsf:documentSchema>
<xsf:documentSchema
location="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields
schema2.xsd"></xsf:documentSchema>
</xsf:documentSchemas>
<xsf:fileNew>
<xsf:initialXmlDocument caption="ContainerTypeForm"
href="template.xml"></xsf:initialXmlDocument>
</xsf:fileNew>
</xsf:xDocumentClass>
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top