NO DATA SHOWN

Hey, I have question here for this code. May I ask if there’s an error. I find it hard just to show the data that I need to display on the SSRS Report. Thankyou! :slight_smile:

[SysEntryPointAttribute(false)]

public void processReport()

{

Query query;

QueryRun queryRun;

QueryBuildRange dateRange, queryBuildRange;

QueryBuildDataSource queryBuildDataSource;

WizPSDDSDRDataContract datacontract;

CustInvoiceTrans custInvoiceTrans;

CustInvoiceJour custInvoiceJour;

SalesTable salesTable;

EcoResProduct ecoresProduct;

EcoResProductAttributeValue ecoresProductAttributeValue;

EcoResValue ecoresValue;

InventItemGroupItem inventItemGroupItem;

AttributeValueText attributeValueText;

InvoiceDate DateFrom;

InvoiceDate DateTo;

query = new Query(queryStr(‘WizPSDDSDR’));

datacontract = this.parmDataContract();

DateFrom = datacontract.parmFromDate();

DateTo = datacontract.parmFromDate();

dateRange = SysQuery::findOrCreateRange(query.datasourceTable(tableNum(CustInvoiceTrans)),

fieldNum(CustInvoiceTrans,InvoiceDate));

dateRange.value(SysQuery::range(DateFrom,DateTo));

queryRun = new QueryRun(query);

ttsBegin;

while(queryRun.next())

{

tmpWizPSDDSDR.clear();

salesTable = queryRun.get(tableNum(SalesTable));

custInvoiceTrans = queryRun.get(tableNum(CustInvoiceTrans));

custInvoiceJour = queryRun.get(tableNum(CustInvoiceJour));

inventItemGroupItem = queryRun.get(tableNum(InventItemGroupItem));

if(salesTable.dataAreaId == ‘wiz’ && custInvoiceJour.dataAreaId == ‘wiz’ && custInvoiceJour.dataAreaId == ‘wiz’ &&

custInvoiceJour.LedgerVoucher != ‘WIZ-SCrNV’ && custInvoiceJour.SalesId == ‘wiz’ && custInvoiceJour.CustGroup ==

‘AFFIL’ && custInvoiceJour.DeliveryName != ‘infoworx’ && salesTable.DocumentStatus == 7)

{

tmpWizPSDDSDR.InvoiceDate = custInvoiceTrans.InvoiceDate;

tmpWizPSDDSDR.ItemId = custInvoiceTrans.ItemId;

tmpWizPSDDSDR.Name = custInvoiceTrans.Name;

tmpWizPSDDSDR.Qty = custInvoiceTrans.Qty;

tmpWizPSDDSDR.SalesPrice = custInvoiceTrans.SalesPrice;

tmpWizPSDDSDR.LedgerVoucher = custInvoiceJour.LedgerVoucher;

tmpWizPSDDSDR.DeliveryName = custInvoiceJour.DeliveryName;

tmpWizPSDDSDR.CustGroup = custInvoiceJour.CustGroup;

tmpWizPSDDSDR.CustAccount = salesTable.CustAccount;

while select EcoResProduct

where custInvoiceTrans.ItemId == EcoResProduct.DisplayProductNumber

outer join EcoResProductAttributeValue where EcoResProduct.RecId == EcoResProductAttributeValue.Product

outer join EcoResValue where EcoResProductAttributeValue.Value == EcoResValue.RecId

{

ecoresValue = EcoResValue::find(ecoresProductAttributeValue.Value);

tmpWizPSDDSDR.AttributeValueText = EcoResValue.value();

info(strFmt("%1",ecoresValue.value()));

tmpWizPSDDSDR.ItemGroupId = inventItemGroupItem.ItemGroupId;

}

}

else

{

if(salesTable.dataAreaId == ‘inf’ && custInvoiceJour.dataAreaId == ‘inf’ && custInvoiceJour.dataAreaId == ‘inf’ &&

custInvoiceJour.SalesId == ‘inf’ && custInvoiceJour.CustGroup != ‘AFFIL’ &&

custInvoiceJour.DeliveryName != ‘infoworx’ && salesTable.DocumentStatus == 7)

{

tmpWizPSDDSDR.InvoiceDate = custInvoiceTrans.InvoiceDate;

tmpWizPSDDSDR.ItemId = custInvoiceTrans.ItemId;

tmpWizPSDDSDR.Name = custInvoiceTrans.Name;

tmpWizPSDDSDR.Qty = custInvoiceTrans.Qty;

tmpWizPSDDSDR.SalesPrice = custInvoiceTrans.SalesPrice;

tmpWizPSDDSDR.LedgerVoucher = custInvoiceJour.LedgerVoucher;

tmpWizPSDDSDR.DeliveryName = custInvoiceJour.DeliveryName;

tmpWizPSDDSDR.CustGroup = custInvoiceJour.CustGroup;

tmpWizPSDDSDR.CustAccount = salesTable.CustAccount;

while select EcoResProduct

where custInvoiceTrans.ItemId == EcoResProduct.DisplayProductNumber

outer join EcoResProductAttributeValue where EcoResProduct.RecId == EcoResProductAttributeValue.Product

outer join EcoResValue where EcoResProductAttributeValue.Value == EcoResValue.RecId

{

ecoresValue = EcoResValue::find(ecoresProductAttributeValue.Value);

tmpWizPSDDSDR.AttributeValueText = EcoResValue.value();

info(strFmt("%1",ecoresValue.value()));

tmpWizPSDDSDR.ItemGroupId = inventItemGroupItem.ItemGroupId;

}

}

}

tmpWizPSDDSDR.insert();

}

ttsCommit;

}

Hi Kim, welcome to Dynamics User Group forum. Please tell us what kind of problem you have with the code. What did you find when you tried to debug it, before giving up and coming here?

May I also ask you to attach appropriate tags and to run off CAPS LOCK when specifying thread titles? Many thanks!