Table moving to first record.
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.
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.
This discussion has been closed.
Comments
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
printed the current record in the dataset.
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com