Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Private Sub btnGenerate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGenerate.Click
'This example web page demonstrates the Quik! Forms Engine web service and form viewer by loading a hard-coded FormID.
'A production version of this example would give users the ability to select one or more forms and generate them from a website
'
'Enter the credentials for your Quik! account
strQuikCustID = ConfigurationManager.AppSettings("QuikCustID").ToString 'Your master account CustomerID
strQuikUsername = ConfigurationManager.AppSettings("QuikUsername").ToString 'Your master account username
strQuikPassword = ConfigurationManager.AppSettings("QuikPassword").ToString 'Your master account password
Dim objQFE As QuikFormsEngineWSv5200.QuikFormsEngineService
objQFE = New QuikFormsEngineWSv5200.QuikFormsEngineService 
 

'Get the XML as a string
'Dim xmlDoc As New System.Xml.XmlDocument
'xmlDoc.Load("C:\Temp\LoadXMLExample.xml")
Dim strXML As String
'strXML = xmlDoc.OuterXml
strXML = "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?><ParentField><Field><FieldName>1own.FName</FieldName><FieldValue>Thomas</FieldValue><FieldReadOnly>false</FieldReadOnly><FieldVisibility>1</FieldVisibility><FieldRequired>false</FieldRequired><FieldFormat></FieldFormat><FieldMask>false</FieldMask><FieldCalcOverride>false</FieldCalcOverride><HiddenField>false</HiddenField></Field><Field><FieldName>1own.LName</FieldName><FieldValue>Williams</FieldValue><FieldReadOnly>true</FieldReadOnly><FieldVisibility>1</FieldVisibility><FieldRequired>true</FieldRequired><FieldFormat></FieldFormat><FieldMask>false</FieldMask><FieldCalcOverride>false</FieldCalcOverride><HiddenField>false</HiddenField></Field></ParentField>"
Dim objWSResults As New QuikFormsEngineWSv5200.QuikResultWS
Dim strJava() As String 
 

'Set the customer credentials into the SOAP Header
Dim authHeader As New QuikFormsEngineWSv5200.AuthenticationHeader
authHeader.UserName = strQuikUserName
authHeader.Password = strQuikPassword
authHeader.CustomerID = strQuikCustID
objQFE.AuthenticationHeaderValue = authHeader
objWSResults = objQFE.Execute(

CustomJavaFileIncludePath:=strJava, _
CustomJavaScript:=strJava, _
FormIDs:=Me.txtFormIDs.Text, _
FormExpiryDate:=CDate("5/24/2014"), _
HostFormOnQuik:=True, _
HTMLBodyOnloadFunction:="", _
HTMLFieldFontColor:="", _
HTMLFooter:="", _
HTMLFooterStyle:="", _
HTMLLoadingImage:="", _
HTMLLogoAltText:="", _
HTMLLogoPath:="", _
HTMLMainInstruction:="", _
HTMLMetaNames:="", _
HTMLMinorInstruction:="", _
HTMLReportFormError:="", _
HTMLRequiredBorderColor:="", _
HTMLShowButtonClear:=True, _
HTMLShowButtonPrint:=True, _
HTMLShowButtonReset:=True, _
HTMLShowButtonSave:=True, _
HTMLShowButtonSign:=True, _
HTMLShowButtonSubmit:=True, _
HTMLStyles:="", _
HTMLTitle:="", _
iScrollFilePath:="", _
iScrollOff:=False, _
jQueryBlockUIFilePath:="", _
jQueryFilePath:="", _
jQueryUIFilePath:="", _
LoadXML:=strXML, _
PreviewMode:=False, _
SaveURL:="", _
SignAllDocsCombined:=True, _
SignJavascript:="", _
SignMessage:="", _
SignShowSignNow:=True, _
SignShowVerifyCode:=True, _
SignShowVerifyIDCheck:=True, _
SignSubject:="", _
SignURL:="https://websvcs.quikforms.com/Docusign/QuikESignTransport/QuikSignTransport.aspx", _
SubmitJavascript:="", _
SubmitURL:="https://websvcs.quikforms.com/HTMLFormViewTrans/v5202/FormViewHTML/QFVGetPDF.aspx?Edit=FALSE", _
TestDataMode:=Me.chkTestMode.Checked, _
TestFinalFormsMode:=Me.chkTestForms.Checked _
)


 
'Check for errors in running the Quik! Forms Engine
If objWSResults.ErrorCode <> 0 Then

Response.Write(strResults)

 Else
  

'Write the HTML file to disk and serve to the user

...

'
'System.IO.File.WriteAllText("c:\temp\sample.html", strResults)

...

'
''Redirect to the HTML file
'Dim objFile As QuikFormsEngine.QuikFormOutput
'For Each objFile In arrFiles
' Dim strFileName As String = objFile.FullName
' If strFileName = "" Then
' strFileName = "ERROR! No forms were generated."
' Response.Write(strFileName)
' Else
' Response.ContentType = "text/html"
' Response.Redirect(strFileName)
' End If
'Next
'Stream the HTML file out as a response
Dim strHTML As String = objWSResults.ResultData.Tables(0).Rows(0).Item(0)
If strHTML = "" Then
strHTML = "ERROR! No forms were generated."
Response.Write(strHTML)
Else
Response.ContentType = "text/html"
Response.Write(strHTML)
End If

 End If
objQFE = Nothing

 
End Sub