Start New Discussion within our Software Development Community

I`ve just begun to learn delphi and sql server.
I want to make small application using delphi and sql server, but i can`t make the report like this:
Note Plus Minus Balance
-------------------------------------------------------------------------
sell 5.000 0 5.000
buy 0 1.000 4.000
sell 3.000 0 7.000
sell 2.500 0 9.500

I use 1 table[SQL SERVER] : Note = varchar (10)
Plus = money
Minus = money.

How to generate code in delphi using quick report to have balance like the example above?
I`ve tried but it can`t accumulate like above the 1st row 5.000, 2nd -1.000, 3rd 3.000, 4rd 2.500.
Thanks.

Please provide more details of what you are trying to achieve.

In fact QuickReports is quite powerful in creating totals etc. from information included into the report as follows by including in the "OnPrint" EventHandler of the Object Inspector for a field called [say] CB.QRDBAmount you could have the following

procedure TQuickReportCB.QRDBAmountPrint(sender: TObject;
  var Value: String);
begin
if  [whatever condition] then
  TQuickReportCB.QRDBAmount := TQuickReportCB.QRDBAmount +   TQuickReportCB.QRDBPlus
else
  TQuickReportCB.QRDBAmount := TQuickReportCB.QRDBAmount +   TQuickReportCB.QRDBMinus
end;

Bear in mind also that in the "PageFooter" band of your QuickReport you can provide for the total for CB.QRDBAmount to be accumulated.

delphiman

This article has been dead for over six months. Start a new discussion instead.