Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Capture Signature on iPad?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: Capture Signature on iPad?

    got the signature page run with alphafive, but don't know where to put the save button action

    ---------------------------------------------
    var datapair = jQuery('#signature').jSignature("getData","image");
    var mysigdata = datapair[1];
    _myQAGlobals.chkgrid = {grid.Object}.isDirty();

    if (_myQAGlobals.signpushed=true)
    {

    {grid.Object}.setValue('G','SIGBIN','{Grid.RowNumber}',mysigdata);
    {grid.Object}.submitGridPart();
    }
    --------------------------------------------


    Thanks

    Comment


    • #17
      Re: Capture Signature on iPad?

      I'm saving the data to the grid the signature is called from. The button is on the grid on the last page (I'm doing questionnaires). I then run a subsequent ajax callback to render the signature. It was easier for me to save the file temporarily in the grid. I just run a query that looks for the signature and convert it to jpg. The example is also checking for buttons being pushed so I know that the sign and save button are pushed before the user can close the grid.

      Comment


      • #18
        Re: Capture Signature on iPad?

        is that use a a5w to put the grid and <div> signature </div> at the same page and also the 'save' button ?
        I am new to both alpha and the jquery, these drive me lost and don't know how to put it together.
        is it possible to have the sample a5w post here,

        Thanks in advance

        Originally posted by omagarc View Post
        I'm saving the data to the grid the signature is called from. The button is on the grid on the last page (I'm doing questionnaires). I then run a subsequent ajax callback to render the signature. It was easier for me to save the file temporarily in the grid. I just run a query that looks for the signature and convert it to jpg. The example is also checking for buttons being pushed so I know that the sign and save button are pushed before the user can close the grid.

        Comment


        • #19
          Re: Capture Signature on iPad?

          Hi Omar,

          Just curious, why are you using a grid to have the user fill a questionnaire? I have in mind to use a Dialog for that type of task.
          Regards
          Keith Hubert
          Alpha Guild Member
          London.
          KHDB Management Systems
          Skype = keith.hubert


          For your day-to-day Needs, you Need an Alpha Database!

          Comment


          • #20
            Re: Capture Signature on iPad?

            Amazing. Great thanks for this.

            I just run a query that looks for the signature and convert it to jpg.
            I fully understand saving it to the database, displaying it on a report, then deleting it. But how are you converting the binary data to jpg for your report?

            Also, in response to Keith's question and perhaps for Omar and Fred as well, in very basic testing, it appears that I can put the signature
            Code:
            <div id="signature"></div>
            in a static text control in a Dialog component--not sure about a Grid component--but it appears as part of the component rather than under everything else.

            Finally, I'm attaching a very very simple dialog and a5w page for Fred and anyone else who comes later. With Omar's help, this was too easy so I thought I'd share to make it even easier for others.
            Attached Files

            Comment


            • #21
              Re: Capture Signature on iPad?

              Hi Chris,

              Many thanks for this. I shall have a play with this and let you know how I get on.

              One question, how is the signature saved in the MySQL table? What is the field format? Sorry, that was two questions.
              Regards
              Keith Hubert
              Alpha Guild Member
              London.
              KHDB Management Systems
              Skype = keith.hubert


              For your day-to-day Needs, you Need an Alpha Database!

              Comment


              • #22
                Re: Capture Signature on iPad?

                I haven't actually gotten that far yet, but I'm pretty sure it's going to be a binary data type, because it's an immense amount of data and because Omar named his column "SigBin".

                Edit: Binary nor blob did it for MySQL anyway--the data was truncated. Longblob appears to work.
                Last edited by christappan; 01-10-2013, 04:18 AM. Reason: I was wrong.

                Comment


                • #23
                  Re: Capture Signature on iPad?

                  Hi Chris,
                  Longblob appears to work.
                  Does that mean you have managed to save in the table?
                  Regards
                  Keith Hubert
                  Alpha Guild Member
                  London.
                  KHDB Management Systems
                  Skype = keith.hubert


                  For your day-to-day Needs, you Need an Alpha Database!

                  Comment


                  • #24
                    Re: Capture Signature on iPad?

                    After setting up data binding in the dialog properties and creating an Action Scripting script in the afterDialogValidate and un-commenting out the {dialog}.submit() in the bottom button, yes, it's saving the data string to a table.

                    Comment


                    • #25
                      Re: Capture Signature on iPad?

                      Originally posted by Keith Hubert View Post
                      Hi Omar,

                      Just curious, why are you using a grid to have the user fill a questionnaire? I have in mind to use a Dialog for that type of task.
                      My app is dynamic with the answers and the dialog is very static. My answer report will contain a narrative of the questionnaires so if a patient says yes to -Do you smoke? .. the narrative will be- Mr. Hubert does not smoke.

                      Comment


                      • #26
                        Re: Capture Signature on iPad?

                        Code:
                        ' Create PDF	
                        	DIM filter AS C
                        	DIM result_expression AS C
                        	DIM table AS C
                        	dim questresult as b
                        	dim cn as sql::connection
                        	dim args as sql::arguments
                        	dim v_qid as n = convert_type(e._currentRowDataNEW.Q_HeaderID,"N")
                        	dim v_qidc as c = convert_type(e._currentRowDataNew.Q_HeaderID,"C")
                        	 	cn.PortableSQLEnabled = .t.
                        		cn.open("::Name::forms")
                        
                        '  Check to see if pdf Signing required where patient signature is included in document	
                        		table = "questionnaires"
                        		result_expression = "SigReq"
                        		filter = "QuestionnaireID = "+v_questid
                        		v_sigreq = sql_lookup(cn,table,filter,result_expression)
                        		
                        ' No signature required  Run no sig report
                        	if v_sigreq = .f.
                        		
                        		dim filter as c = "Q_Header_ID="+v_qid
                        		dim order as c = ""
                        		Dim sfilename as c = "D:\session_folders"+chr(92)+v_qidc+"_MyQA.pdf"
                        		report.saveas("MyQANoSig@[PathAlias.ADB_Path]\Forms.alb","pdf",filter,order,sfilename,.f.)
                        		goto readpdf
                        		
                        	end if
                        		
                        		table = "qa"
                        		result_expression = "SigBin"
                        		filter = "q_headerid = "+v_qid+" AND SigBin IS NOT Null"
                        		questresult = sql_records_get(cn,table,filter,result_expression)
                        		cn.Close()
                        		
                        If questresult=""
                        	goto leaveme
                        end if
                        		
                        	dim bb as B
                        	dim mysigname as c ="D:\session_folders"+chr(92)+alltrim(convert_type(e._currentRowDataNEW.Q_HeaderID,"C"))+".jpg"
                        
                        	bb = base64decode(questresult)
                        	bb = png_to_bitmap(bb)
                        	bb = bitmap_to_jpeg(bb)
                        	file.from_blob(mysigname,bb)
                        
                        	dim filter as c = "Q_Header_ID="+v_qid
                        	dim order as c = ""
                        	Dim filename as c = "D:\session_folders"+chr(92)+v_qidc+"_MyQA.pdf"
                        	dim SFilename as c ="D:\session_folders"+chr(92)+v_qidc+"_MyQA-signed.pdf"
                        	report.saveas("MyQA@[PathAlias.ADB_Path]\Forms.alb","pdf",filter,order,filename,.f.)
                        This code is not complete but should provide a general idea of how to process. The binary data in JSignature is png and is encoded. In my report I have a calculated field for the jpg name. What was easiest for me was to store the binary data in the current answer table.

                        Comment


                        • #27
                          Re: Capture Signature on iPad?

                          longtext is what I used as the data being stored is encoded
                          Last edited by omagarc; 01-10-2013, 10:36 AM.

                          Comment


                          • #28
                            Re: Capture Signature on iPad?

                            My first Jing video so be kind! http://screencast.com/t/z3ISedihT4

                            Comment


                            • #29
                              Re: Capture Signature on iPad?

                              thanks a lot for all of you, I will try it and upload the result sample here :)

                              Comment


                              • #30
                                Re: Capture Signature on iPad?

                                Roadblock: Once my user completes and signs, I return to a list of other questionnaires. The user will select the next questionnaire but cannot sign as the button does not appear to work. If I refresh the browser, it will work again. So my problem is that I cannot use the javascript more than once as I guess the elements are consumed by the first instance. I've tried JQuery.("#signature").empty() to see if I could unload but no love. So my question is how does one unload the javascript without refreshing the browser. Kind of like closing a connection and reopening. I need to acquire the signature, save it close the dialog/grid and go to the next questionnaire and acquire the signature again. I'm reusing the same code but it only likes it once...

                                Comment

                                Working...
                                X