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

How to email a report directly from grid

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

    #46
    Re: How to email a report directly from grid

    Yes, precisely.

    Comment


      #47
      Re: How to email a report directly from grid

      you design your report as usual, mine is freefrom ( you can also do this with any report for that matter)
      then from the grid harvest all information needed to send email
      1> save the report with time stamp
      2> email the timestamp specific report as an attachment.
      if having trouble with the coding pm me.
      thanks for reading

      gandhi

      version 11 3381 - 4096
      mysql backend
      http://www.alphawebprogramming.blogspot.com
      [email protected]
      Skype:[email protected]
      1 914 924 5171

      Comment


        #48
        Re: How to email a report directly from grid

        Here's a sample of the new and improved way that I do it now. I'm guessing that it's similar to Gandhis method, but I'm not sure. This is pretty much what has to be done with version 12 and up but should work with V11 as well. The code for actually sending an email will obviously differ depending on what you are using to send said email. Also, this is pretty much the bare code, free of any error handling. I didn't want to clutter it up too much.

        This is a grid and a report based off of the Northwinds DB so it should work with just a connection string change on anyone's machine.

        emrpt.zip

        Comment


          #49
          Re: How to email a report directly from grid

          Thanks, Jinx! Will give it a shot.

          Comment


            #50
            Re: How to email a report directly from grid

            Originally posted by -Jinx- View Post
            The code for actually sending an email will obviously differ depending on what you are using to send said email.
            You files were very helpful. Thanks, Jinx. Unfortunately, its still not working. I'm pretty sure its related to the email config on my end. Here's the error message I get:

            "Error executing Ajax callback function: 'ReportForEmail' Error reported was: command: MailClient.Send(msg) Exception has been thrown by the target of an invocation. The operator has timed out."

            And, here is my revised code:


            function ReportForEmail as c (e as p)
            debug(1)
            dim reportName as C = e.reportFilename
            dim vjscmd as c
            dim key as c
            key = e.fileSessionKey
            dim b as b
            session.getDataFromFile(b,key)
            file.From_blob(reportName,b)
            dim recipient as c = "[email protected]"
            dim subj as C = "This is a Test"
            dim body as C = "Please see attached"
            dim ishtml as L = .F.
            dim CC as C = "[email protected]"
            dim sender as C = "[email protected]"
            dim EmailPassword as C = "xxxxxxxxxxxxxxxxxx"
            dim msg as System::Net::Mail::MailMessage = new System::Net::Mail::MailMessage()
            msg.To.Add(recipient)
            msg.From = new System::Net::Mail::MailAddress(sender)
            msg.Subject = subj
            msg.Body = body
            msg.BodyEncoding = System::Text::Encoding::UTF8
            msg.Priority = System::Net::Mail::MailPriority::Normal
            dim addrCC as System::Net::Mail::MailAddress = new System::Net::Mail::MailAddress(CC)
            msg.CC.Add(addrCC)
            msg.Attachments.Add(new System::Net::Mail::Attachment(reportName))
            dim MailClient as System::Net::Mail::SmtpClient = new System::Net::Mail::SmtpClient("smtp.gmail.com",465)
            MailClient.EnableSsl = .T.
            MailClient.UseDefaultCredentials = .T.
            debug(1)
            MailClient.Send(msg)
            vjscmd = "alert('An email has been sent');"
            msg.Dispose()
            file.remove(reportName)
            ReportForEmail = vjscmd
            end function

            Comment


              #51
              Re: How to email a report directly from grid

              Yeah, mine does something similar when running it in working or live preview. Works fine live though. It's kind of a pain in the butt trying to troubleshoot email issues because of the difference with live preview/working preview over running it live. I usually have to publish it and run it live to test it.

              I have a known good component that works live....The message I get when running it in Live Preview is this:
              emerror.png

              I'm sure someone has a good way to troubleshoot these things locally but It just seems easier for me to publish it and play with it most of the time. Most of the security I use doesn't work in working preview or live preview either so whatever.

              Comment


                #52
                Re: How to email a report directly from grid

                scott
                do you have teamviewer?
                text me at 9149245171 if you do. (and I can work with my code, new one I have to learn)
                thanks for reading

                gandhi

                version 11 3381 - 4096
                mysql backend
                http://www.alphawebprogramming.blogspot.com
                [email protected]
                Skype:[email protected]
                1 914 924 5171

                Comment


                  #53
                  Re: How to email a report directly from grid

                  Originally posted by GGandhi View Post
                  scott
                  do you have teamviewer?
                  text me at 9149245171 if you do. (and I can work with my code, new one I have to learn)
                  If you help him out G, the only thing that isn't email related in the code I posted is:
                  Code:
                  dim reportName as C = e.reportFilename
                   dim vjscmd as c
                   dim key as c
                   key = e.fileSessionKey
                   dim b as b
                   session.getDataFromFile(b,key)
                   file.From_blob(reportName,b)
                  Which gets the binary report information and turns it into a file
                  and this:
                  Code:
                  file.remove(reportName)
                  Which gets rid of the report since you no longer need it.


                  So it's really simple.

                  The only thing he'll need help with is emailing it. so, however you normally email in Xbasic and using the code above, just attach
                  Code:
                  reportName
                  In the above example that's happening here:
                  Code:
                  msg.Attachments.Add(new System::Net::Mail::Attachment(reportName))
                  I am using .NET mail.

                  I have never used Gmail to send mail from Alpha.

                  I'm 90% sure his issue is email related only.

                  Comment


                    #54
                    Re: How to email a report directly from grid

                    I will let you know how it goes.
                    thanks, AH
                    you have been always supportive.
                    thanks for reading

                    gandhi

                    version 11 3381 - 4096
                    mysql backend
                    http://www.alphawebprogramming.blogspot.com
                    [email protected]
                    Skype:[email protected]
                    1 914 924 5171

                    Comment


                      #55
                      Re: How to email a report directly from grid

                      Gandhi and Jinx,

                      You both helped me a lot with this and I just wanted to acknowledge/thank you again. I finally got this working by setting an on-click javascript with two events: The first is an ajax callback to create the report and save it in the appropriate directory. The second event then attaches the saved report and sends the email. My only concern is the "asynchronous" aspect of things... since I'm donig it in v11, I don't have the option of ensuring that the callback happens first. That being said, I've tested this at least a dozen times and each time I've received the attachement on the email.

                      Comment


                        #56
                        Re: How to email a report directly from grid

                        Just fire the second event with JavaScript returned by the first. You can do that directly or by changing the value of a field with the returned JavaScript and subsequently setting that field's onChange event to your second action. That'll synchronize it so you don't need to worry.

                        That's kinda how I used to do it before writing it all in X basic instead...see further up in this thread.

                        Anyway, glad it's working. Good luck!

                        Comment


                          #57
                          Re: How to email a report directly from grid

                          glad to hear it is working.
                          thanks for reading

                          gandhi

                          version 11 3381 - 4096
                          mysql backend
                          http://www.alphawebprogramming.blogspot.com
                          [email protected]
                          Skype:[email protected]
                          1 914 924 5171

                          Comment


                            #58
                            Re: How to email a report directly from grid

                            Everything was working superbly, however the latest pre-release is causing my attachments to fail again. Jinx - whats doing with you? Are you using the latest pre-release adn are your attachments working with it?

                            Version 12.3 Build,3012 system addins build 4523
                            NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                            Comment


                              #59
                              Re: How to email a report directly from grid

                              Hi Charles,

                              Originally posted by CharlesParker View Post
                              Everything was working superbly, however the latest pre-release is causing my attachments to fail again. Jinx - whats doing with you? Are you using the latest pre-release adn are your attachments working with it?

                              Version 12.3 Build,3012 system addins build 4523
                              If you have a problem with the latest pre-release, the fastest way to get it fixed is by submitting a bug report with the relevant detail information and if possible a quick demo to duplicate your issue.

                              Sometimes the issue is not really a broken pre-release and by taking the time to build a quick and dirty demo you may find what is causing it to fail.
                              Edhy Rijo
                              Progytech
                              (Computer Consultants)
                              The makers of CardTracking.Net
                              www.progytech.com

                              Comment


                                #60
                                Re: How to email a report directly from grid

                                Yeah so far what I see is the report filename (path shows up in the field for the temp file) but the actual pdf is NOT in the Temp folder on the server as it was in the past. I didn't change anything on my end, other than update to the pre-release.
                                NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                                Comment

                                Working...
                                X