Dynamics Mobile signature sending to xml

wochm
Member Posts: 26
Hello,
How to send a signature from signature control to XML file? I would like to achieve same as it is done in "create order" request document in Mobile Sales in <signature> section.
Regards,
Marcin
How to send a signature from signature control to XML file? I would like to achieve same as it is done in "create order" request document in Mobile Sales in <signature> section.
Regards,
Marcin
0
Comments
-
Why don't you look at using the existing signature tasklet. It can be configured to hide the comments section if you only want to capture a signature.Regards,
Thomas Rath
Program Manager
Microsoft Dynamics Mobile0 -
Sorry, I do not copy you.
I do not have a source code of signature tasklet to check how it is done and I do not want to use existing Microsoft.Dynamics.Mobile.Components.Tasklets.Signature.dll.
Regards,
Marcin0 -
Hi Marcin,
As Thomas suggested; I would reuse as many of the excising components as possible if they fits your needs.
However as I understand your question you properly have additional requirements to a signature tasklet.
Here's a couple of steps to extract the signature from the SignatureControl and add the data to the request document:
1) The tasklet must be IRequestContributor; The interface implements a method to add data to request document
2) In the CreateRequest(...) method is where the data is added to the request document; Code for extracting image from signature control and adding it to the request:
using (MemoryStream ms = new MemoryStream())
using (Image image = View.Signature.GetSignatureImage())
{
BitmapFile.Save(image, ms, BitmapFormat.BitsPerPixel1);
signature = ms.ToArray();
ms.Close();
}
writer.WriteStartElement("signature");
writer.WriteBase64(signature, 0, signature.Length);
writer.WriteEndElement();
Hope this help is sufficientRegards,
Tim Skauge
Microsoft Dynamics Mobile0 -
Hi Tim,
I have done it that way:
byte[] signature = view.GetSignature().GetSignatureBytes();
if (signature != null)
{
writer.WriteStartElement("signature");
writer.WriteBase64(signature, 0, signature.Length);
writer.WriteEndElement();
}
Thank you very much for your help
Cheers,
Marcin0 -
[Topic moved from NAV/Navision to Dynamics Mobile forum]0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions