Options

Excel Buffer - PrintOnlyIfDetail

jamesjames Member Posts: 56
I have a report which is based on two tables (Vendor + Value Entry) and I've been able to export it to excel with the use of excel buffer, however I have a problem that it is printing out every record of a Vendor even if there are not any value entry's for this vendor.

The Vendor table itself within the report has PrintOnlyIfDetail set to Yes, however the excel export is not taking this into consideration (but obviously the report within Navision is excluding these Vendors)

I must be missing something simple here, or is this functionality not possible with Excel Buffer???

Thanks for any help ...

Comments

  • WaldoWaldo Member Posts: 3,412
    How did you link the two data items? Through the properties or with code?

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • YaKYaK Member Posts: 1
    Have you tried moving the Excel-related code into the report's Sections?
  • jamesjames Member Posts: 56
    Waldo - It is through the standard DataItemLink

    YaK - Yes, I tried to put it into the report section, however it still prints out every Vendor even if there is no Value Entries
  • MbadMbad Member Posts: 344
    What section type is your vendor information in?
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Hi James,

    yes this is normal functionality. PrintOnlyIfDetail (as it implies) only affects printing, not processing. Internally in Navision the way it works, is that as the report runs through the sub item (the Vendor Entry inyour case), if ever a line is printed, then it sets a flag to say that there is detail, so print the first line. Keep in mind that the report it self, when the Vendor section is processed has no idea if sub sections (Detail) will print or not. There are too many possible ways to suppress printing.

    So your solution:

    remove the Data Item link, and replace it with code;
    [b]Vendor - On After Get Record[/b]
    "Vendor Ledger Entry".Setkey... 
    "Vendor Ledger Entry".Setrange etc...
    If not "Vendor Ledger Entry".FIND('-') then
       currreport.skip;
    

    Or something like that. I have done it heaps of times, but I am just typing from memory here.
    David Singleton
Sign In or Register to comment.