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

default zoom on letter preview

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

  • default zoom on letter preview

    Hello,

    Is there a way to change the default zoom level when evoking a letter.preview() command ?

    Now i call it from within a script and my page is zoomed in as a default, when i press the zoom button manually i get the zoom level i want...

    thank you,

    Olivier

  • #2
    Re: default zoom on letter preview

    bump

    Comment


    • #3
      Re: default zoom on letter preview

      Olivier,
      If what you want to have is the report to be not zoomed when first called up, I cannot seem to accomplish this either--sending control+Z keys via the send keys function does not work as there seems to be no event in which to place it that will trigger it.
      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


      • #4
        Re: default zoom on letter preview

        The following code will change the zoom level. "Layoutname" could also be a variable containing the layoutname. You need to tun the code in the layout init I believe, or open the layout preview as modeless, then run the needed code.

        Code:
        CurrentZoom=eval("Preview__"+"layoutname"+".Variables().A_XDIALOG.r.zoom(.f.)")  ' Unzooms layout
        
        CurrentZoom=eval("Preview__"+"layoutname"+".Variables().A_XDIALOG.r.zoom(.t.)")  ' zooms layout
        
        CurrentZoom=eval("Preview__"+"layoutname"+".Variables().A_XDIALOG.r.zoom()")  ' Returns .T. if currently Zoomed
        Regards,

        Ira J. Perlow
        Computer Systems Design


        CSDA A5 Products
        New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
        CSDA Barcode Functions

        CSDA Code Utility
        CSDA Screen Capture


        Comment


        • #5
          Re: default zoom on letter preview

          thank you,

          since the letter does not have a init event (only printInit) and i want to affect the zoom in preview mode i assume i have to open it modeless and put the code after the preview command ?

          anyway, thank you very much for your help !

          Comment


          • #6
            Re: default zoom on letter preview

            I've put this in my preview code:

            Code:
            :Letter.Preview("cultuuraanvraag",query.filter,query.order,.F.)
            CurrentZoom=eval("cultuuraanvraag.Variables().A_XDIALOG.r.zoom(.f.)")
            but i get an error ? I cannot find anything about this in the help file ...
            Can you help me ?
            My letter is called "cultuuraanvraag"

            Comment


            • #7
              Re: default zoom on letter preview

              Hi Olivier,

              You had basically the right idea, but why didn't you follow my template above? Where did the "Preview__" go?

              Code:
              letter.preview("cultuuraanvraag",query.filter,query.order,.f.,.f.)
              currentzoom=eval("Preview__"+"cultuuraanvraag"+".Variables().A_XDIALOG.r.zoom(.f.)")
              The second .f. forces the session that invoked the letter.preview to be non-session modal, which is required to get the next line of code to execute.

              Note: I tried this in version 8 Interactive window to run the selected 2 lines of code using the lightning bolt, and the letter.preview command caused the code editor to open up a bunch of non-existent tabs after the interactive window. I'm not sure why that bug occurs, but the above code does work otherwise.
              Regards,

              Ira J. Perlow
              Computer Systems Design


              CSDA A5 Products
              New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
              CSDA Barcode Functions

              CSDA Code Utility
              CSDA Screen Capture


              Comment


              • #8
                Re: default zoom on letter preview

                Hi Ira,
                I had tried this yesterday and ran into the same problem/bug as you regarding the multiple extra tabs. But your script was not working for me at all, kept erroring out with various errors.

                Today, however, after also adding above your two lines of script

                query.filter=""
                query.order=""

                it works perfectly from a form's button but will not work at all from the interactive.

                So long as it works where it should right!! :)

                Hope Olivier gets it going as well now.
                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


                • #9
                  Re: default zoom on letter preview

                  Hi Ira, MikeC,

                  With me it works very well from a form button ! Thank you !

                  I am using V9 on Vista. The machine which is supposed to run my project when everything is fininshed works on win2000 pro nevertheless....

                  Are there any more hidden possibilities like this ? Where did you find this code ?

                  yours, Olivier

                  Comment


                  • #10
                    Re: default zoom on letter preview

                    Hi Olivier,

                    There are probably over 10,000 global functions (and methods which are similar to functions) and scripts available in Alpha Five out of the box. There are other methods and functions available if you know how to find them, and can ascertain their use. Many of these are not documented, and could change in different versions or patch releases. But this is how I found that command.

                    Code:
                    ' Open the letter in preview mode
                    letter.preview("lettertest","","",.f.,.f.)  ' This is OK when you just use the enter to execute
                    ' Get list of open windows to find name of preview window
                    ?a5_list_open_windows()
                    = ControlPanel
                    CodeLibrary
                    Preview__lettertest
                    Code_Editor
                    
                    ' Get pointer to window
                    dim ptr as p
                    ptr=Preview__lettertest.this
                    ' Then enumerate properties
                    ?properties_enum(ptr,"R;O=p|v|t")
                    = .Restore()||Function
                    .....
                    .Variables([C variable_frame_context])||Function
                    .....
                    
                    ' Get pointer to window's variable space
                    dim ptr2 as p
                    ptr2=Preview__lettertest.Variables()
                    ' Enumerate values and methods of window's space recursively
                    ?properties_enum(ptr2,"R;O=p|v|t")
                    = A_file_output|""|Character
                    .....
                    A_xdialog||Property.R||Property..Zoom([L zoomed])||Function
                    .....
                    
                    ' There was a function that looked like a zoom.  Now try it out and see what happens.
                    ?ptr2.A_xdialog.R.Zoom()
                    ?ptr2.A_xdialog.R.Zoom(.t.)
                    ?ptr2.A_xdialog.R.Zoom(.f.)

                    It turns out there are also some undocumented "commands" that can be done, but these have less control as they always toggle (which might be OK for some). I know about them only from experience though.

                    Code:
                    ?ptr.command("preview_zoom")    ' This toggles zoom and unzoom
                    ?ptr.command("PREVIEW_PAGE")    ' This toggles page and (2 page format?)
                    Regards,

                    Ira J. Perlow
                    Computer Systems Design


                    CSDA A5 Products
                    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                    CSDA Barcode Functions

                    CSDA Code Utility
                    CSDA Screen Capture


                    Comment


                    • #11
                      Re: default zoom on letter preview

                      clever !

                      Comment

                      Working...
                      X