Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Simple question on AddBookmark

edited June 2009 in General
Hi,
a simple but urgent question:
in Delphi 2009, how I can assign a dataset bookmark (TBytes) to
ppdbpipeline.AddBookmark that require a long integer?

Thanks in advance!
Stefano Monterisi

Comments

  • edited June 2009


    You can typecast the TBytes as Longint. Demo 0112 in the main reports demo
    shows an example of this.

    myDBPipeline.AddBookmark(Longin(myBookmark));

    TBytes is a dynamic array, so make sure that you keep a reference to it
    around, otherwise the memory will be free'd automatically and a memory error
    will result.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2009
    Hi Nard,
    Sorry but it don't works;
    in a set of 20 selected records, I have always the same 2-3 values as
    longint;
    I need to update urgently an application that have this error but this don't
    works; I use a Devexpress grid for take selected records....

    Stefano



  • edited June 2009

    Did you try running demo 112 of the main reports demo project
    (Demos\Reports\Demo.dpr)?

    In my testing here the demo works correctly.

    As test try creating an example that does not use the DevExpress grid. Use a
    standard Delphi grid instead. If that works, then perhaps there is an issue
    with the DevExpress grid.

    As I mentioned before, TBytes is a dynamic array, so make sure that you keep
    a reference to it
    around, otherwise the memory will be free'd automatically. That might be
    what you are experiencing. (During report generation, the report engine
    calls Pipeline.GetBookmark, GotoBookmark, FreeBookmark quite a bit.
    Internally the DBPipeline class keeps a cached list of bookmarks to avoid
    this type of error. )

    If you still have an issue create a simple example project that uses
    standard Delphi components and RB. Use the DBDemos data or dump some data to
    ClientDataSets. Send in zip format to support@digital-metaphors.com and we
    can run it in the debugger here.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2009
    Hi Nard,
    I will try with an array of Tbookmark....
    Thanks for help,
    Stefano Monterisi


This discussion has been closed.