Do you think this is something that will be added to the next release?
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
-
Handlebar "References" not working in xlsx with #each
I am trying to use handlebar syntax in an xlsx file. I have a nested object and would like to use
{{#each collection1 as |_myItem|}} so later I can refer to _myItem. When I enter this into xlsx i get the error
This is very easy to replicate the error if you use your invoice xlsx project in the playground. All you have to do is change this cell
to use the reference. -
Excel handlebars calling shared function in asset script file
JSReport Forum,
I have a excel workbook that is uploaded to jsreport hosted env. That workbook uses handlebar notation to populated rows of data. One of the cells calls a shared function that is located in a shared asset file.
Issue: If the shared asset scope is set to folder the function is not called in the workbook. It only calls the function if the assets scope is global.
Playground link: https://playground.jsreport.net/w/WadeBenz/q2rvuKWn
Other Notes: If I export this and then import onto a local instance of jsreport that does not have authentication running. It will work if the asset is not in a subfolder (directly in the data folder). When looking at the log files this is the error that is entered. At the time of running the report I was logged in as an Admin.
{"_id":"sisL7wX5780zeXRB","timestamp":{"$$date":1725454559501},"state":"error","mode":"standard","creationDate":{"$$date":1725454559510},"modificationDate":{"$$date":1725454561313},"shortid":"wh6DlsE","inheritedReadPermissions":[],"inheritedEditPermissions":[],"$entitySet":"profiles","timeout":180000,"templateShortid":"o9IHrco_s","finishedOn":{"$$date":1725454561245},"error":"Error: Error while executing xlsx recipe\n(because) error when evaluating engine handlebars for template anonymous\n(because) "xlsxSData" helper call failed\n(because) "xlsxSData" helper call failed\n(because) "xlsxSData" helper call failed\n(because) missing helper: "getDateText"\n\n(system-helpers.js line 2006:33)\n\n 2004 | newData.currentCellRef = null\n 2005 |\n> 2006 | const result = optionsToUse.fn(this, { data: newData })\n | ^\n 2007 |\n 2008 | return result\n 2009 | }\n\n(system-helpers.js line 1571:25)\n\n 1569 | newData.outOfLoopTemplates = Object.create(null)\n 1570 |\n> 1571 | return optionsToUse.fn(this, { data: newData })\n | ^\n 1572 | }\n 1573 |\n 1574 | const getLoopItemById = (byTarget, loopItems) => {\n\n","blobName":"path*****/file_ExcelFile/fh79ixtwgaxcdqv.log"}
I need to have folder scope on the asset, since there are several applications that publish reports to this server.
-
RE: Inherited user permissions after importing from cli
I know what fixed the issue, but I cannot reproduce it to. When coming from the development repo we had this in the config.json file for one of of the reports that was going to be imported.
"tenantId": "avisonyoung",
"readPermissions": [
"655647240e547f0c8ce4ad55"
],
"editPermissions": [
"655647240e547f0c8ce4ad55"
],
"inheritedReadPermissions": [
"655647240e547f0c8ce4ad55"
],
"inheritedEditPermissions": [
"655647240e547f0c8ce4ad55"
],
"editPermissionsGroup": [
"65969a2c1b470b8f062b6eaa"
],The tenantId and user/groupId did not exist on the instance that was being deployed to. As soon as this was removed, the issue not keeping the inherited permissions when away.
Sorry I cannot give more details.
-
RE: Inherited user permissions after importing from cli
I was able to put more time into this. I believe I did find the issue. There was one report that had a read permissions group id coming from the development environment. That group id did not exist on the prod environment. Was this group was removed off of the report it no longer failed when the deployment ran.
-
RE: Inherited user permissions after importing from cli
After monitoring this for some time, the issue is still present. I have been able to track down more information. I can repo this at will when my pipelines run but have not been able to repo it when it run each step manually. I am not sure if there is a timing issue of some process running when calling the APIs.
-
This is what the folders look like when the process starts.
Parent Folder Definition
{
"folder": null,
"name": "P……….S",
"creationDate": "2024-05-31T16:09:25.262Z",
"modificationDate": "2024-06-03T17:40:02.397Z",
"shortid": "R8-Qj3S",
"inheritedReadPermissions": [
"BOuTIw0qUIo6RDI3",
"kL3nPyPITvqilhZF",
"jsRcTiQwKehsi1UJ",
"ybl2OzOqfL7mDykq",
"IqTLGBw8uiwR6L6C"
],
"inheritedEditPermissions": [],
"_id": "MYNBxmfiDJhMoGqi",
"visibilityPermissions": [
"BOuTIw0qUIo6RDI3",
"kL3nPyPITvqilhZF",
"jsRcTiQwKehsi1UJ",
"ybl2OzOqfL7mDykq",
"IqTLGBw8uiwR6L6C",
"6LzYz76iKY3GbBKI",
"655647240e547f0c8ce4ad55"
],
"readPermissionsGroup": [
"BOuTIw0qUIo6RDI3",
"IqTLGBw8uiwR6L6C"
]
}
de.json definition:
{
"folder": {
"shortid": "bw1qJQu"
},
"content": "ogIH0KfQ==",
"name": "de.json",
"creationDate": "2024-06-03T17:35:29.079Z",
"modificationDate": "2024-06-03T17:40:33.969Z",
"shortid": "_14zYG8",
"readPermissions": [
"6LzYz76iKY3GbBKI"
],
"editPermissions": [
"6LzYz76iKY3GbBKI"
],
"inheritedReadPermissions": [
"655647240e547f0c8ce4ad55",
"BOuTIw0qUIo6RDI3",
"kL3nPyPITvqilhZF",
"jsRcTiQwKehsi1UJ",
"ybl2OzOqfL7mDykq",
"IqTLGBw8uiwR6L6C"
],
"inheritedEditPermissions": [
"655647240e547f0c8ce4ad55"
],
"_id": "cKAUECqiRbDChiDM"
} -
After import of file, but before the removing and adding of language assets. Since the parent folder for de.json is temporary gone while it is importing the compressed file. The assets that were assigned to folder “localization” (“bw1qJQU”) are at the root because the parent is gone until the import finishes.
This is the definition of the language file. But to get it I have to be logged in as an admin. I think this happens because the limited user, although they have access to the asset they do not have access to the “now root folder” because the “localization” folder is being imported.
cmd that is run: curl --location 'https://serverurl/api/import?targetFolder=CcnQjoV' --header 'Authorization: Basic **==' --form 'files=@"/home/vsts/work/r1/a///export.jsrexport"'
{
"folder": {
"shortid": "bw1qJQu"
},
"content": "fQ==",
"name": "de.json",
"creationDate": "2024-06-03T17:35:29.079Z",
"modificationDate": "2024-06-03T17:40:33.969Z",
"shortid": "_14zYG8",
"readPermissions": [
"6LzYz76iKY3GbBKI"
],
"editPermissions": [
"6LzYz76iKY3GbBKI"
],
"inheritedReadPermissions": [
"655647240e547f0c8ce4ad55",
"BOuTIw0qUIo6RDI3",
"kL3nPyPITvqilhZF",
"jsRcTiQwKehsi1UJ",
"ybl2OzOqfL7mDykq",
"IqTLGBw8uiwR6L6C"
],
"inheritedEditPermissions": [
"655647240e547f0c8ce4ad55"
],
"_id": "cKAUECqiRbDChiDM"
} -
After delete and adding of assets.
CMD to delete Assets: https://serverurl/odata/assets(cKAUECqiRbDChiDM)
CMD to Import Asset:
This is the response I get from the odata/assets call to add the language asset file. I would have thought that the permission would be correct. When I run this manually the permission have the correct arrary.
{
2024-06-03T18:41:06.0771117Z '@odata.context': 'https://wa**********.azurewebsites.net/odata/$metadata#assets/$entity',
2024-06-03T18:41:06.0771685Z '@odata.editLink': "https://wa********.azurewebsites.net/odata/assets('DvveNNhEolza6vuB')",
2024-06-03T18:41:06.0772027Z '@odata.id': "https://wa************.azurewebsites.net/odata/assets('DvveNNhEolza6vuB')",
2024-06-03T18:41:06.0772304Z folder: { shortid: 'bw1qJQu' },
2024-06-03T18:41:06.0778404Z content: "H0KfQ==',
2024-06-03T18:41:06.0782143Z name: 'de.json',
2024-06-03T18:41:06.0782376Z creationDate: '2024-06-03T18:41:03.756Z',
2024-06-03T18:41:06.0782634Z modificationDate: '2024-06-03T18:41:03.756Z',
2024-06-03T18:41:06.0782845Z shortid: 'XNXjza4',
2024-06-03T18:41:06.0783042Z readPermissions: [ '6LzYz76iKY3GbBKI' ],
2024-06-03T18:41:06.0783253Z editPermissions: [ '6LzYz76iKY3GbBKI' ],
2024-06-03T18:41:06.0783518Z inheritedReadPermissions: [ '655647240e547f0c8ce4ad55' ],
2024-06-03T18:41:06.0783771Z inheritedEditPermissions: [ '655647240e547f0c8ce4ad55' ],
2024-06-03T18:41:06.0783987Z _id: 'DvveNNhEolza6vuB'
2024-06-03T18:41:06.0784089Z
}
Limited user.
Admin User
Permissions using Admin:
{
"folder": {
"shortid": "bw1qJQu"
},
"content": "gIH0KfQ==",
"name": "de.json",
"creationDate": "2024-06-03T17:54:00.296Z",
"modificationDate": "2024-06-03T17:54:00.296Z",
"shortid": "jN2XNTu",
"readPermissions": [
"6LzYz76iKY3GbBKI"
],
"editPermissions": [
"6LzYz76iKY3GbBKI"
],
"inheritedReadPermissions": [
"655647240e547f0c8ce4ad55"
],
"inheritedEditPermissions": [
"655647240e547f0c8ce4ad55"
],
"_id": "Zgj2zpf3hvATfcLa"
}
- Add a different group so I can save and permission are back to correct for the limited user
-
-
RE: Inherited user permissions after importing from cli
I upgraded to 4.3.1 today, I was not able to do it last week. It seems like it is working correctly now. Thank you for the work on trying to track this down. I will monitor it and reply back if there is any change.
-
RE: Inherited user permissions after importing from cli
What you have does work. There is a difference between what you have and my scenario. I do not have a userA. Since this would be a development machine without user permissions turned on. The other part is when I do my import I do not have folderB->folderA->templateA. I would have folderB ->templateA.
Dev machine:
- TemplateA
Deployed Machine :
- ParentFolder ->FolderB
- User has permissions on FolderB.
After Deploy:
- ParentFolder->FolderB -> TemplateA
I have moved the permission up to ParentFolder and that seems to have kept them after deploy.
-
Inherited user permissions after importing from cli
In my deployed environment I have a folder structure like Parent1\Child1. I then have a user or a group (does not matter) that is assigned read permission to Parent1. When I save the permission it then propagates the read permission to child1 and also all the templates in child1. This all seems correct.
On my local machine, which I do not have the same folder structure or users setup. I actually have my reports in a git repo. So I pull down the reports and make a change. I commit the changes to the repo, and that kicks of a build that exports the reports in the data folder to a ******.export file. Now there is a release pipeline job that calls the import api and imports (full) the the reports into folder child1. All of this process work fine.
The issue is that user or group that has read permission to folder Parent1 no longer has access to the templates in Child1. When I look at the templates definitions the permissions arrays are empty. I believe this is because these permission are not setup on my local machine, nor will they ever be.
Is there a API call that I can make after the import that will reapply permission to all of the templates in a folder?
This is the reports json definition when the permission are applied.
{ "_id": "658ee96ded3f8e290fe16f35", "name": "XXXXXX_PDF", "engine": "handlebars", "recipe": "chrome-pdf", "data": { "shortid": "U8RewqKQC" }, "shortid": "HXspsxMZzL", "chrome": { "printBackground": true, "marginTop": "0.5in", "marginBottom": "1in", "marginRight": "0.5in", "marginLeft": "0.5in", "landscape": true }, "scripts": [ { "shortid": "eVA2uyLwt" } ], "pdfOperations": [ { "type": "merge", "templateShortid": "401aVyc", "mergeWholeDocument": true } ], "creationDate": "2024-03-08T21:11:00.330Z", "modificationDate": "2024-05-14T19:21:40.527Z", "readPermissions": [ "655647240e547f0c8ce4ad55" ], "editPermissions": [ "655647240e547f0c8ce4ad55" ], "inheritedReadPermissions": [ "655647240e547f0c8ce4ad55", "djYU1HQqwKkVH0pt", "1hu3mVzzCOihZD5k", "Xug2ImE3flfCQORu", "jiYXyoH85oEE66oo", "0OPGx5fyhIAqbYjk" ], "inheritedEditPermissions": [ "655647240e547f0c8ce4ad55", "1hu3mVzzCOihZD5k" ], "editPermissionsGroup": [ "65969a2c1b470b8f062b6eaa" ], "folder": { "shortid": "IZvhxOL" } }
This is the report definition after the import.
{ "_id": "658ee96ded3f8e290fe16f35", "name": "Critical_Date_PDF", "engine": "handlebars", "recipe": "chrome-pdf", "data": { "shortid": "U8RewqKQC" }, "shortid": "HXspsxMZzL", "chrome": { "printBackground": true, "marginTop": "0.5in", "marginBottom": "1in", "marginRight": "0.5in", "marginLeft": "0.5in", "landscape": true }, "scripts": [ { "shortid": "eVA2uyLwt" } ], "pdfOperations": [ { "type": "merge", "templateShortid": "401aVyc", "mergeWholeDocument": true } ], "creationDate": "2024-03-08T21:11:00.330Z", "modificationDate": "2024-05-15T11:53:28.885Z", "readPermissions": [ "655647240e547f0c8ce4ad55" ], "editPermissions": [ "655647240e547f0c8ce4ad55" ], "inheritedReadPermissions": [ "655647240e547f0c8ce4ad55" ], "inheritedEditPermissions": [ "655647240e547f0c8ce4ad55" ], "editPermissionsGroup": [ "65969a2c1b470b8f062b6eaa" ], "folder": { "shortid": "IZvhxOL" }
The Ids 655647240e547f0c8ce4ad55 and 65969a2c1b470b8f062b6eaa show up on my local machine. I am assuming those are the users my local dev environment is using and created when I added the report. As you can see the inheritedReadPermissions and inheritedEditPermissions are no longer present.
Thanks
-
RE: Report API - async option not returning appPath url.
This does not seem to be the way it is working for me. This looks like it works for you because your example you are not changing the domain. Event though I am setting the headers at both the gateway or on the post it does not seem like the code is using them for generating the location.
Setup.
- docker running on web app. url: https://myserver.azurewebsites.net
- Application gateway. This does a rewrite rule to forward this request from xxx.domain.com/reportserver/jsr to docker app (line 1). I did add a X-Forwarded-For hearder on gateway for domain(did not help) screenshot below.
- appPath to be /reportserver/jsr. This fixes the pathing in the browser and directs request to the correct url because of application gateway.
Screen shot from jseport showing correct url for the api to post requests to.
This is a screen shot from postman posting to the url. As you can see the location has the azure web app url along with the appPath.
app gateway rewrite rule for X-Forwarded-For
Additional attempt to apps the X-Forwarded-For and X-Forwarded-Host headers in the postman request.
Is there a way to see if the headers are making it to jsreport? Also is there a way to turn on a verbose logging to see what the app log is doing?
-
Report API - async option not returning appPath url.
I am trying to use the "options": {"reports": { "async": true }}. This does run and I get back an URL. The issue I am having is the URL does not adhere to the string that I have setup in my appPath configuration.
example:
I post an API request xxx.domain.com/reportserver\api\report with the body of {"reports": { "async": true }}.
The URL I get back is https://xxx.azurewebsites.net/reportserver/reports/SOMEid/status'. This is the url to the web app service the docker container is hosted on.
I thought I should get back a URL of xxx.domain.com/reportserver/reports/SOMEid/status.
Should I be getting back the report appPath in the return URL?
Thanks
Wade