Basic problems with groups and "squeezed" fields
?I have various reports that I am generating that I'd like to use squeezed
name and address fields for. I do a grouping and create label and memo
fields that I then generate on the fly. The issue is that when I generate
the report the same address or name value shows up in each repeated band.
I need to be able to calculate and display the values on a per-record
basis. Everything else (read: DB-linked fields) works fine.
Thoughts?
- Matt
MattC
--- posted by geoForum on http://delphi.newswhat.com
name and address fields for. I do a grouping and create label and memo
fields that I then generate on the fly. The issue is that when I generate
the report the same address or name value shows up in each repeated band.
I need to be able to calculate and display the values on a per-record
basis. Everything else (read: DB-linked fields) works fine.
Thoughts?
- Matt
MattC
--- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.
Comments
How are you accessing the data to be displayed inside the label or memo? If
your report is properly connected to a datapipeline, you should assign the
value of the label and memo objects inside the Band.BeforePrint event is a
similar fashion...
Label.Caption := Report.DataPipeline['FirstName'] + ' ' +
Report.DataPipeline['LastName'];
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
{ Create the "Primary Name" }
stPrimaryName := ppMasterPipeline['FIRST_NAME'];
stLine := ppMasterPipeline['MIDDLE_NAME'];
if (Length(stLine) > 0) then begin
stPrimaryName := stPrimaryName + ' ' + stLine;
end;
stLine := ppMasterPipeline['LAST_NAME'];
if (Length(stLine) > 0) then begin
stPrimaryName := stPrimaryName + ' ' + stLine;
end;
laPrimaryName.Caption := stPrimaryName;
This results in the same name appearing over and over in the repeated group.
MattC
--- posted by geoForum on http://delphi.newswhat.com
Report". It's correctly connected to a pipeline called ppBrokeragePipeline
and it is grouped on a field called "BROKERAGE_ACCOUNT_SEQNO". There is a
label called "laBrokerageAdvisor" that is supposed to be a concatenation
of two fields in the query hooked up to the pipeline called
"ADVISOR_FIRST_NAME" and "ADVISOR_LAST_NAME". There is also a memo field
called mBrokerageAdvisorAddress that is a squeezed address of various
ADVISOR_* fields. Here is the code:
procedure TdmReports.ppBrokerageAccountsBeforePrint(Sender: TObject);
var
stLine : String;
stAdvisorName : String;
stCity : String;
stState : String;
stZip : String;
begin
{ Create the advisor name }
stAdvisorName := ppBrokeragePipeline['ADVISOR_FIRST_NAME'] + ' ' +
ppBrokeragePipeline['ADVISOR_LAST_NAME'];
laBrokerageAdvisor.Caption := stAdvisorName;
{ Create the Address }
stLine := ppBrokeragePipeline['ADVISOR_ADDRESS_1'];
if (Length(stLine) > 0) then begin
mBrokerageAdvisorAddress.Lines.Add(stLine);
end;
stLine := ppBrokeragePipeline['ADVISOR_ADDRESS_2'];
if (Length(stLine) > 0) then begin
mBrokerageAdvisorAddress.Lines.Add(stLine);
end;
stCity := ppBrokeragePipeline['ADVISOR_CITY'];
stState := ppBrokeragePipeline['ADVISOR_STATE'];
stZip := ppBrokeragePipeline['ADVISOR_ZIP'];
if (Length(stCity) > 0) then begin
stLine := stCity + ', ';
end;
if (Length(stState) > 0) then begin
stLine := stLine + stState + ' ';
end;
if (Length(stZip) > 0) then begin
stLine := stLine + stZip;
end;
if (Length(stLine) > 0) then begin
mBrokerageAdvisorAddress.Lines.Add(stLine);
end;
end;
When this report displays the two records in the table, the data-backed
fields all display their corresponding values correctly but the fields
that are generated here display the first records' data on both pages.
MattC
--- posted by geoForum on http://delphi.newswhat.com
BeforePrint method for the entire report. I should be doing it for the
detail band only. When I did that, it worked fine.
MattC
--- posted by geoForum on http://delphi.newswhat.com