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

"Get" report name

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

    "Get" report name

    Anyone know how to "Get" a reports name.

    Since it seems to be impossible to change the text in the default report drop down toolbar [Send Report Drop-down] I have had to create a custom tool bar for each language my app will use.

    I just put a button on the toolbar to email as a pdf. Simple enough for now.

    The problem is using the following I need to change the first parameter to reflect the name of the report.

    Code:
    Report.Send("Invoice","PDF",query.filter,query.order,myemail_client,email_to,subject_param,message_param,cc_param,bcc_param)
    This code sends the report named "Invoice" but I have several other reports that will need to be emailed and I do not want to make several custom toolbars for each report.

    The only option I can think of right now is to set a variable to the report's name when they push a button to preview the report and then use that in the report.send code.

    #2
    Re: "Get" report name

    Preston,

    tbllist ="customer" 'one or many dbf name
    ReportNamelist = a5enum("report",alltrim(tblist))

    check the previous discussion at " Xdialog and Print Preview "

    Comment


      #3
      Re: "Get" report name

      Ok,

      I looked at that and found that A5.REPORT_ENUM(2) gets a list of all the reports. Not what a really want.

      Cannot find any documentation on a5enum and
      Code:
      tblist="wo_header.dbf"
      repname = a5enum("report",alltrim(tblist))
      Returns NUL

      but

      Code:
      tblist="wo.set"
      repname = a5enum("report",alltrim(tblist))
      Returns a list of report names used with that set.

      None of this is what I think I am looking for.

      What I am trying to do is:

      I have a report open in "Preview". When I click a button on the tool bar to run the script to email the report, I want to capture the report name, put it in a variable and then use the variable in the report.send.

      When you use the default toolbar for emailing a report, Alpha some how knows the reports name when you click the email as pdf so there has to be away to get the report name when using a custom toolbar while viewing a report.

      All that said, I will try firing this from a button on a tool bar when viewing a report and see if it just gives me the reports name.

      Well, tried that and no-go, still get a list instead of the report name of the report that has focus.

      Comment


        #4
        Re: "Get" report name

        Hi Preston,
        Since most of the report methods seem to prefer shared or global vars, your calling script can get the name of the report, then all you need do is modify the preview toolbar with a button to send that report using your variable. It should pick up whatever report is displayed.
        Robin

        Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

        Comment


          #5
          Re: "Get" report name

          Originally posted by preston2 View Post
          What I am trying to do is:
          I have a report open in "Preview". When I click a button on the tool bar to run the script to email the report, I want to capture the report name, put it in a variable and then use the variable in the report.send.
          Here is a script to do that:

          Code:
          dim lst as c
          dim rpt_lst as c=""
          lst=a5_list_open_windows()
          x=*count(lst)
          for i=1 to x
          	rpt_lst=rpt_lst+word(word(lst,i,crlf()),2,"Preview_")+crlf()
          next
          rpt_lst=remove_blank_lines(rpt_lst)
          msgbox(rpt_lst)
          This code will give the user a list of the names of all reports in Preview mode. The user could then click on their choice and place that in a the variable you want to use in your script.
          Note:
          If the name of the report has spaces in it, alpha will replace the space with under score. For instance, if the name of the report is: "Customer History", the name of the report in the preview mode will be:
          "Preview_Customer_History"

          Comment


            #6
            Re: "Get" report name

            Thanks Gabriel but again, not what I am looking to do.

            I do not want the user to have to preform an additional step by picking from a list.

            They are viewing a report. That report has focus. They go to save or email that report then there should be a way to get the name of the report into a variable without having to pick from a list. I say this because if you use the default tool bar, Alpha does not ask you to pick from a list of reports to preform those functions.

            I think the easiest way to do this would be to just load the report name into a variable when they click a button on a form to preview it.

            Comment


              #7
              Re: "Get" report name

              Not sure it would be easier but it appears you could create your own function to get the report name.
              a5_list_open_windows() will tell you which report is being previewed

              ? a5_list_open_windows()
              = ControlPanel
              Preview__DC_Row_Bin
              Code_Editor
              __a5documentation_window

              Process that list to capture the normalized report name after Preview__.
              There can be only one.

              Comment


                #8
                Re: "Get" report name

                Ok, this works.

                Fired from a button on the report preview tool bar.

                Code:
                dim repname as c
                repname = topparent.name()
                repname=ltrim(repname,"Preview__")
                This puts the current open report name into the variable repname that I can then use in the rest of a script to either save or email the current report out in several languages.

                Thanks again Stan, Gabriel and Robin.
                While not like the example Stan posted, searching the docs and then cannibalizing part of a function example for a5_list_open_windows() I ended up with a simple solution that works.

                Comment


                  #9
                  Re: "Get" report name

                  Glad you found what you needed. I think that will work for any report with a normalized name. If you had a report named Fiscal year, for example, I don't think it would. Just a thought.
                  There can be only one.

                  Comment


                    #10
                    Re: "Get" report name

                    If you had a report named Fiscal year, for example, I don't think it would. Just a thought.
                    The code above would return "Fiscal_year" for a report named "Fiscal year". So it includes an underscore for the space between "Fiscal" and "year". But so does the code you posted above.

                    Comment


                      #11
                      Re: "Get" report name

                      Which is why I suggested a user defined function to manipulate the returned value from a5_list_open_windows(). One could check for the all words in the report name or the first and last word, etc. Easier to avoid the issue by just using report names that don't change when normalized.

                      Again, glad you have it working as desired.
                      There can be only one.

                      Comment


                        #12
                        Re: "Get" report name

                        I added that part so the user could confirm to send that specific report. Using your script, if the user shifts the focus to a different window before clicking to send the report, either he/she will email the wrong one or it wouldn't work. Also and as I mentioned earlier, alpha replaces the spaces with underscore. You could easily eliminate those.

                        Comment


                          #13
                          Re: "Get" report name

                          Originally posted by G Gabriel View Post
                          Using your script, if the user shifts the focus to a different window before clicking to send the report, either he/she will email the wrong one or it wouldn't work. Also and as I mentioned earlier, alpha replaces the spaces with underscore. You could easily eliminate those.
                          If the user shifts focus to another window then the toolbar that has the button on it is no longer in play so they cannot send the report anyway. If by some chance they open preview on several reports, it will still only get the name of the report they have in focus which would/should be the report they wanted to save or send.

                          Comment


                            #14
                            Re: "Get" report name

                            That's what Hillary said.

                            Comment


                              #15
                              Re: "Get" report name

                              Just tested it with several reports opened at the same time and it only picks up the name of the report that has focus. Works for me.

                              Comment

                              Working...
                              X