mmedici Posted November 8, 2010 Share Posted November 8, 2010 I have an existing report that i am trying to modify.Basically i work for a manufacturing company and this report lists the items on hand, items needed per order, and the last column displays if we are over or short for the item.Meaning a customer orders say 20 basketballs, i have 15 on hand, so i am 5 short. I have the variable expression below subracting the columns so i konw if i am over or short, but i am trying to modify the report so it just shows me the items i am short. Any assistance would be appretiated. Code:<variable name="STK_RTOT" class="java.lang.String" resetType="Group" resetGroup="ITMREF_0" incrementType="Group" incrementGroup="SOHNUM_0" calculation="Sum"><variableExpression><![CDATA[$F{TOTSTK} - $V{STK_CNT}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable> Link to comment Share on other sites More sharing options...
despec Posted November 8, 2010 Share Posted November 8, 2010 Hello,How about instead of giving this control to Ireport, do this within your SQL statement--something like:"Select inv_item, qty_stocked, qty_needed, shortfall from db_table where (qty_stocked - qty_needed) <= 0" David Link to comment Share on other sites More sharing options...
mmedici Posted November 8, 2010 Author Share Posted November 8, 2010 Well, i want to start by saying that i am not a database guy so forgive me if my response here is lacking. the database i am trying to connect to is an oracle database. this entire report is written with variable expressions, and i am afraid if i modify it as you stated i will be essentially recreating the entire report correct? i would prefer to avoid that if possible. Link to comment Share on other sites More sharing options...
mmedici Posted November 9, 2010 Author Share Posted November 9, 2010 just wanted to follow up on this to see if anyone had any suggestions. Link to comment Share on other sites More sharing options...
mmedici Posted November 9, 2010 Author Share Posted November 9, 2010 just tried changing it to the below code but it said it couldn't read the expression. <variable name="STK_RTOT" class="java.lang.String" resetType="Group" incrementType="Group" incrementGroup="SOHNUM_0" resetGroup="ITMREF_0" calculation="Sum"> <variableExpression><![CDATA[WHERE $F{TOTSTK} - $V{STK_CNT} < 0]]></variableExpression> <initialValueExpression><![CDATA[0]]></initialValueExpression> </variable> Link to comment Share on other sites More sharing options...
mmedici Posted November 9, 2010 Author Share Posted November 9, 2010 i figured it out Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now