Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

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

Winfax ole help

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

    Winfax ole help

    I am trying to get winfax ole to work. I am unfamiliar with the syntax. I have put in the following for the function winfaxole:

    WinfaxOLE(topparent:Fax_no,report,:fax_test," "," ")

    where Fax_no is a field on a test form
    report named Fax_test
    At this point I don't care about filter or order.

    When I press the button for this code I get fax_test not found. I have played with the syntax on fax_test but can't get it to work. I am stumped on this.

    Any help on this would be appreciated.


    This is Selwyn's post on the xbasic for the function.

    'Here is a sample script that is actually part of A5 that shows how we used OLE Automation to control Winfax:

    'In the function, Obj_type is "report", "Label", "letter" etc. and Obj_name is the name of the object. E.g. the "customer_list" report.

    'filter_str is the filter for the report, and order is the order for the report.

    function WinfaxOLE as L(fax_num as C,obj_type="",obj_name="",filter_str="",order="")

    dim eval_str as c 'strings for the print driver setup
    dim saved_output_file as c
    dim saved_driver as c

    dim areacode as c

    dim Winfaxsend as p
    Winfaxsend = ole.create("Winfax.SDKSend8.0")

    Winfaxsend.SetUseCover(1)

    'set the number of the recipient
    Winfaxsend.addrecipient()

    'see if there is an area code
    if len(fax_num) > 7 then
    areacode = left(fax_num,3)
    faxnum = right(fax_num,7)

    Winfaxsend.SetAreaCode(areacode)
    end if

    Winfaxsend.SetNumber(fax_num)

    Winfaxsend.removerecipient() 'these two lines are necessary because of Winfax's interface
    Winfaxsend.addrecipient()

    'attach the file
    Winfaxsend.SetPrintFromApp(1) 'tells Winfax to expect something from the printer driver

    'print to the Winfax driver
    saved_output_file = ":" + obj_type + ".output_file_override(\"\\temp.rtf\")"

    saved_driver = ":" + obj_type + ".printer_override(\"Winfax\")"

    print = obj_type + ".print(\"" + obj_name + "\",\"" + filter_str + "\",\"" + order +"\")"

    eval(saved_driver)

    eval(print)

    restore_output_file = ":" + obj_type + ".output_file_override(\"\")"

    restore_driver = ":" + obj_type + ".printer_override(\"\")"

    eval(restore_output_file)

    eval(restore_driver)

    'send
    Winfaxsend.send(0)

    'for Winfax cleanup
    Winfaxsend.done(1)

    'delete the Winfax object
    delete Winfaxsend

    end functionFUNCTION Winfax AS L ( )
    END FUNCTION

    #2
    RE: Winfax ole help

    if the field fax_no on your form is a character field then
    use ...

    WinfaxOLE(topparent:Fax_no.value,"report","fax_test")

    otherwise if numeric you must change it to character so use

    WinfaxOLE(str(topparent:Fax_no.value),"report","fax_test")

    I haven't tested this but it should work.

    Tim

    Comment


      #3
      RE: Winfax ole help

      Thank you, I'll try this and let you know if it works.

      Russ

      Comment


        #4
        RE: Winfax ole help

        Tim,
        That almost does it. The controller starts but I get an error "report not found fax_test"
        I will play with it more. I wonder if I need a full path for the report? Doesn't seem I should as it is in the same directory. Any ideas?

        Russ

        Comment


          #5
          RE: Winfax ole help

          I'm making progress but mostly by trial and error.
          The following script sort of works:

          WinfaxOLE("1"+remspecial(topparent:Fax_no.value),"report","Fax_test")

          When I click the button it starts the winfax controller if it is not already started, then the Winfax Pro filler pops up. This is to add or paste a cover page, even though in the program comfiguration I have it set to no cover page. It appears there must be a switch to not require a cover page.

          Then if I put in some text and continue it tries to dial, but with a blank phone number string. If I cancel it does this twice. On the third try it dials the number but adds an 81 between the 1 and the rest of the number. I have no idea where this is coming from. It tries to dial:
          1818606846354 when I put in the number 860-684-6354 as the fax number. Does anyone know where the 81 comes from or about a switch for cover pages. There doesn't appear to be anything in Winfax help on this.

          Comment


            #6
            RE: Winfax ole help

            Ok, about the cover page.

            Notice in Selwyn's function that you posted above, right near the top is the line:
            Winfaxsend.SetUseCover(1)

            If were to change that line to
            Winfaxsend.SetUseCover(0)
            the cover page shouldn't pop up.

            Now, about the number.
            Selwyn's code assumes that the number string contains no other characters. eg) the number 860-684-6354 should be written as "8606846354" (remspecial() should work fine but you dont need to add the "1")

            If the phone number is bigger then 7 digits (as in your case) the function takes the first 3 digits and sets that as the area code, then the last 7 digits make up the fax number.


            Again, I can't test this out since I don't have winfax.

            Comment


              #7
              RE: Winfax ole help

              Tim,
              I shouldhave noticed the cover page(1) in Selwyns code. I added the 1 because winfax is set up as "dial as enterd" so it won't add the 1.
              Do you know what the advantage of ole over DDE is?
              I also can fax from alpha using Winfax DDE and this is easier (for me) and works fine. I just thought I'd try to get it to work in OLE as Selwyn says it's better. The only advantage I can see is that it allows record selection and filtering of the report where with DDE the report has to be be fully formatted and described in the report designer. OLE seems to be more complicated.

              Thanks for the help,

              Russ

              Comment


                #8
                RE: Winfax ole help

                OLE gives you much more control over an application, with OLE you can create an instance of an application, populate the application with filtered data, calculations, etc.. save and close the application all behind the scenes and invisible to the end user.

                Basically it gives the developer the power to do a lot of things without the end user ever know how or what is going on.

                Comment


                  #9
                  RE: Winfax ole help

                  That sounds interesting, I'll have to see if symantec has any info on OLE with winfax. It seems though that most (but not all)of this can be done by setting things up properly with a table and report before printing and then using DDE.

                  Thanks
                  Russ

                  Comment


                    #10
                    Re: Winfax ole help

                    Russ and Tim

                    I have an Error Message as "Command: eval(print) not found report not found".

                    A part of the Button Scripts
                    Code:
                    'Preview a report layout Filter. You can specify which records to preview.
                    	query.filter = "Proposalamt->Proposalamt_id = Var->vGet_Proposalamt_Id"
                    	query.order = "recno()"
                    'replace variables in the filter with their actual values	
                    	query.filter = convert_expression(query.filter,"V")
                    
                    
                    'Get the fax number from current table
                    	FaxNumbers()
                    
                    'Open the Winfax and Fax it
                    	winfaxprint(vfaxnum,"report","Proposal",query.filter,query.order)
                    WinfaxPrint -- a part of OLE UDF, same scripts as Russ's
                    Code:
                    'print to the Winfax driver
                    saved_output_file = ":" + obj_type + ".output_file_override(\"\\temp.rtf\")"
                    saved_driver = ":" + obj_type + ".printer_override(\"Winfax\")"
                    
                    [COLOR="Red"]print = obj_type + ".print(\"" + obj_name + "\",\"" + filter_str + "\",\"" + order +"\")"
                    eval(saved_driver)
                    eval(print)[/COLOR]
                    
                    restore_output_file = ":" + obj_type + ".output_file_override(\"\")"
                    restore_driver = ":" + obj_type + ".printer_override(\"\")"
                    
                    eval(restore_output_file)
                    eval(restore_driver)
                    Does this script "Winfaxprint(vfaxnum, "report", "Proposal", query.filter, query.order)" refer(match) to it
                    print = obj_type + ".print(\"" + obj_name + "\",\"" + filter_str + "\",\"" + order +"\")"
                    ?

                    Do you know what the error mean?

                    Comment


                      #11
                      Re: Winfax ole help

                      The error says the report is not found. Check your use of the function.

                      WinfaxOLE(fax_num,obj_type,obj_name,filter_str,order)

                      what values are you supplying for the parameters, especially obj_name?
                      There can be only one.

                      Comment


                        #12
                        Re: Winfax ole help

                        Hi Stan,

                        "Proposal" -- winfaxprint(vfaxnum,"report","Proposal",query.filter,query.order)

                        When I tested and used only a command winfaxprint("301 555 1234","report","Proposal",vfilter,vorder), WinfaxPrint() UDF opens the Winfax program with all of my proposals and no Fax number. So I assume the WinfaxPrint() udf is fine except "Filter and Fax Number" problem.
                        Last edited by johnkoh; 11-30-2010, 08:40 PM.

                        Comment


                          #13
                          Re: Winfax ole help

                          Is proposalamt_id a character value?

                          Try

                          query.filter = "Proposalamt->Proposalamt_id = "+quote(Var->vGet_Proposalamt_Id)


                          Also vGet_Proposalamt_Id must be dimmed as shared or global for convert_expression to "see" its value, I think.
                          Last edited by Stan Mathews; 12-01-2010, 10:12 AM.
                          There can be only one.

                          Comment


                            #14
                            Re: Winfax ole help

                            Good morning Stan,

                            Thank you for your help.

                            After added and wrote the new button scripts, the UDF (WinfaxPrint()) opened a Winfax Program but It did not insert the Fax number and Alpha indicated an error as - Command: Winfaxsend.done(1) OLE Automation Error: Bad parameter count.

                            Code:
                            DIM Shared vGet_Proposalamt_Id AS C
                            vGet_Proposalamt_Id = tbl.eval("Proposalamt_Id")
                            
                            tbl.close()
                            'Find a Proposal before Print
                            dim shared vFilter as c
                            dim shared vOrder as c
                            vFilter = "Proposalamt->Proposalamt_id = Var->vGet_Proposalamt_Id"
                            vOrder = "Recno()"
                            
                            'Get the Fax Number from Bidder List table
                            'Deleted the Get Fax UDF for Test FaxNumbers()
                            
                            'Execute the WinfaxPrint(OLE) 
                            dim shared vFaxNum as c
                            vFaxNum ="3015551234"
                            WinfaxPrint(vFaxNum,"report","proposal",vFilter,vOrder)
                            Is the vFaxNum suppose list on the Winfax sending form?

                            Comment


                              #15
                              Re: Winfax ole help

                              Is the vFaxNum suppose list on the Winfax sending form?
                              I would think so but I have no experience with it. Just trying to help you with the code.

                              What happens if you change

                              Code:
                              WinfaxPrint(vFaxNum,"report","proposal",vFilter,vOrder)
                              to

                              Code:
                              WinfaxPrint("3015551234","report","proposal",vFilter,vOrder)
                              and leave everything else the same.
                              There can be only one.

                              Comment

                              Working...
                              X