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

Dynamic Control of Report Objects

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

    Dynamic Control of Report Objects

    Can I dynamically change the "left" "width" parameters for an object on a report?

    Through another routine, I have assigned values to the variables "LeftCol1" and "WidthCol1".

    Now, using those variables, I want the data in the object called Column1 to begin at the inch value of LeftCol1 and be as wide as the inch value of WidthCol1.

    There are no events in the code editor for reports other than OnPrintInit and OnPrintExit into which to put code, so I wrote the OnPrintInit routine to read:

    :ReportA:Column1.object.left = LeftCol1
    :ReportA:Column1.object.width = WidthCol1

    It doesn't work. What am I missing?

    (Column1 already exists on the Report, I just want to dynamically move it.)

    #2
    RE: Dynamic Control of Report Objects

    Roy, your question interested me since I've never attempt such a thing. I designed a simple two column report, using the genie to create a tabular format.

    I then used the Xbasic Explorer to examine the properties of the report and its various components. Could not find a 'Column1' object or property.

    There are 'left' and 'width' properties. Have you tried manipulating them like this:

    :ReportA.left = var->LeftCol1
    :ReportA.width = var->WidthCol1

    If this works it suggests that the left margin and width of each column will be the same... hope that works for you.

    when I check the results of the default properties I was surprised at the numbers for left and width. I suspect the report engine is using something other than inches to position the left margin and width of each column. You might want to examine these values first, before manipulating them with your script.

    Let us know how things turn out.

    -- tom

    Comment


      #3
      RE: Dynamic Control of Report Objects

      Roy,

      I actually have tried to this, and Alpha lets you do half of the task. You can adjust both the height and width, but not the top and left parameters. I actually asked Selwyn if he could add the top and left capability to the new version/maintenance release, and he said that what I was attempting was effectively doable in A5V5.

      To adjust the height and width (and some other properties - I think justification works too), you need to go to the Detail section in code window while editing the report. Place the code in that object.

      Regards,

      Ira J. Perlow
      Computer Systems Design & Associates
      [email protected]
      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


        #4
        RE: Dynamic Control of Report Objects

        As a follow up, I tried manipulating the left margin of my two column report using the OnPrintInit event.

        The script I tried was

        :reportname.left = 240

        then

        :reportname.left = 90

        I saw no difference in the previewed report.

        -- tom

        Comment


          #5
          RE: Dynamic Control of Report Objects

          Tom,
          Thanks for your comments. Let me clarify what I am trying to do a bit more.

          Column1 was merely the name I assigned to the first field in the report. I is not an A5 internal variable What I ultimately want to do is design a "Build Your Own Report" report. The report will have maybe 6 columns to it, but since I don't know whether the user will want chose a 5 character or 20 character field for any particular column, I want to be able to control the placement of each of the "detail" fields (which I call Column1 thru Column6). If the width for the data I pour into Column1 is, let's say, 5, then I will start Column2 at 1 in from the left margin. If the width for the data I pour into Column2 is let's say 15, then I want to start Column3 at 2.5 inches from the left margin (or whatever works).
          Everything has to be dynamic, though, since the user may choose a 15 width Column1 and a 20 width Column2. I've already perfected the choosing-the-fields and determining-their-widths, routine. Now I need to work on the report layout which the "choosing" routine will feed.

          Thanks again,
          Roy

          Comment


            #6
            RE: Dynamic Control of Report Objects

            Oops! Boy, did I misunderstand! Since Alpha Five permits you to break the detail section into multiple columns, I thought that's what you're doing... wrong! You are going for detail section that is a simple tabular layout, and despite the fact that there are multiple fields on each row, the detail section (region) itself has only one column... i.e. the full width of the report.

            Having said all that I'm sorry to report that I don't know of a way to do what you are attempting... what you really need is a way to construct a report layout in xbasic, in a fashion similar to the tools which are available to create a table using only xbasic.

            Maybe you could work around this with a bit of a kludge (sp?).

            If the user can tell you which fields they want in the report, why not create a new table using xbasic, include only the fields the user wants in the report, copy the desired fields into each record there, and then print the default browse for the new table?

            --tom



            -- tom

            Comment


              #7
              RE: Dynamic Control of Report Objects

              Thatt's a neat idea, and maybe a lot easier. Let me give that a shot. Thanks.
              Roy

              Comment


                #8
                RE: Dynamic Control of Report Objects

                Tom,

                "If the user can tell you which fields they want in the report, why not create a new table using xbasic, include only the fields the user wants in the report, copy the desired fields into each record there, and then print the default browse for the new table?"

                Since I have already been down this road to try to do an "Adhoc Report" (and that is why I know which properties can be modified on-the-fly and which cannot in the detail event), the reason the Browse will not work is that you can not perform totals, create titles, etc.

                I actually know of a way to adjust fields in an Adhoc report and my testing has confirmed it some months ago. It basically requires all fields to be converted to a character format. All the fields on the report needs to be the full width of the page. You then just pad the field with as many spaces as required to push the field to where you want it. (Of course you have to calibrate to the font width of a space to the distance in inches to pad it)

                Regards,

                Ira J. Perlow
                Computer Systems Design & Associates
                [email protected]
                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


                  #9
                  RE: Dynamic Control of Report Objects

                  Tom,

                  "If the user can tell you which fields they want in the report, why not create a new table using xbasic, include only the fields the user wants in the report, copy the desired fields into each record there, and then print the default browse for the new table?"

                  Since I have already been down this road to try to do an "Adhoc Report" (and that is why I know which properties can be modified on-the-fly and which cannot in the detail event), the reason the Browse will not work is that you can not perform totals, create titles, etc.

                  I actually know of a way to adjust fields in an Adhoc report and my testing has confirmed it some months ago. It basically requires all fields to be converted to a character format. All the fields on the report needs to be the full width of the page. You then just pad the field with as many spaces as required to push the field to where you want it. (Of course you have to calibrate to the font width of a space to the distance in inches to pad it)

                  Regards,

                  Ira J. Perlow
                  Computer Systems Design & Associates
                  [email protected]
                  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


                    #10
                    RE: Dynamic Control of Report Objects

                    Ira,

                    Yes, I see what you mean.

                    I'm certain you must have tried this, but did you try embedding Tab characters into the string? That might alleviate some of the difficulties trying to line up the fields from one row to the next...

                    -- tom

                    Comment

                    Working...
                    X