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

Empty report using report.saveas() for pdf

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

    Empty report using report.saveas() for pdf

    I’ve searched and read about filtering reports and saving pdf files but I have not come up with a solution to my problem.

    I have a report (SetListMaster) based upon a 1:M:1 set (Songs:Notes:Instrument). The Songs table has a field =Group that holds a text value for the Setlist to which the song has been chosen for (set1, set2, etc).

    I use an embedded browse on a form based upon a second 1:M set (Band:Instruments) to select the instrument (inst_id) into a global variable- (vSinst) to filter the report. The filter works well for preview.
    Code:
    query.filter = "(( \"Set\" $ Group ) )  .and. (Notes->Inst_refno = Var->vSinst  )"
    query.order = "pick"
    query.filter = convert_expression(query.filter,"V")
    
    :Report.Preview("SetListMaster",query.filter,query.order)
    I want to email this report to the Members, so I want to save the report as a PDF file and sent it via email. So I try and save the report with the same filter:

    Code:
    query.filter = "(( \"Set\" $ Group ) )  .and. (Notes->Inst_refno = Var->vSinst  )"
    query.order = "pick"
    query.filter = convert_expression(query.filter,"V")
    
    dim shared veatt as C
    dim shared vSLRpdf as C
    vSLRpdf = a5.get_path() + "\SetListReport.pdf"
    veatt = report.saveas("SetListMaster", "PDF",query.filter, "", vSLRpdf, .F.)
    The report saves but is empty… no records.

    Now if I combine the two actions preview and then save the report as pdf file, it saves the report correctly filter with records as PDF file. But I don’t want to have to preview each report prior to saving, as I want my script to eventually cycle through all members and send each their respective setlists without having to preview.

    How can I get the report to save a filtered report as PDF for email without having to preview it? I have tried shifting the filter to the report… didn’t work.

    In the example, it opens to the main menu. Press red button ‘print/email Setlist which takes you to the Distribution form. Select any member/instrument and choose the preview or email button. The preview button runs UDF ‘distribute_preview’ and the other ‘distribute_email_one’. The preview button does the following:
    1. Acuires the instrument id as vSinst and takes you to the report preview with the report filtered.
    2. Saves the report as pdf after exiting preview
    3. Displays a dialog that prompts the user to view or not view the pdf file.
    4. Displays the saved pdf if YES is chosen.

    The email button skips the preview event in step 1. Chose YES view PDF and you will see for the email script the saved report is empty.

    I am at a loss and could use some help, please.
    Last edited by Mike Wilson; 11-15-2007, 03:19 PM.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    #2
    Re: Empty report using report.saveas() for pdf

    Mike:
    Without delving too much in all the details (I must have Attention Deficit Syndrome! seriously.) Cal started a simillar thread a while back and my response was to archieve the file. It works. I don't know why or how or any of these details. Quite possibly it might be a bug. But archieve works and serves the same purpose with an added caveat, it date and time stamps the file. You could certainly change the name if you want.

    Comment


      #3
      Re: Empty report using report.saveas() for pdf

      Mike, The form based on the second set you mention is missing. The set is missing. Not sure how to populate sample filter criteria. Need you to furnish detailed instructions on how to trigger the fault. Please use actual form, table, set, and field names...

      Later:
      Press red button �print/email Setlist which takes you to the Distribution form.
      There is no red button. The green button does not open a form. I'm lost.
      Last edited by Tom Cone Jr; 11-15-2007, 04:36 PM.

      Comment


        #4
        Re: Empty report using report.saveas() for pdf

        Tom sorry for any confusion I created. I appreciate your looking at it.

        Set 1: Songs:Notes:Instrument in 1:M:1 set. This feeds the Report - "SetListMaster".

        Set 2: Band:Instrument:Member (1:M:1) table. Red button on the Main Menu opens form Fs_Band based upon this set. The two buttons on this form address the preview of SetListMaster report or the save the report to PDF for emailing report.

        The relationship of these runs through the Instrument (inst_refno) present in the Notes table and the Instrument table.

        So,
        In the example, it opens to the main menu. Press red button (it's really there) now it's ‘Distribution which opens the Distribution form. Select any member/instrument in the Browse and choose the preview or email button. The preview button runs UDF ‘distribute_preview’ and the other ‘distribute_email_one’. The preview button does the following:

        1. Acquires the instrument refno as vSinst and takes you to the report preview with the report filtered.
        2. Saves the report as pdf after exiting preview.
        3. Displays a dialog that prompts the user to view or not view the pdf file.
        4. Displays the saved pdf if YES is chosen.

        The email button skips the preview part of step 1. Chose YES view PDF and you will see for the email script the saved report is empty.
        Last edited by Mike Wilson; 11-15-2007, 07:50 PM.
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #5
          Re: Empty report using report.saveas() for pdf

          Hi Mike,

          I have not looked at your sample, but are you dropping your query after previewing the report? Or are you clearing any/all queries before attempting to just use the saveas? It is possible that this is causing the report not to save properly with your filter.
          Cheryl
          #1 Designs By Pagecrazy
          http://pagecrazy.com/

          Comment


            #6
            Re: Empty report using report.saveas() for pdf

            Hi Cheryl,
            No I am not dropping any queries. But it doesn't work even if there are no querys in the system. ie, open database, go directly to executing the udf that saves the report -- no go. I'm afraid it is all about your and my nemesis...It is all about the filter. It works for the preview but not for the report.saveas()

            Later:

            I tried this in the IW for the s_songs set that the report is based upon:
            Code:
            dim global vSinst as C = "In-04"
            
            filter = "(( \"Set\" $ Group ) )  .and. (Notes->Inst_refno = Var->vSinst  )"
            
            ? a5_get_records_in_query("S_songs",filter)
            I got an error: "Cannot open table". Wonder what that's about?
            Last edited by Mike Wilson; 11-15-2007, 07:58 PM.
            Mike W
            __________________________
            "I rebel in at least small things to express to the world that I have not completely surrendered"

            Comment


              #7
              Re: Empty report using report.saveas() for pdf

              Hi Mike,

              I added two lines of code to your distribute_setlist_one(). See the red below:

              Code:
              'Filters for the report
              [COLOR=Red]        'added following 2 lines of code to set proper filter
                      dim global vSinst as C
                      vSinst = parentform:Browse1:IRN.value
                      'below original filter ok and unchanged
              [/COLOR]        query.filter = "(( \"Set\" $ Group ) )  .and. (Notes->Inst_refno = Var->vSinst  )"
                      query.order = "pick"
                      query.filter = convert_expression(query.filter,"V")
              When creating your function to not include the preview, you neglected to include the proper value for your variable vSinst.
              Cheryl
              #1 Designs By Pagecrazy
              http://pagecrazy.com/

              Comment


                #8
                Re: Empty report using report.saveas() for pdf

                Cheryl, Mike,

                I just was about to post the same thing.

                The distribute_setlist_one() function does have those two lines right at the top(lines 12 and 13) but the wrong browse object is being used as the value. (At least a different one to the preview function)
                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


                  #9
                  Re: Empty report using report.saveas() for pdf

                  WOW, I actually beat one of the masters :)
                  Cheryl
                  #1 Designs By Pagecrazy
                  http://pagecrazy.com/

                  Comment


                    #10
                    Re: Empty report using report.saveas() for pdf

                    Masters??????? Sorry, you must have me confused with someone else. I think you have been giving that kitchen wall a beating again.;)
                    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


                      #11
                      Re: Empty report using report.saveas() for pdf

                      HAHAHAHA!!!! Giving the kitchen wall a beating is how I keep my sanity. When i cannot solve my own problems, I look real hard in the forums to find something easy that I can figure out :)
                      Cheryl
                      #1 Designs By Pagecrazy
                      http://pagecrazy.com/

                      Comment


                        #12
                        Re: Empty report using report.saveas() for pdf

                        Mike, I avoid using the filter and order properties of the global query pointer variable for these kinds of things. Conventional variables suffice and you don't have a problem later on when a value assigned here persists when the query object is used with a completely different table elsewhere in the application. Not sure what others think of this, but your use of query.filter and query.order makes the hair on the back of my neck stand up. :)

                        -- tom

                        Comment


                          #13
                          Re: Empty report using report.saveas() for pdf

                          Cheryl, Tim
                          I can't thank you enough. Especially you girl (that would be Cheryl) having resolved countless hours for me in the past week. I have recently reviewed my posts for help and resolves and it has fallen into to two categories. The things I did not know, and the things I couldn't see that I clearly did know. This was within the later. Thank you so much for your eagle eyes. Truly!

                          Tom,
                          I am a marginally evolved Action Scripter. I learned through reading and evaluating action script code. The query.filter and query.order system is a product of that and some from Dr. Wayne's book. I do hear what you are saying in reference to global variables, as I am honestly just now beginning to understand the true scope of context the global variable SHOULD be held to. I appreciate the nudge to study this circumstance in that light with more scrutiny. Thank you, very much.
                          Mike W
                          __________________________
                          "I rebel in at least small things to express to the world that I have not completely surrendered"

                          Comment


                            #14
                            Re: Empty report using report.saveas() for pdf

                            The one constant that I can say I have learned in the past 10 years of programming is that if you have banged your head against the wall for any length of time trying to resolve a problem ... it is ALWAYS best to ask another set of 'eyes' to look at the issue. I can't count the number of times I have missed a colon or forgot to close something that was opened earlier, or any other number of things that 'I clearly knew' just could not see.

                            It is also nice having this forum as a sounding board. Watching some of these threads and the discussions really help to clear ones head so that as a team, a resolution can be found.

                            I have found the stereotype of programmers being loners true, however, I have also found that programmers are the most helpful and willing to be a team player. Maybe because we all have the same 'strange' way of looking at things :)

                            Maybe we all just love to solve a good mystery.
                            Cheryl
                            #1 Designs By Pagecrazy
                            http://pagecrazy.com/

                            Comment


                              #15
                              Re: Empty report using report.saveas() for pdf

                              Originally posted by Mike Wilson View Post
                              Cheryl, Tim
                              I can't thank you enough. Especially you girl (that would be Cheryl)
                              Funny guy, Mike. Were you starting to think that programming was to hard and maybe you should try comedy.:)

                              PS your welcome.
                              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