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

DataView Linking issue

edited July 2005 in General
Hi,

I wrote an application similar to Demo End User -> Report Explorer, so I
can edit reports without changing the application.

It happens that I?m having some issues witk DataView Linking. In some
places it simply doesn?t work, I link the dataView to the master and the
linked detail brings all records in the database. So, I have two questions

1) Does links bring all data from database and make filtering in the client?
(I guess not, because it?s easy to make this become impossible to handle)
2) Anyone knows any known bugs regarding to Master-Detail linking?

thank you all

Ricardo

Comments

  • edited July 2005
    Hi Ricardo,

    The linking logic in DADE is working as designed. Be sure you are dragging
    the link from the detail dataview to the master dataview, and that there is
    a one to many relationship between the master field and the detail field.
    Take a look at some of the example reports included in the
    \RBuilder\Demos\End User\Report Explorer\... example for how the linking
    might be done and what results you can expect.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2005
    Hi Nico,

    Thanks for your attention. I?ve looked at it again and it seems it?s ok. I
    realized that I was doing something that was deleting the link. In runtime I
    was doing this:

    aSql is a TdaSQL extracted from my Pipeline.

    aSQL.EditSQLAsText;
    aSQL.SQLText := replaceParam(aSQL.SQLText, ID);

    replaceParam is a function that replaces "-1" by the actual ID that I want
    to print.

    I think EditSQLAsText was the problem.

    Then I changed the way I replace "-1" by the actual ID. Now it?s like this:

    if aSQL.criteria[0].Value = "-1" then
    aSQL.criteria[0].Value := intToStr(ID);

    But now I?m getting this message: "No Current Record for Fetch operation".

    Then I tried to view data in the pipelines directly and it did not show this
    message. But if I change the -1 to an actual Id it gives the message. Long
    story in short, if the master doesn?s bring any data, no error at all, but
    if it brings anything I get this message.

    thank you




  • edited July 2005

    1. For future reference. If have encounter an issue, please comment out all
    of your event-handler code associated with the report and then re-test. In
    general, run-time code can quite easily sabbotage the report generation
    process.

    2. If you manually edit the SQL as text, then linking and autosearch will no
    longer work. The TdaSQL is managed as a set of objects (SelectFields,
    SelectTables, etc. ). It then generates the SQL. For a detail query linked
    to a master, there is special linking SQL that is generated. (see article
    below).

    3. You should not modify the data in any manner while the report is
    executing.

    4. ReportBuilder 9 contains new TdaSQLBuilder class that provides a runtime
    interface for modifying the TdaSQL. There are 2 new events
    Report.OnInitializeParameters and Report.BeforeOpenDataPipelines that occur
    prior the report engine opening and initializing itself.

    5. What are trying to accomplish? That will help me to suggest a solution.



    -------------------------------------------
    Tech Tip: Linking DataViews
    -------------------------------------------

    Overview
    ---------

    Linking DataViews in the ReportBuilder Data workspace (DADE), requires that
    the detail data be sorted by the linking fields. When DataViews are linked,
    DADE generates special linking SQL for the detail DataView. The linking SQL
    (Magic SQL) can be viewed by positioning the mouse over the DataView window
    and pressing Ctrl + Left Mouse button. The results of the Magic SQL query
    can be viewed by pressing Shift + Left Mouse button.

    ReportBuilder's DataPipeline architecture includes support for linked data
    traversal. Whenver the record position of the master data changes, the
    traversal logic compares the master and detail field link values and then
    determines where to locate the record position for the related detail data.
    The linking logic will only work properly if the Database engine's collation
    of the detail query result set is in sync with ReportBuilder's internaly
    field link comparison logic.



    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2005
    Thank you for the tips.
    It was very helpfull and I will consider it from now on.

    Where can I find this Tech Tips? Is seems to me that they are really
    usefull.

    It helped me solving my issue because I didn?t know how to see the generated
    SQL, and I solved my problem easily (It was DB related).

    Thank you again
    Ricardo Acras

  • edited July 2005

    The Tech Tips newsgroup is hosted on this same news server -
    news.digital-metaphors.com.


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.