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

Report detail section spacing problem

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

    Report detail section spacing problem

    I want to design a report which can be saved as a text file. Based on a set, the main table 'produces' a header text line; there are then various individual text lines in the detail section on the number of filtered records in the linked table; and a footer text line containing totals from those individual lines.

    The problem is that each of the lines in the detail section of the report is 773 characters long. Various fields are used for the first 157 characters plus 14 other sections of 44 characters each- again extracted from comprised of various filtered fields.

    I can probably achieve the 773 characters in one text line by increasing the report width but I have to split the detail line into various calculated text fields because the size of these is restricted to 256 characters - can't use a calculated Memo fields since this is not an available option.

    I experimented with one field of 157 characters and some more of 44 characters each. This creates a problem of spacing between the fields because about 5 spaces appear between each of them in the final text file and I don't know how to overcome this in the report line design.

    Obviously I could prepare the file in xbasic using write_line etc routines but the coding is complicated and difficult to make error free. I also tried a summarise operation for the header/footer line details (works well) and a crosstab operation to simplify collecting the data needed for the detail lines but I would need 14 of these creating different tables due to differing filter problems!

    Has anyone any suggestions please, preferably to help me overcome the spacing problem mentioned above? Mike Vance

    #2
    RE: Report detail section spacing problem

    Mike,

    Could you attach a snapshot of the text file you get now and perhaps show us that way what is wrong with it and how you want to change it? Maybe even a pic of the report in design mode? Forgive me for my ignorance, but I was not aware that any text file could hold 773 characters in 'one' line so that it is legible so I am sure I am misunderstanding exactly what you are trying to accomplish.

    Is it the formatting of the text file that you are trying to adjust? Or are you doing something else with this text file afterwards that is not giving you the end results you are looking for?

    Good luck
    Cheryl
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

    Comment


      #3
      RE: Report detail section spacing problem

      Hi Mike

      Have you tried alltrim(field_name)? This will remove all blanks.

      Regards

      Keith Hubert

      Guild Member
      London.
      Regards
      Keith Hubert
      Alpha Guild Member
      London.
      KHDB Management Systems
      Skype = keith.hubert


      For your day-to-day Needs, you Need an Alpha Database!

      Comment


        #4
        RE: Report detail section spacing problem

        Cheryl - the text file is required by out local income tax authority and contains confidential data so I cannot send you an example. I have used Visual Basic many times in the past to create the text file with line lengths of 773 characters so there is no problem about that, only how to do it in the easiest way with Alpha Five. Mike

        Comment


          #5
          RE: Report detail section spacing problem

          Keith - alltrim won't help here. It's the spacing between the fields of the reports which creates the spaces. If I can't prevent these happening I will have to modify the text file created by the report. This would be painstaking and a waste of time. I could code the text file lines in xbasic without going through the report design at all and then I could make sure there were no spaces. Mike

          Comment


            #6
            RE: Report detail section spacing problem

            Hi Mike,

            I have done many "exports" of data in text files and have found the best way is in XBasic as you described.

            Xbasic is not as difficult as you may think for doing this as you just concatenate all the fields you want to a temp variable and then do the one write for each line.

            Open Alpha file
            Open text file
            Set index if needed
            Go to first record
            Loop while not EOF
            Concatenate fields to a variable
            Write line to text file
            next record
            Close text file
            Close Alpha file

            HTH
            Doug

            Comment


              #7
              RE: Report detail section spacing problem

              Hi Doug - Thanks for your comments and xbasic code example. I have experimented with that type of routine and think I must go along that route although I was trying to avoid it because of the large number of variables, DBSums and other 'information gathering code' needed. The Report was an attempt to save a bit of work. Your help appreciated. Thanks. Mike

              Comment


                #8
                RE: Report detail section spacing problem

                Mike:
                If vertical allign is of no concern, combine your fields in RTF. That should take care of the problem.
                Gabe

                Comment


                  #9
                  RE: Report detail section spacing problem

                  Gabe - I did think of trying RTF but never got round to it. Will give it a go. Thanks for the suggestion. Mike.

                  Comment


                    #10
                    RE: Report detail section spacing problem

                    I have since used a similar routine to Doug's to write lines to a text file. Cheryl appears to be right as far as Alpha Five variables are concerned since I could only get 188 characters on each line, although when concatentated my variable was 700 + characters.

                    There is no such problem in Visual Basic! The following code shows how to achieve large width text files in VB6.

                    Visual Basic routine to write line to a text file:-

                    TempFileNum=FreeFile
                    TempFileName="C:\atextfilename.txt"
                    Open TempFileName for Output as #TempFileNum
                    Print #TempFileNum, tempstring 'tempstring can be 700 characters plus - lots of these lines can be written in a loop
                    Close #TempFileNum

                    Visual Basic routine to read the text file:-

                    Open TempFileName for Input as TempFileNum
                    Multi-LineTextbox. text = Input$(LOF(TempFileNum), #TempFileNum)
                    Close #TempFileNum

                    Is there anyway Alpha Five can cope with this - I can't use RTF variables (not possible). I know I should have tested this before spending weeks on my project! Help please. Mike

                    Comment


                      #11
                      RE: Report detail section spacing problem

                      Mike,

                      Is the problem encountered when you try to use a report layout to view / print the large variable? Or, are you saying that you cannot create the text file in the first place?

                      -- tom

                      Comment


                        #12
                        RE: Report detail section spacing problem

                        Tom - I can create the text file without problems but each line in it is a maximum of 188 characters or thereabouts because the Alpha Five variables won't take any more characters. Mike.

                        Comment


                          #13
                          RE: Report detail section spacing problem

                          Mike,

                          I'm very inexperienced in using BLOB variables, but they might be the key to a solution for you here.

                          Here's a script that will build a text file (on floppy) that
                          has a single line in it which contains your name repeated 50 times.

                          dim bb as B 'blob
                          bb = space(1000) 'size it larger than largest string on any one line
                          blob_size = bb.size()
                          trace.writeln(str(blob_size))
                          for n = 1 to 50
                          bb.pokec((n*11)-10 ,"Mike Vance ") 'Notice text string has 11 characters in it.
                          next n
                          text_size = 11 * n 'keep track where last byte was written
                          file_pointer = file.create("A:" + chr(92)+"output.txt",FILE_RW_SHARED)

                          for i = 1 to text_size
                          file_pointer.write(bb.peekc(i,1))
                          next i


                          file_pointer.flush()
                          file_pointer.close()

                          Comment


                            #14
                            RE: Report detail section spacing problem

                            Mike,

                            I went back to test the thesis that we can't use long character strings, and found that they work just fine.

                            dim long_string as C
                            long_string = replicate("Tom Cone Jr ",60)
                            trace.writeln(long_string)

                            file_pointer = file.create("A:" + chr(92)+"output.txt",FILE_RW_SHARED)
                            file_pointer.write_line(long_string)
                            file_pointer.flush()
                            file_pointer.close()


                            Perhaps there's an error in your script that is causing your string to be truncated ?

                            Working with the string like this is much much easier than working with blobs.

                            -- tom

                            Comment


                              #15
                              RE: Report detail section spacing problem

                              Thanks Tom. Will 'play' with a Blob. Mike

                              Comment

                              Working...
                              X