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

Emailing Reports

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

    Emailing Reports

    I'm having a mental block this morning.

    I have a report layout that is used to print fairly typical looking client statements. I need to be able to email each statement (i.e. each page of the report) to a different email address.

    How best does one accomplish this kind of thing?

    Also, and/or in addition, looking at it a little differently; if the user is viewing a Browse of accounts... how would I let them mark the ones they wish to email and click once to make that happen?

    The email address is part of the account data, by the way.

    Thanks,
    "all things should be as simple as possible... but no simpler"

    Mike

    #2
    Re: Emailing Reports

    Originally posted by michaelwpayton View Post
    I'm having a mental block this morning.

    I have a report layout that is used to print fairly typical looking client statements. I need to be able to email each statement (i.e. each page of the report) to a different email address.

    How best does one accomplish this kind of thing?

    Also, and/or in addition, looking at it a little differently; if the user is viewing a Browse of accounts... how would I let them mark the ones they wish to email and click once to make that happen?

    The email address is part of the account data, by the way.

    Thanks,
    Hi Michael,

    Use Action Scripting to email the report. Select Reports on the left side and emali a layout on the right side (bottom)

    You can put buttons on a browse to mark and/or print and/or email the report.

    kenn
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    Comment


      #3
      Re: Emailing Reports

      Thanks Ken... but I that only seems to work for one statement/email at a time. I'm trying to enable the user to mark multiple accounts (i.e. rows on the browse) and "walk away," while each statement is emailed to it's email address.
      "all things should be as simple as possible... but no simpler"

      Mike

      Comment


        #4
        Re: Emailing Reports

        Michael,
        I believe you will have to use an xbasic routine for this. There have been a few code snippets on the messageboard that will give a big head start in doing this. If you cannot find them I will see what I can find...

        BTW, gMail and Alpha do not get along very well yet so hopefully you or clients are not using it.


        EDIT: Here is one from my help file I gleaned....guess it is for sending multiple attachments.

        Code:
        'Send a report, label, letter, form or browse layout as an attachment to an e-mail message. You can specify which records to send.
        
        lst=""
        
        dim shared lst as c
        if tablecount("YOUR TABLE","YOUR CHECKBOX FIELD NAME")>0
        	lst=table.external_record_content_get("YOUR TABLE","alltrim(YOUR EMAIL FIELD NAME)","","YOUR CHECKBOX FIELD NAME")
            lst=crlf_to_comma(lst)
        
          else
            ui_msg_box("Attention!","You have not selected any clients!")
        end if
        
        query.filter = ""
        query.order = ""
        
        to_param = a5_eval_expression(lst,local_variables())
        cc_param = a5_eval_expression("",local_variables())
        bcc_param = a5_eval_expression("",local_variables())	
        subject_param = a5_eval_expression("TEST_MULTI-MAIL",local_variables())	
        message_param = a5_eval_expression("",local_variables())
        
        
        :Letter.Send("YOUR SAVED LETTER","RTF",query.filter,query.order,"default",to_param,subject_param,message_param,cc_param,bcc_param)
        Last edited by MikeC; August 18, 2009, 10:46 AM.
        Mike
        __________________________________________
        It is only when we forget all our learning that we begin to know.
        It's not what you look at that matters, it's what you see.
        Henry David Thoreau
        __________________________________________



        Comment


          #5
          Re: Emailing Reports

          Thanks Mike...

          That code looks like it sends the same letter/layout to multiple clients (i.e. all of the checked records). I need to produce a different pdf for each account and send that pdf to each account's email address.

          I guess I'll have to use ReportSaveAs and one of the email "send" functions to do it myself. I really thought there was an easier way. But, I guess, if there was an easier way... no one would buy Report Mailer, LOL.
          "all things should be as simple as possible... but no simpler"

          Mike

          Comment


            #6
            Re: Emailing Reports

            Mike,
            You can get all marked records into a list. Once that is done you can iterate through the list using the code that sends out one mail at a time. This method is used for so many things in Alpha (creating a list and then processing it) that it will help you immensely in your ability to use Alpha.

            Use "list processing" in the help's index tab (without quotes). But know there are many scripts and samples here on the messageboard also---does not have to be concerning email specifically...just processing a list. I will check for a specific email script but will have to be later today--maybe someone else has one handy.
            Mike
            __________________________________________
            It is only when we forget all our learning that we begin to know.
            It's not what you look at that matters, it's what you see.
            Henry David Thoreau
            __________________________________________



            Comment


              #7
              Re: Emailing Reports

              Thanks Mike... I'll check out "list processing."
              "all things should be as simple as possible... but no simpler"

              Mike

              Comment


                #8
                Re: Emailing Reports

                Originally posted by michaelwpayton View Post
                Thanks Ken... but I that only seems to work for one statement/email at a time. I'm trying to enable the user to mark multiple accounts (i.e. rows on the browse) and "walk away," while each statement is emailed to it's email address.
                You need to set the table on which the report is based to a single table or if in a set, to the parent table. That will allow the option to print/email the current record (Action Script).

                I have a browse with a conditional button that allows the user to print/email the record which has focus, i.e. whatever row has focus.

                kenn
                TYVM :) kenn

                Knowing what you can achieve will not become reality until you imagine and explore.

                Comment


                  #9
                  Re: Emailing Reports

                  Originally posted by michaelwpayton View Post
                  looking at it a little differently; if the user is viewing a Browse of accounts... how would I let them mark the ones they wish to email and click once to make that happen?
                  First you need to isolate the marked ones, either with a query, or if you do it frequently, with an index (less preferable even if you do it frequently. Other conditions need to be considered but Ceteris Paribus use a query).

                  The query will produce a table with the marked records only.

                  Iterate over the records using while..end while to send a report to each email.

                  Here is a mock script:
                  Code:
                  t=table.open("..your_table")
                  t.query_create("t",marked())
                  t.fetch_first()
                  while .not. t.fetch_eof()
                  ..here use the script that sends the email with the report.
                  ..the report needs to be filtered according to the current record
                  end while
                  t.close()
                  The above will send a report, one page each, to each recipient.

                  The idea of generating a report then sending one page to each record sounds interesting to me in that the report is generated once not to mention the query is also run once (or so I thought, but not so). To accomplish this you will have to override the printing setting to first print page 1 then page 2 etc. Not difficult. The key is to match the recipient with the page. Again, not difficult so long as the filter used to generate the report is the same one used to query the table.


                  Here is a mock script for this one:
                  In the OnPrint event of the report (or just just before you run the report):
                  Code:
                  dim x as n=1'make it global if run before running the report.
                  In the OnRecord event of the report:
                  Code:
                  ..put the script overriding printing options to print page x to the current recipient
                  x=x+1
                  After the report is generated and as it prints (or previewed), for each page (record) in the report, it will send an email to the matching recipient with that page only.
                  In essence, the report itself (via its OnRecord event) will generate a report for each page to be emailed to the current recipient. So,we are back to the first script where a separate report, one page each, is generated for each recipient. Six of one half a dozen of the other. In the first instance, you would use t.open(), run a query etc to iterate over marked records. In the second script, you generate a report using a filter matching the query, then generate a separate report for each page.
                  Take your pick. In my mind, there is no difference except that overriding printing setting is cumbersome so I would stick with the first script. In fact, I am not even sure if it is doable in practice due to timing issues.

                  Comment


                    #10
                    Re: Emailing Reports

                    Hi Gabe,

                    I like your first picture much better.

                    kenn
                    TYVM :) kenn

                    Knowing what you can achieve will not become reality until you imagine and explore.

                    Comment


                      #11
                      Re: Emailing Reports

                      Thanks Kenn... but I want them to select mutliple records, then click to have all the layouts/emails sent.

                      I have it sending one layout/email at-a-time now. The user wants to mark/select multiple records (maybe 50 or 60 at a time) and then walk-away while they are all sent.

                      They don't want to:

                      mark/select
                      click to send
                      wait for layout to be produced/sent

                      mark/select
                      click to send
                      wait for layout to be produced/sent
                      ...

                      Instead, they want to:

                      mark/select
                      mark/select
                      ...
                      click to send
                      wait for all to be produced/sent

                      I think I will have to:

                      Let them use the Browse to Mark what to send.
                      Give them something to click to indicate they are ready to send.
                      Get the RecNo and Email Addresses they Marked into a List.
                      For each RecNo/Eamil Address in the List:
                      ReportSaveAs
                      Send the Email
                      "all things should be as simple as possible... but no simpler"

                      Mike

                      Comment


                        #12
                        Re: Emailing Reports

                        Which one? The one before the cosmetic surgery?

                        Comment


                          #13
                          Re: Emailing Reports

                          Thanks Gabe... I was typing my last post while you were posting.
                          "all things should be as simple as possible... but no simpler"

                          Mike

                          Comment


                            #14
                            Re: Emailing Reports

                            Originally posted by G Gabriel View Post
                            Which one? The one before the cosmetic surgery?
                            The one about a year and a half ago. A fine picture of her.
                            TYVM :) kenn

                            Knowing what you can achieve will not become reality until you imagine and explore.

                            Comment


                              #15
                              Re: Emailing Reports

                              Mike,
                              Another question....are you to mail the same reports/statements to all the recipients....or specific (and different) reports/statements to each recipients??


                              If different how do you have it set up to determine which ones?
                              Mike
                              __________________________________________
                              It is only when we forget all our learning that we begin to know.
                              It's not what you look at that matters, it's what you see.
                              Henry David Thoreau
                              __________________________________________



                              Comment

                              Working...
                              X