dfaruque / Serenity.Extra

Name of the repo says that this is an EXTRA of http://serenity.is platform
60 stars 34 forks source link

Grouping in PDF export #20

Closed vinnaykulkarni closed 5 years ago

vinnaykulkarni commented 5 years ago

I m using viewwithoutID when I'm using default serenity PDF export code the data gets exported but I cannot get the grouping summary when I tried to use PDF export code from _Ext module I get an error as below.

Uncaught Each data element must implement a unique '__id' property. Object at index '0' has no identity value:

Issue raises in q.services.ts at options.onCleanup && options.onCleanup();

dfaruque commented 5 years ago

ok. tomorrow I will check that

dfaruque commented 5 years ago

try adding a field '__id' in view as rownumber. also in row.cs and column.cs

vinnaykulkarni commented 5 years ago

You mean to say I will need to add rownumber field instead of __id?

dfaruque commented 5 years ago

No, you need to add a field named '__id'. which should be a unique number. such as ROW_NUMBER() in sql

vinnaykulkarni commented 5 years ago

Implemented Getting following error,

Uncaught InvalidOperationException$ {_message: "Possible infinite loop, check parents has no circular reference!", _innerException: null, _error: Error at InvalidOperationException$.Exception$ (http://localhost:52296/Scripts/saltarelle/mscorl…}_error: Error at InvalidOperationException$.Exception$ (http://localhost:52296/Scripts/saltarelle/mscorlib.js?v=AO_L_1E_BHK8K8k5pu8Fmg2:3218:16) at new InvalidOperationException$ (http://localhost:52296/Scripts/saltarelle/mscorlib.js?v=AO_L_1E_BHK8K8k5pu8Fmg2:3413:15) at filterCustom (http://localhost:52296/Scripts/serenity/Serenity.CoreLib.js?v=FJWNLJefYTleVWBt2lDr9g2:3694:27) at Object.filterById (http://localhost:52296/Scripts/serenity/Serenity.CoreLib.js?v=FJWNLJefYTleVWBt2lDr9g2:3701:20) at EnquiryQuotationGrid.TreeGridMixin.dg.onViewFilter (http://localhost:52296/Scripts/serenity/Serenity.CoreLib.js?v=FJWNLJefYTleVWBt2lDr9g2:14788:49) at http://localhost:52296/Scripts/serenity/Serenity.CoreLib.js?v=FJWNLJefYTleVWBt2lDr9g2:11537:29 at uncompiledFilter (http://localhost:52296/Scripts/serenity/Serenity.CoreLib.js?v=FJWNLJefYTleVWBt2lDr9g2:15659:25) at getFilteredAndPagedItems (http://localhost:52296/Scripts/serenity/Serenity.CoreLib.js?v=FJWNLJefYTleVWBt2lDr9g2:15690:41) at recalc (http://localhost:52296/Scripts/serenity/Serenity.CoreLib.js?v=FJWNLJefYTleVWBt2lDr9g2:15740:37) at refresh (http://localhost:52296/Scripts/serenity/Serenity.CoreLib.js?v=FJWNLJefYTleVWBt2lDr9g2:15762:28)_innerException: null_message: "Possible infinite loop, check parents has no circular reference!"proto: Exception$ filterCustom @ SlickHelpers.ts:596 filterById @ SlickHelpers.ts:605 TreeGridMixin.dg.onViewFilter @ TreeGridMixin.ts:31 (anonymous) @ DataGrid.ts:534 uncompiledFilter @ Serenity.Externals.Slick.ts:1303 getFilteredAndPagedItems @ Serenity.Externals.Slick.ts:1337 recalc @ Serenity.Externals.Slick.ts:1397 refresh @ Serenity.Externals.Slick.ts:1427 setItems @ Serenity.Externals.Slick.ts:701 DataGrid.setItems @ DataGrid.ts:426 onSuccess @ PdfExportHelper.ts:190 success @ Q.Services.ts:64 fire @ jquery-3.3.1.js?v=agfan66TS68_dJ6Ha7_dlg2:3268 fireWith @ jquery-3.3.1.js?v=agfan66TS68_dJ6Ha7_dlg2:3398 done @ jquery-3.3.1.js?v=agfan66TS68_dJ6Ha7_dlg2:9305 (anonymous) @ jquery-3.3.1.js?v=agfan66TS68_dJ6Ha7_dlg2:9548 load (async) send @ jquery-3.3.1.js?v=agfan66TS68_dJ6Ha7_dlg2:9567 ajax @ jquery-3.3.1.js?v=agfan66TS68_dJ6Ha7_dlg2:9206 serviceCall @ Q.Services.ts:122 exportToPdf @ PdfExportHelper.ts:112 onClick @ PdfExportHelper.ts:290 (anonymous) @ Toolbar.ts:133 dispatch @ jquery-3.3.1.js?v=agfan66TS68_dJ6Ha7_dlg2:5183 $event.dispatch @ jquery.event.drag.js?v=Q42_cWjms19Czv7rSFThUg2:380 elemData.handle @ jquery-3.3.1.js?v=agfan66TS68_dJ6Ha7_dlg2:4991

dfaruque commented 5 years ago

you should not use TreeGridMixin with such fake id. in that case select yourPrimaryKey as __Id from............... in you sql view

dfaruque commented 5 years ago

BTW, tree is not supported in pdf export may be.

vinnaykulkarni commented 5 years ago

Yes above results are when used the __id as primary feild, identity feild

dfaruque commented 5 years ago

are you using TreeGridMixin? try remove that

vinnaykulkarni commented 5 years ago

Ya but this module needs the TreeGridMixin so was trying PDF with gourping data

dfaruque commented 5 years ago

I think PDF export will not help you in that case.

vinnaykulkarni commented 5 years ago

Is there any luck with excel export?

dfaruque commented 5 years ago

Excel export might help, but the data will be flat instead of tree

vinnaykulkarni commented 5 years ago

Ya thank you for your guidance and help, also can you share your skype ID, we have some upcoming project and I prefer them to build with Serenity, If you are interested we can commercially work on them

dfaruque commented 5 years ago

You can mail me then