Simple

valkatamakevalkatamake Member Posts: 38
Report from Item and item ledger entry
I want to skip records from Item table if there is no record in "item ledger entry" for them.

Comments

  • krikikriki Member, Moderator Posts: 9,110
    On the dataitem there is a property "PrintOnlyIfDetail". Put this to Yes on the Item-dataitem.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • valkatamakevalkatamake Member Posts: 38
    PrintOnlyIfDetail does exactly the oposite of what i want :)
    records from "item" which have records from "ledger" don't show
    records from "item" which don't have records from "ledger" SHOW .. :shock:
  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    Hi valkatamake,

    could you please explain the design of your report ... :|
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • valkatamakevalkatamake Member Posts: 38
    Data items
    Item - main
    item ledger entry - indent

    now shows me example:
    NO.   Descrt.
       1000 car tyres 
                  
                 Item No.   Posting Date   Entry Type
                   1000         01.01.2001    Sale
                   1000         03.01.2001    Sale
                   1000         04.01.2001    Purchase
       1001 car windows
    
                 item no. posting date entry type
    
    ......... i thing you get it
  • vanrofivanrofi Member Posts: 272
    sorry, forget this remark...
  • krikikriki Member, Moderator Posts: 9,110
    In the "Item - OnAfterGetRecord()", put this code:
    recItemLedgerEntry.RESET;
    recItemLedgerEntry.SETCURRENTKEY("Item No.");
    recItemLedgerEntry.SETRANGE("Item No.".Item."No.");
    If NOT recItemLedgerEntry.ISEMPTY THEN
      CurrReport.SKIP;
    

    And you don't need the dataitem on Item Ledger Entry. But you just create a global "recItemLedgerEntry" Record "Item Ledger Entry".
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    "PrintOnlyIfDetail" = YES for Item DataItem must work... :!:

    Just Import the following Object


    If you can Identify why you are getting the opposite output in your report,
    by setting the property, I would appreciate if you could share it.... O:)
    OBJECT Report 80000 Items Report
    {
      OBJECT-PROPERTIES
      {
        Date=07/17/08;
        Time=[ 9:05:58 PM];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
      }
      DATAITEMS
      {
        { PROPERTIES
          {
            DataItemTable=Table27;
            DataItemTableView=SORTING(No.)
                              ORDER(Ascending);
            PrintOnlyIfDetail=Yes;
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18150;
                SectionHeight=1692;
              }
              CONTROLS
              {
                { 1102753001;Label  ;0    ;0    ;7500 ;423  ;FontSize=8;
                                                             FontBold=Yes;
                                                             CaptionML=ENU=Item }
                { 1102753002;TextBox;15000;0    ;3150 ;423  ;HorzAlign=Right;
                                                             SourceExpr=FORMAT(TODAY,0,4) }
                { 1102753003;TextBox;0    ;423  ;7500 ;423  ;SourceExpr=COMPANYNAME }
                { 1102753004;TextBox;17700;423  ;450  ;423  ;CaptionML=ENU=Page;
                                                             SourceExpr=CurrReport.PAGENO }
                { 1102753005;Label  ;16950;423  ;750  ;423  ;ParentControl=1102753004 }
                { 1102753006;TextBox;15900;846  ;2250 ;423  ;HorzAlign=Right;
                                                             SourceExpr=USERID }
                { 1102753009;Label  ;0    ;1269 ;3000 ;423  ;ParentControl=1102753008 }
                { 1102753012;Label  ;5100 ;1269 ;3000 ;423  ;ParentControl=1102753011 }
              }
               }
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=846;
              }
              CONTROLS
              {
                { 1102753008;TextBox;150  ;423  ;4500 ;423  ;HorzAlign=Left;
                                                             SourceExpr="No." }
                { 1102753011;TextBox;4800 ;423  ;4500 ;423  ;HorzAlign=Left;
                                                             SourceExpr=Description }
                { 1102753016;Shape  ;0    ;0    ;18150;423  ;BorderWidth=Hairline;
                                                             ShapeStyle=HorzLine }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=1;
            DataItemTable=Table32;
            PrintOnlyIfDetail=No;
            DataItemLink=Item No.=FIELD(No.);
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18150;
                SectionHeight=423;
              }
              CONTROLS
              {
                { 1102753000;TextBox;7200 ;0    ;2100 ;423  ;SourceExpr="Item No." }
                { 1102753010;TextBox;10200;0    ;1200 ;423  ;SourceExpr="Posting Date" }
                { 1102753014;TextBox;13950;0    ;1500 ;423  ;SourceExpr="Entry Type" }
              }
               }
          }
           }
      }
      REQUESTFORM
      {
        PROPERTIES
        {
          Width=9020;
          Height=3410;
        }
        CONTROLS
        {
        }
      }
      CODE
      {
    
        BEGIN
        END.
      }
    }
    
    
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • valkatamakevalkatamake Member Posts: 38
    may be you didn't understand me


    I WANT TO DO THE OPOSING OF PrintOnlyIfDetail :)

    SKip the items with details and show me the items withoust details :)
  • SavatageSavatage Member Posts: 7,142
    what was wrong with Kriki's code?
  • krikikriki Member, Moderator Posts: 9,110
    Savatage wrote:
    what was wrong with Kriki's code?

    Maybe I should have specified that my code was for showing items WITHOUT item legder entries and to skip the ones WITH item ledger entries. :-k
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • SavatageSavatage Member Posts: 7,142
    I saw you snuk that NOT in there :D
  • valkatamakevalkatamake Member Posts: 38
    kriki wrote:
    Savatage wrote:
    what was wrong with Kriki's code?

    Maybe I should have specified that my code was for showing items WITHOUT item legder entries and to skip the ones WITH item ledger entries. :-k

    Sorry I didn't saw your post Thanks a lot it worked .! =D>
  • krikikriki Member, Moderator Posts: 9,110
    Sorry I didn't saw your post Thanks a lot it worked .! =D>
    No problem. I am :D I could help.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.