Printing locations where no quantity exists

Stimulsoft Reports.WEB discussion
Post Reply
davidanthonyb
Posts: 22
Joined: Sun Apr 03, 2016 2:09 pm

Printing locations where no quantity exists

Post by davidanthonyb »

Hi all,

As the title suggests I'm having some trouble finding out how to create a specific report.

I can create an inventory report including fields such as Inventory ID/SKU, Location ID, quantity, cost, etc.
I am grouping the report by Location ID to see what is in each location.

What I am now trying to do is kind of the opposite; I'd like to exclude locations that have quantity on hand.
Meaning I need a report that shows only those locations that are empty.

Is there a way to use the designer/expression editor to say something like:
if(quantity <= 0) print Location ID ?

I have some experience programming, so I have an idea of how to accomplish what I want, I just don't know what to use in the designer to make it happen.
If any additional information is needed from my end, please feel free to ask!

Thanks in advance for any and all help!
David
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Printing locations where no quantity exists

Post by Alex K. »

Hello,

Please try to use the Filter for the DataBand component.
If the issue still present please send us a sample report with test data for analysis, we will try to find a solution for you.

Thank you.
davidanthonyb
Posts: 22
Joined: Sun Apr 03, 2016 2:09 pm

Re: Printing locations where no quantity exists

Post by davidanthonyb »

Aleksey wrote:Hello,

Please try to use the Filter for the DataBand component.
If the issue still present please send us a sample report with test data for analysis, we will try to find a solution for you.

Thank you.

Hello Aleksey,

Thanks for the response! I am familiar with adding filters to the DataBand, but I am still a little confused.

So the data columns in the report include "Location ID", and "Quantity" among others.
The only thing I could think to try was using the expression editor when adding a filter, and saying something like:

Table1.LocationsLocationCode.Where(Table1.ItemsQuantity <= 0)

I am grouping by Location ID, and I need to determine whether ANY line item has quantity. If there is quantity of any line item in that Location grouping, I would like to dismiss the entire Location grouping.

Also, if it matters, we are using Reports.Web Version 2011.3.1200.


Thank you again for the response, and I appreciate any help!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Printing locations where no quantity exists

Post by HighAley »

Hello, David.

If you need to check for records where quantity is empty, there should be null values.
Then you should check for null values:
isNull.png
isNull.png (6.93 KiB) Viewed 1646 times
or use next expression in Filter:

Code: Select all

MyDataSource["MyField"] == DBNull.Value
Thank you.
davidanthonyb
Posts: 22
Joined: Sun Apr 03, 2016 2:09 pm

Re: Printing locations where no quantity exists

Post by davidanthonyb »

HighAley wrote:Hello, David.

If you need to check for records where quantity is empty, there should be null values.
Then you should check for null values:
isNull.png
or use next expression in Filter:

Code: Select all

MyDataSource["MyField"] == DBNull.Value
Thank you.

Hi there,

Thanks for the response. Unfortunately I don't have the option for null in my databand filters.
As far as the second option using the expression editor, if both the Location ID and the quantity are datasources, how would I check that?

Secondly just to clarify, having a stock item in a location doesn't mean there is quantity of that item in that location. That said...

I would need to use some kind of hasNext method right? Saying:
1. Okay yes there is a location
2. Do stock item files exist there currently?
3. is there currently quantity of that stock item there?
4. If not, I need to print that location.


Thanks in advance.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Printing locations where no quantity exists

Post by Alex K. »

Hello,

Please send us a sample report with test data for analysis.

Thank you.
Post Reply