I am facing problem while retrieving multiple records on a report using display method. Using while select statement I want to print multiple records on a report. Currently it prints on last record on a report except all others.
Any help in this regards pls.
Thanks in advance.
What is the return type of your display method?
if its a temp table, then the temptable.insert should be called inside While loop for inserting all records.
While select * from Inventtable
TmpTable.Field1 = Inventtable.itemId;
TmpTable.Field2 = Inventtable.itemtype;
Info(strfmt("%1–%2",Inventtable.itemId,Inventtable.itemtype)); // for seeing all the records
One can only guess the problem, unless you explain it in an understandable way.
Thanks Anand for your quick reply. Kranthi here is the issue that i am exactly facing, return type of display method is string. But Actually problem is that, I wrote the while select statement in fetch method & by using display method I return on the report ( that string variable which contains more than one record), but it return only last record on a report.
I am customizing FreeTextInvoice Report for multiline.
If possible, will you be able to put down your code here
//Code written in fetch method
public boolean fetch()
while select CustInvoiceTable
where CustINvoiceTable.InvoiceId == InvoiceNo
while select CustInvoiceLine
where CustinvoiceLine.ParentRecId == CustInvoiceTable.RecId
qty = CustInvoiceLine.AutQuantity;
UnitPrice = CustInvoiceLine.AutUnitPrise;
AssessableValue = CustInvoiceLine.AssessableValue_IN;
AutUnit = CustInvoiceLine.AUT_Unit;
TotAssessableValue += CustInvoiceLine.AssessableValue_IN;
ret = super();
//Code written in display method
Display real ItmQty()
//Writing differant Display methods for each returning variable.
Put them in a programmable section and execute it in the while loop
Your report behaves exactly how you told him to behave. All variables in the while select, except TotAssessableValue, are overwritten every time, effective ending up with values from the last record. You’re not sending anything to print in the loop, therefore setting the variables is all what it does.
Then you run the standard print by calling super() and ItmQty() always return the same value from the qty variable.
It could be fixed to work as intended, nevertheless it wouldn’t be a wise approach. Your report doesn’t need any code, so throw it all away, add CustinvoiceLine to the query and bind fields to it. MorphX reports also have sum fields for scenarios like the calculation of TotAssessableValue.
If you get an answer, don’t forget to marked helpful replies as the verified answer.