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

save pdf report one record at a time

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

    #31
    Re: save pdf report one record at a time

    a) I took your suggestion earlier in this thread and moved my dim variables outside of the loop as what you stated made a lot of sense to me.

    b) I added the parameters you are using and I still get no results. It is strange that it works fine in the test db and not the actual one.

    Either way, I guess it is a mute point since your method and script provides me with the results I need, and is far more efficient. It is also another tool that I now have a better understanding of and may be able to make use of again in the future.

    Thanks again for everything.
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

    Comment


      #32
      Re: save pdf report one record at a time

      Cheryl, the biggest difference here is that in my approach a single query is run against the set. In yours the set is queried once for each separate customer. In the small test database you have 3 customers. In the actual database probably a great many more. If you have 500 customers that's 500 queries....

      Comment


        #33
        Re: save pdf report one record at a time

        That difference, Tom, is phenominal. The actual db has more than 1300 records in the customer table and the broadcast_raw has more than 53,000.

        I am quite glad that my approach did not work in the actual db because it gave me the opportunity to learn something new, gave me a better understanding of arrays, and reinforced that one query is definitely better than thousands of queries :)

        This will also make the owner a much happier person as this portion of the process is a very small part of the bigger script, so all the resources and time we can save in the process, the better.
        Cheryl
        #1 Designs By Pagecrazy
        http://pagecrazy.com/

        Comment


          #34
          Re: save pdf report one record at a time

          I am just now getting back to this issue. I got everything working as I wanted to until I tried to convert the script to a function. I have been having difficulty getting the proper parameter values as I need them. I finally managed to get all the parameter values passed as I need them in the function up until the report filter.

          I have two test buttons on the only form. The difference between the two buttons is the field used to run the filter on and in the filename that gets saved. The difference between these two fields is that the first one: Cust_no is a numeric field. It works correctly. The second one is Acctno which is a character field. It works up until it gets to the report filter.

          I have no idea where the filter value is coming from in the error box received. The first part of the filter in the error message is the 'correct' filter, but it adds to that the between(dates) broken out separately and my filename for the acctno as cust_no with var->which.

          I am soooooooooo confused. Please help.

          The final result of the 2nd button should be exactly the same as the first button only with a different filename for the pdf, that being showing the acctno instead of cust_no.

          Example: 203_cc_20080313.pdf for the cust_no
          AND 5300_cc_20080313.pdf for the acctno
          Cheryl
          #1 Designs By Pagecrazy
          http://pagecrazy.com/

          Comment


            #35
            Re: save pdf report one record at a time

            Cheryl,

            The reason the second button did not work is that when the 'which' value was added to the end of the filter it needed to be quoted because the field being tested is character. The numeric worked because even though it is stored as character in the array and then aded to the filter the value was not quoted and therefore at run time the filter interpreted it as numeric.

            In order to get things working I put in an 'If' test based on your function's 'field_type' paramater that quoted if character and not if numeric. (around line 125) Also just above that I had to remove the eval function from the 'which' assignment. It just wasn't needed there and should not have worked at all. For some reason it was letting values through that were all digits but any alpha values it interpreted (correctly) that the 'which' value was the name of a variable containing the value. (which is what eval() is supposed to do.)

            That extra filter that was showing up in the error is the filter that was in place in the actual report properties. I removed it as it was the same as the filter being assigned by the function.

            Attached is your sample with the changes. There is also now a second form that uses a second function. The second function I modified a bit. :) It is using the technique from a few days a go in one of your other threads to get unique values. Basically running the filter with Unique_key_Value() added to it. Then there is no need for the array. (Good for you as you don't seem to like them. :) ) I also included a test for the field type so you don't need that paramater in the function.

            Have fun

            PS How's that kitchen reno coming along?
            Tim Kiebert
            Eagle Creek Citrus
            A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

            Comment


              #36
              Re: save pdf report one record at a time

              Thanks so much Tim, I would look at it in another hour or so and let you know what I end up with. I don't remember how long it took me to even realize that I was dealing with different field types to begin with. Since I never use numeric fields except for calculations, I never even looked at the table structure assuming both fields were character.

              I wrote the original code based on character values. When I realized my problem was the field type I started playing around with the .type_get() without much luck so I added the parameter and started adding if statements.

              I also looked at the code you did for my other issue with the unique value and was going to start playing around with that to fix my problem, but for some reason I was stuck on the idea that I needed the array. I am looking forward to see how you worked it into what I am trying to accomplish.

              Thanks again for your help :)

              EDIT: As far as the kitchen, we keep postponing it due to relatives coming in for visits. Fred seems to think if he postpones it long enough we will save money on the demo side of things because I will have done most of the demo work by the time we start.
              Last edited by Cheryl Lemire; 03-14-2008, 05:40 AM. Reason: forgot the kitchen comment
              Cheryl
              #1 Designs By Pagecrazy
              http://pagecrazy.com/

              Comment


                #37
                Re: save pdf report one record at a time

                Tim,

                I have had a chance to test what you have done for me. Your 2nd function is by far more efficient. The unique value makes a huge difference when there are a ton of records involved. I can't thank you enough for your help. I am going to put your use of unique values into my head in place of the array as I have a feeling I am going to run across similar needs with my current project in the future. Now all I have to do is clean up my code and add a few other items that I need and I will be good to go. Thanks again :D
                Cheryl
                #1 Designs By Pagecrazy
                http://pagecrazy.com/

                Comment


                  #38
                  Re: save pdf report one record at a time

                  Cheryl,

                  Your welcome. I'm glad it is working for you. As far as arrays go, don't discard them completely. They can be a handy tool in the right place.

                  Happy demolitioning.
                  Tim Kiebert
                  Eagle Creek Citrus
                  A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                  Comment

                  Working...
                  X