Skip to Content
0

I am not able to extract more than 100 row thorough exporting .csv

May 08 at 09:08 AM

136

avatar image
Former Member

Hi Experts,

I have set the sizeLimit of Odata before exporting the data from entity set.But still I am getting 100 rows data one.

This is the below code:

var model=this.getView().getModel().setSizeLimit(this.oTable.getBinding("items").iLength);

var Omodel=this.getOwnerComponent().getModel();

var oExport = new sap.ui.core.util.Export({ exportType : new sap.ui.core.util.ExportTypeCSV({ separatorChar : ";" }),

models :model,

rows : {path : '/AddressSet'},

columns : [{ name : "Vesrion", template : { content : "{Version}" }}, { name : "ProximusPointId", template : { content : "{ProximusPointId}"}}, { name : "Lang", template : { content : "{Lang}"}}, { name : "Name", template : { content : "{Name}" }}, { name : "CountryKey", template : { content : "{CountryKey}" }}, { name : "Street", template : { content : "{Street}" }}, { name : "HouseNo", template : { content : "{HouseNo}" }}, { name : "PostalCode", template : { content : "{PostalCode}" }}, { name : "City", template : { content : "{City}" }} ] }); oExport.saveFile().catch(function(oError) { MessageBox.error("Error when downloading data. Browser might not be supported!\n\n" + oError); }).then(function() { oExport.destroy(); });

Kindly please help me.

Thanks

Peeyush Ranjan

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member May 08 at 09:31 AM
-1

Hi Peeyush,

Can you try this,

var JsonModel = new sap.ui.model.json.JSONModel();

JsonModel.setSizeLimit(oData.results.length); //Setting size limit

JsonModel.setData(oData);

that.getView().setModel(JsonModel, "newModel");

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Srikar,

I have wrritten the below code.

var JsonModel = new sap.ui.model.json.JSONModel();

JsonModel.setSizeLimit(this.oTable.getBinding("items").iLength); //Setting size limit JsonModel.setData(this.getOwnerComponent().getModel().oData);

this.getView().setModel(JsonModel, "newModel");

var model=this.getView().getModel("newModel");

and the model i have provided in export models:model,

But i am getting now blank screen :(

Thanks

Peeyush

0
Sebastian Kielhorn May 08 at 06:52 PM
0

Dear Peeyush,

as far as I can see you set sizeLimit of the model after the Binding on your list was done.
So your Binding Request was still called with $top=100.

There are multiple solutions to your problem. Pick the one you prefer:

1.) set sizeLimit of your model before the Binding is done e.g. in init method of your Component

2.) Don't set sizeLimit to the number of entities which you got through the Binding

3.) Alter your binding to something like this:

... rows : {path : '/AddressSet', length: 500}, ...

Hope this helps.

Kind regards,

Sebastian

If you want you can check out my Blog where I wrote an article about this subject.

This could contain a link to some awesome kind of Blog

Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Sebastian,

Even after used you r both solution

1){path : '/AddressSet', length: 500}//No luck as still getting only 100 data

2)I have set the sizelimit at component.js like this.getModel().setSizeLimit(999999);

//But still no luck,

Once I hit service with resource entity set AddressSet

http://sapxxx5.web.bc:50100/xxxxx.com~sd.pic.web/Data.svc/AddressSet

Then there Only I am only getting only 100 record.

But when I see data in table where I am displaying data there all my data are showing with scroll bar and growing like "More" (attached the screen shot)

table-data-fro-addressset.png

P.S:I have used Olingo Apache to generate Entiity through JPA and EJB.

Please kindly suggest.

Thanks

Peeyush

0

Hi ..

Can you check the request made to the backend might be its not getting all the records in one go only its getting 100 records only .. Check the networks tab to check the backend call ..

If its the batch than within batch you can check whats the single call .. or just make the batch false in the component to see the independent calls to backend ..

0
Former Member
VIPLOVE KHUSHALANI

Hi ,

I have attached the network trace.

networktarce-fro-batch.png.

One thing I found that when I hit the service(created using Apache Olingo odata uing JPA entity)

http://sapxxx5.web.bc:50100/xxxxx.com~sd.pic.web/Data.svc/AddressSet

it gives allwys 100 records but when i see the count like

http://sapxxx5.web.bc:50100/xxxxx.com~sd.pic.web/Data.svc/AddressSet/$count

it gives the exact number of data.

But when I hit the service which is created in SAP uisng f=gatway and abap OData which gives always all the resouces present under that resources and I also see the count which is more than 100 are same as data.

Please suggest

Thanks

Peeyush Ranjan

0

Hey Peeyush,

if your mentioned request (http://sapxxx5.web.bc:50100/xxxxx.com~sd.pic.web/Data.svc/AddressSet) provides you always with 100 Entities than you have a Backend limitation in use.

Check your implementation in the backend there has to be some configuration that limits the number of the responded entities.

Kind regards,
Sebastian

1
Former Member

Hi Sebastian,

I have debugged for GetentitySet and found that all result is gettign returned but as mentioned by VIPLOVE KHUSHALANI.

It is coming in batch wise ,But i am not to able to find the proceed for the solution:(

Attached the debugged Pic.backend-data-debug.png.

Please kindly help me .

Thanks a lot for you suggestion and useful solution.

Regards

Peeyus Ranjan

0