Method Community

 

Running a report based off drop-down value (previously worked)

Last post 07-13-2011 12:15 PM by CDS_Josh. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 07-12-2011 4:39 PM

    Running a report based off drop-down value (previously worked)

    I have a question regarding a report that was running based off the value of a drop-down.  Previously the report would pull all records if the value of the drop-down was left untouched.  Now it only pulls records with a blank value for that field.  If you select a value, it returns the correct results. But I can no longer return ALL records.  I know I can create a seperate button to do this, but I would like to keep the functionality within the drop-down.

    Is there a way to return all values if the drop-down is left blank?  I am pulling my hair out trying to figure this out.  I think a recent upgrade to Method changed this functionality because I didn't change anything.

    Thanks in advance for the help.

  • 07-12-2011 5:01 PM In reply to

    Re: Running a report based off drop-down value (previously worked)

    Hi Josh,

    How is the filter setup in your Generate Report action?

    -Michael

    Michael Melo
    Product Manager
    Method Integration Inc.
    Website: http://www.method.me
    LinkedIn: http://www.linkedin.com/in/MichaelMelo
  • 07-12-2011 5:19 PM In reply to

    Re: Running a report based off drop-down value (previously worked)

    First I "Retrieve Value From Screen" and assign it a Name.  Then in the generate report action:


    1) Call the report (CallReport is the name of the report)

    2) Filter Report; Table in Report is Correct (CallReport).  Fields in Table is "Facility". Condition Statement is "Equal to". From "action result" with the name "CallReportAcctNum" which houses the Facility Name from the Retrieve Value from Screen.

     

    It used to work perfect, but now I think its being more exact since its blank, its only returning blank.  Is there anywhere I can put something like:

    If CallReportAcctNum is Null then Return all Records?  Something that that effect.

     

  • 07-12-2011 8:23 PM In reply to

    Re: Running a report based off drop-down value (previously worked)

    Answer

    Josh - it sounds like it's doing what it should be doing.....so maybe the best thing for you is to:

    1. Start Condition Statement - if the dropdown is empty then...

    2. Generate Report - no filter, just show all records.

    3. End Conditional Statement

    4. Start Condition Statement - if the dropdown is NOT empty then...

    5. Generate Report - filter to show based on the desired dropdown value (like you are doing now)

    6. End Conditional Statement

    Sorry, it's more steps, but it's the right thing to do.

    Paul

  • 07-13-2011 11:02 AM In reply to

    Re: Running a report based off drop-down value (previously worked)

    Paul,

    I think that is exactly what I was looking for.  I will give it a try today and let you know how it works out.

    Thanks!

  • 07-13-2011 11:51 AM In reply to

    Re: Running a report based off drop-down value (previously worked)

    Paul,

    That did the trick.  However I found out that with the Method Update there is a new field called filter safeguard which I think was the culprit.  If I set it to "generate always" and change my filtering to "contains" and the value, it worked perfectly for me. Leaving it as "equal to" did not work.

    One of those quarky things that just seemed to do the trick.


    However, I like the conditional statements as well.  Those are going to help me out a lot in teh future.

    Take Care!!

  • 07-13-2011 12:08 PM In reply to

    Re: Running a report based off drop-down value (previously worked)

    Josh -

    The new Filter Safeguard feature isn't the culprit.  That feature wasn't there when you put your original post up, and is unrelated. It's actually a great new feature, that you should try to use whenever it makes sense to do so.

    "Contains" may work in your scenario, but since this is a public forum and everyone may reference this for years to come as a learning tool...........so I'll add some caution...

    I was thinking about recommending Contains to you yesterday, but the problem is that Contains will sometimes give you an undesired result.

    Like, if you are filter based on sales records belonging to "Mary" and you choose "Contains" for your filter criteria, you'll perfectly get all Mary's records in the report........great......until such day that "Maryanne" joins the company and your report is giving you both Mary and Maryanne's records when you run the report for Mary.  That's why I stand by my original recommendation as a best practice to anyone else reading this post!

  • 07-13-2011 12:15 PM In reply to

    Re: Running a report based off drop-down value (previously worked)

    Paul,

    That makes total sense and I apoligize for assuming that the Filter Safeguard was the culprit.  I will see if the customer wants me to use the conditional statement method instead since its a more reliable way to pull the data.

    Thanks again for all your help.  You opened my eyes to some new ways of accomplishing my projects.

    Is there any literature on this Filter Safeguard feature?  If not, can you elaborate on this to myself as with others can benefit from knowing what it does.

Page 1 of 1 (8 items)