Need help on display a lot of rows

Dear All,

I need to display a stock card for my inventory project. The table will show

  • transactionDate : date of transaction

  • Incoming : the value is quantity if type = 1, otherwise empty (not 0 since it will become unclean).

  • Outgoing : the value is quantity if type = -1, otherwise empty (not 0 since it will become unclean).

  • Stock : Previous row stock + Incoming - Outgoing.

In addition, first row will be initial stock and should be displayed.

At the moment, I used simple html table to display them instead of CGridView, the reasons are

  1. I do not know how to inject the initial stock as first row if using CActiveDataProvider.

  2. I do not know how to get the ‘Stock’ column calculatio if using CAvticeDataProvider, CSqlDataProvider.

  3. If using CGridView and enable paginations, I run into problem in calculating total value of shown rows per column for Incoming and Outgoing.

It works, with single page table and no pagination. stock card can be shown as required. However, I came into trouble when the transactions (rows) are very large of numbers say more than 500 rows. Certain items are fast moving and can be thousands of rows in a month.

Now, I want to develop new solution. Can someone suggest on how to do it?

If using html without pagination I will get problem in displaying if transactions become huge.

If using CGridView and pagination, I also get problem on the need to display balance from previous if not first page and need to inject initial balance for the first row in first page. CGridView with pagination to false is the same as html table.

I understand that I can also set the date filter, Beginning and End dates. But still for some items the rows can be overwhelming. In addition, I also want to check for certain periods.

Please give me some advice

TIA

Daniel