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

Print this record and selection filter

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

    Print this record and selection filter

    Using action script
    I can select to print this record(you only have one option)
    I need to print this record plus I Need to exclude record with itemdecription = blank

    I have the 2 codes using xbasic

    query.filter = "isnotblank(\"Invoice_Items->Itemdescription\")"
    query.order = "recno()"
    -- or ----
    record_number = current_record_number()
    query.filter = "recno() = " + record_number
    query.order = ""

    :Report.Print("CashBill3Inch",query.filter,query.order)

    How to combine this 2 codes in one?

    #2
    Re: Print this record and selection filter

    I am not sure why this would be a filter. If you filter for a record number you should get one record. And if you already have the record in focus to be able to grab the record number....??? But, OK...Try:

    Code:
    vfilter="recno()="+record_number + " .and. Invoice_item->itemdescription<>\"\""
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    Comment


      #3
      Re: Print this record and selection filter

      Thanks for the reply. I have to apologize; for not making my self clear.
      I have been under a lot of pressure and I was not thinking clear, as I wrote my request.
      It was obvious to me at that time, But no now as I reflect.
      The record no is for the invoice header in alpha sport and the exclusion to not print blank records is for the invoice_items of the set invoice.

      I am going to try your code sample.
      Thanks.

      Comment


        #4
        Re: Print this record and selection filter

        I tried it, but I got errors.
        Here is the code.

        'Preview a report, label, letter, form or browse layout. You can specify which records to preview.

        record_number = current_record_number()
        ' query.filter = "recno() = " + record_number
        ' query.order = ""
        query.filter = "recno()="+record_number + " .and. Invoice_item->itemdescription<>\"\""
        query.order = ""



        'Prompt user whether to print, or preview the layout. Set default to Print
        prompt_result = ui_get_print_or_preview("Print")
        If prompt_result = "Print" then

        :Report.Print("CashBill3Inch",query.filter,query.order)

        Else if prompt_result = "Preview" then
        :Report.Preview("CashBill3Inch",query.filter,query.order)
        End if

        Comment


          #5
          Re: Print this record and selection filter

          edited

          I think your filter expression is good, assuming your report is running against a single table. If you're doing a cross level query then there are other considerations. But then you haven't mentioned whether the report is based on a set or a single table, or have I missed something?
          Last edited by Tom Cone Jr; 08-12-2010, 08:47 PM.

          Comment


            #6
            Re: Print this record and selection filter

            Thanks for responding Tom, Yes I did mention in in No3, I was using a set.
            The Print "this record" was based in the invoice_header and the option of "do not print blank records" in on the Invoice_items of the INVOICE SET.
            Perhaps this will clarify.

            Comment


              #7
              Re: Print this record and selection filter

              Just to add. In reference to record no:
              This is the original code as defined to just "print this record"
              I got this from converting action script to xbasic.

              query.filter = "recno() = " + record_number

              Is the + record_number missing in

              query.filter = "recno() = record_number .and. alltrim(invoice_item->itemdescription) <> \"\" "


              if So how to incorporate it?

              I still have problems with the syntax in formatting the strings.
              The use of \ and ", are not simple to use.

              As time goes and as I see their usage, I hope to relate to them.

              Comment


                #8
                Re: Print this record and selection filter

                Mike

                How is the set made up

                Something like this (this is taken from the Alpha Sports Sample in the Version 9 samples directory.

                Parent Invoice Header
                Child->Invoice Items
                grand_child->Item description
                Basing what seems to be taken from alpha sports

                Open the alpha sports sample and go to invoice
                open the invoice form in design mode and create a button on the form (does not matter where) - then add this code to the on push event of the button

                Code:
                'Conditional code follows. Executes only if the condition expression is True.
                IF a5_eval_expression("=Product->Description<>\"\"") THEN 
                '
                
                record_number = current_record_number()
                query.filter = "recno() = " + record_number
                query.order = ""
                
                
                
                'Prompt user whether to print, or preview the layout. Set default to Preview 
                prompt_result = ui_get_print_or_preview("Preview ")
                If prompt_result = "Print" then
                	
                :Report.Print("Invoice",query.filter,query.order)
                
                Else if prompt_result = "Preview" then 
                	:Report.Preview("Invoice",query.filter,query.order)
                End if
                END IF
                This is just the xbasic look at the code that was produced using action scripting - what it does it take the current record being viewed - get the record number of that record , however it will only do that if there is a description in the invoice_items->product:description - that is the first line of the code

                Code:
                'Conditional code follows. Executes only if the condition expression is True.
                IF a5_eval_expression("=Product->Description<>\"\"") THEN 
                '
                As everyone who has answered this post - it is hard to grasp just what you are trying to accomplish - "I take it from what I am reading that you want to stop your user from printing an invoice with and Invoice Header and no invoice items - just a guess"

                FWIW

                Tom Baker
                Last edited by Tbaker; 08-14-2010, 12:34 PM. Reason: corrected misspelling

                Comment


                  #9
                  Re: Print this record and selection filter

                  In retrospecting, I should have detail my objective, rather than trying to create a code with a dark background.
                  Yes, I am trying to print an invoice.
                  In my invoice there are Invoice_items with blanks entries.

                  I need to print the invoice from the record that is open/on the screen and only print the correspondig invoice_items wich have a description.

                  Sorry about the confusion.

                  I am sure the next question is why do I have blank records.
                  I have been working on that aspect, but I have not been able.
                  So I did try to overcome the problem.

                  I guess I created another one instead of fixing it.

                  Comment


                    #10
                    Re: Print this record and selection filter

                    Mike

                    Open your report in design mode -

                    In the top menu select Report then select records

                    A genie will pop up

                    In the top box (the filter box) enter

                    Code:
                    Invoice_items->itemdescription<>""
                    then click okay and save the report.

                    Now in the button (or however your are calling to print/preview the invoices)

                    the code should now be just as below (however this will only print the current record not multiple records- just thought I would throw that it)

                    Code:
                    record_number = current_record_number()
                    query.filter = "recno() = " + record_number '[COLOR="Red"]no filter here just record number[/color]
                    query.order = ""
                    
                    
                    
                    'Prompt user whether to print, or preview the layout. Set default to Preview 
                    prompt_result = ui_get_print_or_preview("Preview ")
                    If prompt_result = "Print" then
                    	
                    :Report.Print("Invoice",query.filter,query.order)
                    
                    Else if prompt_result = "Preview" then 
                    	:Report.Preview("Invoice",query.filter,query.order)
                    End if
                    Now when you print your report, only those lines that have an itemdescription will print for the current invoice header record.

                    This is if I read you right.

                    I think this is what you want

                    Tom Baker

                    Comment


                      #11
                      Re: Print this record and selection filter

                      Mike

                      I have attached a small (1 record) application based on what I think you are try to do.

                      There is one Invoice Hdr with a browse with 5 records (2 of which are blank - I had to put 0 in the amount to get the record to hold but the itemdescription is blank)

                      There is a button on the form to print the current record.

                      The Invoice will print (very simple invoice) only showing the the lines in the invoice_items browse that have itemdescription entered.

                      Look at the report (only one) in design mode, click on reports then select records - you will see the filter.

                      Look at the code behind the button (it is in action scripting) - to see the code just click on the pair of glasses at the top of the code editor (but I am sure you know this)

                      Hope this is what you want.

                      Tom Baker

                      edit: changed the zip file attached, there are now two invoices in the table.
                      Last edited by Tbaker; 08-14-2010, 03:50 PM. Reason: added more info - second edit changed the zip file

                      Comment

                      Working...
                      X