Hello Experts,
I developed custom SSRS report but report not working properly.
Insert method as given below:
Generated report:
While I check in InventTransItem form for same date range there are lot of transaction as given while in my report any showing first record.
*This post is locked for comments
Thnaks all, I change some come now it works
private void insertintotmp()
{
InventDim inventDim;
InventTable inventTable;
InventTransOrigin inventTransOrigin;
SalesLine salesLine;
InventTableModule inventTableModule;
;
inventTable =InventTable::find(inventTrans.ItemId);
{
select firstOnly inventDim where inventDim.inventDimId == inventTrans.inventDimId;
select firstOnly inventTransOrigin where inventTransOrigin.ItemId == inventTrans.ItemId && inventTransOrigin.RecId == inventTrans.InventTransOrigin;
{
weekTmp.ItemId = inventTransOrigin.ItemId;
weekTmp.PQty = inventTrans.Qty;
weekTmp.PAmount = inventTrans.CostAmountPhysical;
weekTmp.FAmount = inventTrans.CostAmountPosted;
weekTmp.FQty = inventTrans.Qty;
weekTmp.Location = InventDim::find(inventTrans.inventDimId).InventLocationId;
weekTmp.Site = inventDim.InventSiteId;
weekTmp.PQtypre = inventTrans.Qty;
weekTmp.PAmountPre = inventTrans.CostAmountPhysical;
weekTmp.FAmountPre = inventTrans.CostAmountPosted;
weekTmp.FQtyPre = inventTrans.Qty;
weekTmp.PAmountVar = ((weekTmp.PAmount) - (weekTmp.PAmountPre));
weekTmp.PQtyVar = (weekTmp.PQty - weekTmp.PQtyVar);
weekTmp.FQtyVar = (weekTmp.FQty - weekTmp.FQtyVar);
weekTmp.FAmountVar = (weekTmp.FAmount - weekTmp.FAmountPre);
}
weekTmp.insert();
}
}
Faiz,
Job getting hang because there is enough data in invent trans table, Will recommend you to write your complete query in SQL and optimize 1st, implement indexes where required..
I am not aware about your business requirement, So i will not comment anything on syntax of query but right now your issue is FirstOnly Keyword...
Sohail, if I removed firstOnly I will not get even any single record and SSRS report/job will be hang.
Have check the firstOnly attribute in your query? kindly remove that and verify again
select firstOnly inventDim where inventDim.inventDimId == inventTrans.inventDimId;
select firstOnly inventTransOrigin where inventTransOrigin.ItemId == inventTable.ItemId && inventTransOrigin.RecId == inventTrans.InventTransOrigin;
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156