Options

Dynamics Mobile signature sending to xml

wochmwochm Member Posts: 26
edited 2008-09-22 in Dynamics Mobile
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

Comments

  • Options
    Thomas_RathThomas_Rath Member Posts: 1
    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 Mobile
  • Options
    wochmwochm Member Posts: 26
    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,
    Marcin
  • Options
    timStimS Member Posts: 5
    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 sufficient
    Regards,

    Tim Skauge
    Microsoft Dynamics Mobile
  • Options
    wochmwochm Member Posts: 26
    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,
    Marcin
  • Options
    AdministratorAdministrator Member, Moderator, Administrator Posts: 2,496
    [Topic moved from NAV/Navision to Dynamics Mobile forum]
Sign In or Register to comment.