funny looking table
stefque
Serbia
I apologise for my English in advance...
I have a table, which I don't know how to show on a report. Columns are ID, cash1, date1, cash2, date2, cash3, date3, cash4, date4, and so on till cash8. date8. It shows if someone can pay the whole amount from one time, or he can divide it in 8 parts, so cash1 and date1 always have data in them, but others can be empty.
For example, if a row in the table looks like this: 1, 200$, 21.11.2010, 300$, 23.12.2010, 500$, 15.01.2011, 0, 0, 0, 0....0, 0 I want to print in the report:
- 200$ until 21.11.2010 on account number xxxx
- 300$ until 23.12.2010 on account number xxxx
- 500$ until 15.01.2011 on account number xxxx
But, unfortunately I don't know how to make this work in FR and Delphi. I tried something, but it shows me that a column doesn't exist.
i:=1;
s:='cash'+IntToStr(i);
v:='';
begin
while ((i<9) or ((fizvestaj.frxReport1.FindComponent('MyDACQuery3') as TfrxMyDACQuery).Fields.FieldByName(s).Value<>0))
do
begin
v:=v+IntToStr((fizvestaj.frxReport1.FindComponent('MyDACQuery3') as TfrxMyDACQuery).Fields.FieldByName(s).Value)+'until'+....#13#10;
i:=i+1;
end;
end;
(fizvestaj.frxReport1.FindComponent('Memo65') as TfrxMemoView).memo.Strings[0]:='v';
I know it's not complete but the code breaks and shows that it can't find cash1. I thought that I could make a temp table that has columns cash and date and every row would represent a part of the payment. I don't know how to do that either so any help or any other idea would be helpful....
I have a table, which I don't know how to show on a report. Columns are ID, cash1, date1, cash2, date2, cash3, date3, cash4, date4, and so on till cash8. date8. It shows if someone can pay the whole amount from one time, or he can divide it in 8 parts, so cash1 and date1 always have data in them, but others can be empty.
For example, if a row in the table looks like this: 1, 200$, 21.11.2010, 300$, 23.12.2010, 500$, 15.01.2011, 0, 0, 0, 0....0, 0 I want to print in the report:
- 200$ until 21.11.2010 on account number xxxx
- 300$ until 23.12.2010 on account number xxxx
- 500$ until 15.01.2011 on account number xxxx
But, unfortunately I don't know how to make this work in FR and Delphi. I tried something, but it shows me that a column doesn't exist.
i:=1;
s:='cash'+IntToStr(i);
v:='';
begin
while ((i<9) or ((fizvestaj.frxReport1.FindComponent('MyDACQuery3') as TfrxMyDACQuery).Fields.FieldByName(s).Value<>0))
do
begin
v:=v+IntToStr((fizvestaj.frxReport1.FindComponent('MyDACQuery3') as TfrxMyDACQuery).Fields.FieldByName(s).Value)+'until'+....#13#10;
i:=i+1;
end;
end;
(fizvestaj.frxReport1.FindComponent('Memo65') as TfrxMemoView).memo.Strings[0]:='v';
I know it's not complete but the code breaks and shows that it can't find cash1. I thought that I could make a temp table that has columns cash and date and every row would represent a part of the payment. I don't know how to do that either so any help or any other idea would be helpful....
Comments
you will need to fix it before anything else.
columns should probably be
accountnum date paymentamount
you could then use a query with an orderby clause to supply data to fr and use a grouped report or
you could use a crosstab
Thank's any way....
userdataset along with variables and the ongetvalue event.
how you create your temp table is up to you and the tools you have available to you in delphi,