Not able to show data in report..!!!

Hi All,

I am very new to Navision and have no experience of programming. I am learning it through PDF and this kind of forums.

I am trying to show the data based on location(polyhouse). When I run a report it only shows company name and other name no data is displayed. I am using following code.

IF “Item Ledger Entry”.“Posting Date” = Rdt THEN

CurrReport.SHOWOUTPUT(FALSE);

Q[1]:=0;

Q[2]:=0;

Q[3]:=0;

Q[4]:=0;

Q[5]:=0;

Q[6]:=0;

Q[7]:=0;

Q[8]:=0;

Q[9]:=0;

Q[10]:=0;

Q[11]:=0;

Q[12]:=0;

Qty:=0;

ItemLedgerEntry.RESET;

ItemLedgerEntry.SETRANGE(“Posting Date”,“Item Ledger Entry”.“Posting Date”,“Item Ledger Entry”.“Posting Date”);

ItemLedgerEntry.SETRANGE(“Entry Type”,“Entry Type”::Output);

IF ItemLedgerEntry.FIND(’-’) THEN BEGIN

REPEAT

Qty := ItemLedgerEntry.Quantity;

IF LedEntryDim.GET(32,ItemLedgerEntry.“Entry No.”,‘PLH’) THEN BEGIN

k:=1;

REPEAT

IF (LedEntryDim.“Dimension Value Code” = DimCode[k]) THEN BEGIN

Q[k]:=Qty+Q[k];

IF ItemLedgerEntry.“Posting Date” <> Rdt THEN

T[k]:=Qty+T[k];

END;

k:=k+1;

UNTIL k > 12 ;

END;

UNTIL ItemLedgerEntry.NEXT=0;

END;

Rdt := ItemLedgerEntry.“Posting Date”;

Any help would greatly appreciated. Thanks in advance. :slight_smile:

Welcome to DUG!!!

What is the value in rdt variable ??

As per your program If it is matching with Item ledger entry posting date then it will not display the data

On which section that code is written ? Is it on Body ??

Hi Amol,

Thanks for your quick reply. I see that rdt is defined in global variable but does not seems to have any link in coding. The code is written in Item ledger entry body(3)-onpresection()

In that code when I press CTRL+F12 I get following

Item ledger entry - Onpredataitem()

i:=1;

IF ((Fromdate = 0D) OR (ToDate=0D)) THEN

ERROR(‘Please Enter Date Fields’);

DimensionValue.RESET;

//DimensionValue.SETRANGE(“Dimension Code”,‘PLH’);

DimensionValue.SETRANGE(“Dimension Code”,‘POLYHOUSE’);

DimensionValue.SETRANGE(“Dimension Value Type”,DimensionValue.“Dimension Value Type”::Standard);

//DimensionValue.SETFILTER(Code,‘PH*’);

IF DimensionValue.FIND(’-’) THEN BEGIN

REPEAT

BEGIN

DimCode[i]:=DimensionValue.Code;

DimName[i]:=DimensionValue.Name;

i:=i+1;

END;

UNTIL ((DimensionValue.NEXT =0) OR (i>12));

END;

SETRANGE(“Posting Date”,Fromdate,ToDate);

SETRANGE(“Entry Type”,“Item Ledger Entry”.“Entry Type”::Output);

DT:=Fromdate;

I hope this helps you understand my case better. Thanks again for quick reply… Awaiting some solutions.:slight_smile:

Why the code is written on Predataitem ?

Shift your code to onAftergetrecord trigger and check.

And yes I think it may be matching with "Item Ledger entry ".Where should it be matching to then. I am trying to post the image file that has the report view when it is printed, however not able to do so. Sorry…!! :frowning:

Yes it is checking it with Item Ledger Entry

Thanks your reply, Like I mentioned I am new to it, however, trying to learn it. I shifted the code to onaftergetrecord, it gave error as"The called function can only be called from section trigger".

Is it correct that rdt is matching with Item Ledger Entry?

Which Code you have shifted ??

IF “Item Ledger Entry”.“Posting Date” = Rdt THEN

CurrReport.SHOWOUTPUT(FALSE); -------> This will not work on onAfterGetRecord .This will work on Section only.

Yes, that the one I have shifted. Which did you meant to be shifted?

Shifted means copy and paste.

Curreport.Showoutput(False) will not work on this.

Need to understand what is the report and what is expected from report .??

Yes, I did copied and pasted it. The report is expected to show the polyhouse wise production of item. there are about 12 polyhouse and production quantity of each should show and total should come in the end.

So you need to understand the requirement clearly and then by taking reference of some existing report build the report as well as you need to understand the basic functions of C/AL programming .

This is how the report looks. I though this may help you, help me better :slight_smile: polyhouse name on top then quantity and then total quantity for that polyhouse. Ask me if you need more information.

This is how the report looks. I though this may help you, help me better :slight_smile: polyhouse name on top then quantity and then total quantity for that polyhouse. Ask me if you need more information. It does shows posting dates nothing else apart from What I have done as designing part like lines and boxes for data.