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

Printing from within a form

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

    Printing from within a form

    I am using A5v4 Build 266 and have the following problem.

    I want to use a button to print the current record(s) to a report (Packing List). I am in a form that uses a set and an embedded browse.

    I can select FILE, PRINT LAYOUT, and select current record and it works great. But if I try to record a script, or use the button genie to do the same thing, it wont work.

    I have been told by Alpha support that I can copy and modify the code from another button, but I am not sure just what they mean.

    can anybody help????

    #2
    RE: Printing from within a form

    John, sure.

    The form layout print routines in Alpha Five are rudimentary. Suitable mainly for testing during development and documenting the appearance of a form layout in your development notes, in my opinion.

    If I were you I'd build and save a simple report layout that contains the fields of interest. Then I'd drop a new button on my form and let the button genie help me print or preview the report. The genie will let you specify that the print range will be 'current record' only. This is a 'built in action (perform single task)', and is a piece of cake to set up.

    -- tom

    Comment


      #3
      RE: Printing from within a form

      Tom:

      Thanks for the help. I am familiar with the button genie and how to print a report, but because the form that I print from uses a set AND I have an embedded browse, it will not allow me to print the report using the Current record only. It reverts back to the first record of the database every time.

      I was told by Alpha tech that I cannot just make a button to print a report using the current record because I have an embedded browse in my form and I am printing a report from within a form. They said that there was a work around by copying some code from another button in another form and making slight modifications to it. I did not understand that they were talking about.

      I also tried to record a script to print a layout, but was unsuccessful as it refused to record a script in this form.

      If you know of any fix to this, I would greatly appreciate it.


      Thanks,

      John Faust

      Comment


        #4
        RE: Printing from within a form

        John, I'll be glad to lend a hand. Please clarify something. What do you mean by the 'current record' ?

        I ask because when you have a form based on a set with a one to many embedded browse, you are seeing multiple records at one time. There is a single current record in the parent table. There is a single current record in the linked child table. But there is no single current record for the form. Which (or what) do you want to print?

        -- tom

        Comment


          #5
          RE: Printing from within a form

          Tom:

          Thanks For the help..

          My set is a one to many set as follows

          Header----->Sub Header--------->Detail
          (One rec) (> than one rec) (> than one rec)

          I am printing packing slips for orders..

          The Header file is the sold to information
          The Sub Header file is the different ship to addresses.
          The detail is the detail for each sub header.


          CURRENT RECORD relates to the current HEADER record and all associated children databases that share the same ORDER number.

          WORKS:::
          If I am in my form that uses this set, I can use the FILE, Print Layout, Report, Use Current Records, and it will correctly print my report for the currently selected record(s).


          WILL NOT WORK:::
          If I am in my form that uses this set and use the button genie to print the report for the current record, I just get the first record number in the database and all associated records.


          I hope that this helps explain it...


          Thanks,

          John Faust

          Comment


            #6
            RE: Printing from within a form

            John,

            I'd run a query to narrow the scope of available records in the parent table to the current record;

            then I'd based the report on the 'currently selected' records;

            then I'd put the child table records in a subreport inside my report layout;

            then I'd put the grandchild table records in a subreport inside my report layout.


            If you don't want to run the query, then I'd pass a unique key describing the current parent record to a global variable, and then use the same global variable in a report filter embedded in the properties of the report.

            -- tom

            Comment


              #7
              RE: Printing from within a form

              John,

              Here is some code which will print the current parent and all related child records to a report called "PrintScreen"

              dim recno as c

              recno = alltrim(str(recno()))

              :Report.preview("PrintScreen","recno()="+recno,db_order_get(db_current()))

              This sets the report filter to the current record number and the order to the current order for the set.

              Jerry

              Comment


                #8
                RE: Printing from within a form

                Thanks Jerry:

                I tried your code but it still will only print the first record in the set and not the currently selected record. The only way it will print the current record is with FILE, PRINT LAYOUT while I am in the form. Any other method that I try just prints the first record in the database.

                Thanks,


                John Faust

                Comment


                  #9
                  RE: Printing from within a form

                  John

                  I don't know what method you are using, but here is a little sample database which shows how it works. Unzip the file into a location where it won't mix with other work. Open the database, and open the form TestForm. Move to a record other than the first one and press the button. A preview with only the current record will display. Now go directly to the report and preview it. All records will preview.

                  If you open the report in design mode and select detail properties, click on the records tab. You will see that the report filter and order are NOT set, but will base the report on current selected records. This is set by the button.

                  Jerry

                  Comment

                  Working...
                  X