Do you think this is something that will be added to the next release?
WadeBenz
@WadeBenz
Posts made by WadeBenz
-
RE: Upgrade Issue : Column widths are not correct when using pptxTable vertical=true (^4.5.0)
-
RE: XLSX: Multiple {{#each var}} in a single cell
There is one more issue with this that I did not have in my original sample. Since I was trying to make it as simple as possible. We actually have this also.
Same dataset as before buy you just add a "total" property inside second
{
"data": [
{
"second": {
"total": 36,
"records": [
{
"first": "Boris",
"last": "2",
"value": 1
},
{
"first": "Matos",
"last": "22",
"value": 18
},
{
"first": "Jan",
"last": "12",
"value": 10
},
{
"first": "Blaha",
"last": "34",
"value": 8
}
]
}
},
{
"second": {
"total": 89,
"records": [
{
"first": "Pablo",
"last": "48",
"value": 49
},
{
"first": "Juan",
"last": "92",
"value": 16
},
{
"first": "Martin",
"last": "45",
"value": 17
},
{
"first": "Jhon",
"last": "10",
"value": 7
}
]
}
}
]
}This outputs this
-
RE: XLSX: Multiple {{#each var}} in a single cell
Thanks for the quick reply. I also see that it works in 4.7.0. Currently we are still on 4.3.X. We are trying to upgrade to 4.7 but there are several things that I have posted issues with and I am waiting to hear back on back on. When will the public playground be upgraded to 4.7 it is still running 4.3?
Again thank you, I can mark this off the list.
-
XLSX: Multiple {{#each var}} in a single cell
Is there a way of having 2 #each structures in the same excel file, something like this:
This gives you an error like this
-
Excel columns shifting incorrectly when deleting a column.
We have several excel spread sheets where we need to have a dynamic number of columns. Usually we do this by adding an additional columns and removing the ones that are not needed. We have now run into a scenario where when we delete a column the data in the cells to the right of the column shift unexpectantly to the left. Please note that this is just a simple example that explains the issue.
Example
We have this spread sheet:
We then have something like this on the template to remove the column:
With this standard removeColumn from the forum:function removeColumn(index, opts) { // just to get an idea whats inside console.log(JSON.stringify(opts.data.root.$xlsxTemplate['xl/worksheets/sheet1.xml'])) const rows = opts.data.root.$xlsxTemplate['xl/worksheets/sheet1.xml'].worksheet.sheetData[0].row for (const r of rows) { r.c.splice(index, 1) for (let c of r.c) { console.log (c.$.r); // let excel recalculate cell names delete c.$.r } } }
So in this example we are just trying to remove column B (ordinal 1). When this run we get this as a result.
What I would expact is this.
I am not sure what happens here, Everything gets compressed to the left and not sure what happens to the value of E3.I thought maybe it had to do with the delete c.$.r function call so I change it to delete c.r to see what would happen. I get this for a result them:
It removed the values in column B, but did not delete the column. Also it still completely lost the value of E3.Where can I find more documentation on what the delete c.$.r does or any other help on how to remove columns.
-
Upgrade Issue : Column widths are not correct when using pptxTable vertical=true (^4.5.0)
I have several power point files that use the pptxTable vertical=true to output columns in a table. The widths of the column is set so I can fit 3 on the page. In 4.3.1 the widths of the columns were kept when the pptx file was generated. Since the release of 4.5 the width is not longer correct.
Sample PPTX file looks like this.
In 4.3.1 and 4.4.0 it renders like this:
In 4.5.0 and higher it renders like this
Here is an example in the playground. https://playground.jsreport.net/w/WadeBenz/UOJiYYgE Since the playground is still running 4.3.6 this renders correctly. If you try to run in later version it will not.
I have also tried this with new new dynamic column creation using something like this:
This will output something like this:
Again it does not keep the column width correctly.Is there some new setting that I have to set to keep the column widths correct?
-
pptxTable(^v4.5.0) does not work if there is no other text in cell with it
I have several pptx files that generate content with pptxTable helper. I am trying to upgrade from 4.3.1 to the latest but have found none of the pptx file will work. It looks like there was a change to the pptxTable extension in 4.5.0.
If you have a table like this in 4.3.1:
It will output a table like this:
When you try to run this in 4.5.0 or higher you get a MS power point error:
This is because {{#pptxTable items}} cell does not have any additional text in the cell with it. If you add anything in the cell it will then work, in this case a "~". This also goes for the closing {{/pptxTable}}. There has to be some other text in the cell prior it.This will now work in 4.5.0 or later.
Generates this:
Obviously you do not want to have the "~" in the table. I can add a space after or before. But this means I will have always remember to have the space and I will have to update all my reports that have tables in them.
-
visibilityPermissions permission on folder not preserved if changes are made to grandchildren folders
When you have a top level folder that has children and grandchildren folders. The visibilityPermissions get removed on the top folder when you do something to on of their grandchild folders.
Repo.
- Create this structure
- Assign permisssions
You give app1_user read permission to app1 folder, app2_user read permission to app2 and app3_user to app3. - Verify Applications folder definition
If you look at the definition of Applications you will see something like this were all three users are listed in the visibilityPermissions permissions.
- Add a folder to one of the grand childs
- Verify Applications folder definition
Now you only see 1 of the users in the visibilityPermissions.
Now if you would log into the studio or call the api as app2_user or app3_user you will receive an error.
It seem that when adding the folder or any item the entire folder structure is being recreated. When this happens it only traverses the current path for permission and does not look at sibling path to preserve.
Lastly, Remove the folder you added and verify applications visibilityPermissions. There are none.
- Create this structure
-
RE: Inherited user permissions after importing from cli
This issue has come up on a daily basis now. I have been able to put more time into figuring out what the actually. There are two things going on.
- visibilityPermissions change on my top level folder
- readPermissions, editPermissions and visibilityPermissions are added to each folder/template/asset/ etc from the top level folder down through the path to witch i did the import for the user that the import call was made with.
For item 1 I have this folder structure
Each parent folder has a user account created for it and only has permissions to that folder and its children.
The top level "Applications" folder has this for it definition (config.json) before deployments.
{
"name": "Applications",
"creationDate": {
"$$date": 1715777736383
},
"modificationDate": {
"$$date": 1726115939002
},
"shortid": "Qx9MCxv",
"inheritedReadPermissions": [],
"inheritedEditPermissions": [],
"_id": "XvGvDOEqscuCogy6",
"visibilityPermissions": [
"6LzYz76iKY3GbBKI",
"fTtTHISOtmlBCzeu",
"ZxAV8c66fJ8r9dw6",
"kL3nPyPITvqilhZF"
],
"readPermissions": [
],
"$entitySet": "folders"
}The users map this way.
fTtTHISOtmlBCzeu - user_parentA
ZxAV8c66fJ8r9dw6 - user_parentB
kL3nPyPITvqilhZF - user_parentC
6LzYz76iKY3GbBKI - Is the Admin user that is doing the deploy. This is issue 2 below. Not sure it matters here.Now when I run the import command for any of the deploy folders from curl and authenticate by using basic auth. (Please note, this does not happen if I run the import from the studio, more details on that in Item 2 below) Things change for the top level "Applications" folder. Lets say I run it for ParentA/DeployFolder1. When the import is finished my top level Applications folder has this now for its config.
{
"name": "Applications",
"creationDate": {
"$$date": 1715777736383
},
"modificationDate": {
"$$date": 1726115939002
},
"shortid": "Qx9MCxv",
"inheritedReadPermissions": [],
"inheritedEditPermissions": [],
"_id": "XvGvDOEqscuCogy6",
"visibilityPermissions": [
"6LzYz76iKY3GbBKI",
"fTtTHISOtmlBCzeu",
],
"readPermissions": [
],
"$entitySet": "folders"
}It has removed the visibilityPermssions for the other 2 users of ZxAV8c66fJ8r9dw6 - user_parentB and kL3nPyPITvqilhZF - user_parentC. Now when either of those users log into the studio instead of seeing
They see this
When they click on a report they get a blank page or there is this error when calling the report api. but this seems misleading.I can fix the error issues 1 of 2 ways.
- In the studio, add any permission to any of the deployfolders and save. This Adds all the visibilityPermissions back.
- Open the "Applications" config file in blob storage and add the 2 user ids back to the visibilityPermissions collection. But then I have to restart the server.
This is a huge issue right now. Every time my build/release pipelines run, all applications stop working except for the one being deployed. This happens in every environment and is becoming more and more of an issue for each new application we add. As developers are committing multiple times a day for multiple projects.
For Item 2. When the import is run from the studio, it looks like the user is authenticated by a cookie because a authorization header is not passed. But when called by using a curl command you have to pass Authorization header. When you do this, the user that is being authenticated is getting added to all three of the permission groups listed above( readPermissions, editPermissions and visibilityPermissions). Even though the user is a an admin. It does not seem correct that the admin user should be assigned to these. Why is this happening? It seems like some object in the code is getting setup differently if you are using basic auth or being authorized by a cookie. And then that object is being used to assign or not assign permissions to these groups. I could work around this and not care if the admin user has access to each folder/asset/template individually. But if I was to remove the user as an admin, the account would still have access to all templates. Now it would be an issue