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

Table moving to first record.

edited November 2004 in General
I have the following code on a button click.


If DBLookupComboBox3.Text = 'Write Letter' then doctoprint := aliaspath
+'reports\correspondance_Normal_address.rtm';
If DBLookupComboBox3.Text = 'Appeal Reply' then doctoprint := aliaspath
+'reports\Appeal_Po_Address_notel.rtm';

Datamodule4.ppReport_Correspondance.Template.FileName := doctoprint;
Datamodule4.ppReport_Correspondance.Template.LoadFromFile;
Datamodule4.ppReport_Correspondance.Print;

This checks for which report to print from a list in a DBGrid. The problem
is the dataset jumps to the first record in the grid and prints the data
from the first record set.
The datasource for the report is controlled by the master/detail
relationship from the following:
ppDBPipeline_Correspondance has

Detail table 'Correspondance' rbCurrentRecord, reCurrentRecord
Master table 'Customer'
Master field link CustNum---CustNum
Any ideas?

Cheers

SteveW.

Comments

  • edited November 2004
    Hi Steve,

    ReportBuilder will always start from the first record in your dataset when
    you try to print. The only way to control this is to change the SQL or use
    the AutoSearch feature. See the demos located in the \RBuilder\4.
    AutoSearch\... directory for information on how to use AutoSearch.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2004
    What does the rbCurrentRecord, reCurrentRecord do. I thought they only
    printed the current record in the dataset.


  • edited November 2004
    Hi Steve,

    I'm sorry, I missed the bottom part of your first post. Yes, if you have
    the RangeBegin and RangeEnd properties set to the same setting (i.e.
    CurrentRecord), only one record should be traversed. I'm a bit unclear
    about how you are setting the current record. Check your dataset to be sure
    that the current record is in fact the one you desire at the time of
    printing the report. Also, remember you need to be sure your templates are
    accessign the correct datapipeline, it is possible they will loose their
    references if you are dynamically loading them.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.