Comments (4)
Using pagination mechanism for entire table rows extraction may produce unexpected results in some cases.
You should either use "batch" approach or setup an explicit sort order for the data via Query::orderBy()
.
from csv-grid.
No, I made some other tests with simplified code, found duplicated records also with pagination set as 100:
public function actionExportStockCsv()
{
$exporter = new CsvGrid([
'dataProvider' => new ActiveDataProvider([
'query' => Stock::find(),
'pagination' => [
'pageSize' => '100', // export batch size
],
]),
'columns' => [
'PART_NUMBER',
'num_serie',
'DESCRIPTION',
'QTY',
],
]);
$filename = 'Stock';
$date = new \DateTime();
$date = Yii::$app->formatter->asDatetime($date,'yyyy-MM-dd_HH-mm-ss');
return $exporter->export()->send($filename.'_'.$date.'.csv');
}
Could the problem be derived from the fact I don't have a primary key in the table (it is a view)?
from csv-grid.
@klimov-paul Thank you for your support!
from csv-grid.
i am using batch size 5 it's still give me all records
from csv-grid.
Related Issues (20)
- CSV is deleted before downloaded HOT 2
- Memory Exhausted on only 6000 rows HOT 2
- Export CSV as a Row wise header data instead of column wise. HOT 1
- String column specification produces format 'text' instead of 'raw' HOT 2
- Error when send a result file to the browser through download
- Time to export 3200 records HOT 2
- problem with japanese language HOT 1
- Question: feedback to user HOT 1
- long number result for export csv and read by MS Excel HOT 2
- Issue with multiple sheet in single csv HOT 1
- add option to output attribute names instead of labels HOT 1
- windows下显示中文乱码 HOT 1
- CSV Grid causes error upon export()->saveAs() HOT 1
- array 2 csv HOT 2
- Yii2 csvgrid not supporting special character such as ">" ,"<" ,": " HOT 4
- Directory not empty HOT 1
- Duplicate data getting with pagination HOT 1
- Not compatible with GridView HOT 2
- Crashes when query returns no results and csv headers are enabled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csv-grid.