Hello, I've the following code in a report:
IF ("Field1" <> '') THEN
BEGIN
table1.INIT;
var1:="Field1";
table1.SETFILTER("Document No.",var1);
table1.FIND('-');
END;
I want that the report shows me the Document No. equal to the Field1 from the all table1, but it don't shows me the correct Document No. What's the problem of the code?
Thanks in advance.
0
Comments
Br,
Igor Beeone
Thnaks for your help.
table1.RESET;
table1.SETFILTER("Document No.",Field1);
IF table1.FIND('-') THEN BEGIN
..more code here...
END;
The report shows movements of invoices. In each registry there is a field (Field1) that has an invoice number (Document No.) that already exist and corresponds as well to a invoice number.
I want that, when the report find a registry which has the Field1 informed, the report find the number of invoice (Document No.) which has that number and show them, because there are two or more invoices with the same numeration. The code that I have put before show me an invoice number that doesn't is equal to the Field1, but takes corretly the registers asociateds to the correct numbre; it's strange.
Sorry if I don't explained well myself. Any idea?
IF ("Field1" <> '') THEN
CurrReport.SHOWOUTPUT(TRUE)
ELSE CurrReport.SHOWOUTPUT(FALSE);
IF ("Field1" <> '') THEN
BEGIN
varl1:="Field1";
table1.SETFILTER("Document No.",varl1);
table1.FIND('-');
END;
But the only probem is that it shows me only one document number, and, in more cases there are more documents with the same numbre. Any idea please?.
Thanks.
as I understood:
1) If you need just manipulating within code: But it seems that maybe you would like to printout some info for every document identation. In this case make Main-Detail report:
For example your table Sales Header is the main table and Sales Line is detail table (contains order lines):
1) Create a report
2) Input Main table name (Sales Header) in DataItem
3) Input Detail table name then (next line)
4) for Sales Line push left arrow button
5) select Sales Line DataItem and go to it's properties
6) Input DataItemLink property with: Document No.=FIELD(No.)
Now you will get in sections Sales Line body where sales lines will appear for every document within Sales Header
Hope it helps. Sorry if I'm missunderstanding your needs.
Br,
Igor Beeone
Thank you again for your help and your time.