Thanks Jan It is working for me 😁
Posts made by Kzhd
-
RE: Do JsReport Support saving of Generated Reports using Managed Identites in Azure Storage?
-
RE: Do JsReport Support saving of Generated Reports using Managed Identites in Azure Storage?
Thank You so much Jan 🥺 for implementing this for me in such a short span of time . Will try and let you know it is working.😊😊
-
RE: Do JsReport Support saving of Generated Reports using Managed Identites in Azure Storage?
Sure Thanks waiting on you :)
-
RE: Templates are not reflecting while created using shell script in Ubuntu
Thanks Jan for your comments I think the issue was with this cat command which ignores the character '$' while creating files. So I used '\' as a escape character for saving it and it worked perfectly.
cat <<EOF >/var/jsreport/data/testTemplate/config.json
{
"shortid": "Skg6lyHasL",
"name": "testTemplate",
"recipe": "text",
"engine": "jsrender",
"chrome": {
"printBackground": true
},
"creationDate": "2020-05-28T13:39:17.492Z",
"modificationDate": {
"\$\$date": 1590673209303
},
"_id": "0Kog3miLXUG9Qwsx",
"\$entitySet": "templates"
}
EOF -
Do JsReport Support saving of Generated Reports using Managed Identites in Azure Storage?
Hi Jan,
I am currently using jsreport-azure-storage npm package to save the Generated Reports in Azure Blob Storage and which uses the below configuration.{ "blobStorage": { "name": "azure-storage", "accountName": "...", "accountKey": "...", "container": "..." } }
My Requirement is that I don't want to share the AccountKey and Account Name of Storage with anyone and hence we are using Managed Identities now for the Storage. and the generated Report must be saved using Managed Identities not using above configuration.
Please help me if you have something there to save the generated reports using Managed Identities.
Thanks,
Zahid Khan -
Templates are not reflecting while created using shell script in Ubuntu
Hi Jan,
I have created a shell script that will deploy my Jsreport on Ubuntu machine in Azure.When I run the script everything went well and Jsreport Daemon service is also get created and it is running and all my Jsreport stuff is in jsreport folder and some templates are also configured by that script.
Issue is that I am not able to see those templates in jsreport studio.
My shell script create a testTemplate folder in jsreport/data folder where templates are stored and inside testTemplate folder script creates below files which are required for template.
-
config.json
{
"shortid": "Skg6lyHasL",
"name": "testTemplate",
"recipe": "text",
"engine": "jsrender",
"chrome": {
"printBackground": true
},
"creationDate": "2020-05-28T13:39:17.492Z",
"modificationDate": {
"5840date": 1590673209303
},
"_id": "0Kog3miLXUG9Qwsx",
"": "templates"
} -
helpers.js
some java script content
3.content.html
some html content
I know that, in config.json the property for templates must be this "$entitySet": "templates" but when my shell script is trying to create that file somehow that key "$entitySet" is getting removed and it looks like "": "templates" in config.json file.
Below is my part of shell script that creates that config.json file
cd /var/jsreport/
sudo rm -rf data/
mkdir data
cd /var/jsreport/data/
mkdir testTemplate
cat <<EOF >/var/jsreport/data/testTemplate/config.json
{
"shortid": "Skg6lyHasL",
"name": "testTemplate",
"recipe": "text",
"engine": "jsrender",
"chrome": {
"printBackground": true
},
"creationDate": "2020-05-28T13:39:17.492Z",
"modificationDate": {
"$$date": 1590673209303
},
"_id": "0Kog3miLXUG9Qwsx",
"$entitySet": "templates"
}
EOFAbove peace of script will create a folder testTemplate inside data folder and config.json file is also get created.
Can you help me why this key $entitySet is getting empty by shell script and we are getting like this "": "templates".
Thanks,
Zahid Khan -
-
RE: Not able to create Blob in Azure Blob using jsreport-azure-storage extension
Thank you Jan I am able to upload the blobs/reports to Azure Storage Service now.
-
RE: Not able to create Blob in Azure Blob using jsreport-azure-storage extension
Sure thanks Jan will try and update you on this
-
RE: Not able to create Blob in Azure Blob using jsreport-azure-storage extension
This is the error from Studio of Failed Requests:
Required argument streamLength for function _createBlobFromStream is not defined
ArgumentNullError: Required argument streamLength for function _createBlobFromStream is not defined at throwMissingArgument (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:476:9) at ArgumentValidator.value (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:519:7) at /var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:4191:7 at Object.validateArgs (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:556:3) at BlobService._createBlobFromStream (/var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:4185:12) at BlobService.createBlockBlobFromStream (/var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:3167:15) at Promise (/var/jsreport/node_modules/jsreport-azure-storage/lib/main.js:40:21) at new Promise () at Object.write (/var/jsreport/node_modules/jsreport-azure-storage/lib/main.js:36:14) at Object.write (/var/jsreport/node_modules/jsreport-core/lib/blobStorage/blobStorage.js:9:23) at Reports.handleAfterRender (/var/jsreport/node_modules/jsreport-reports/lib/reports.js:300:55) at+0 Starting rendering request 1 (user: null)
+1 Rendering anonymous template { recipe: docx, engine: handlebars }
+1 Inline data specified.
+2 Resources not defined for this template.
+6 Base url not specified, skipping its injection.
+6 Rendering engine handlebars using in-process strategy
+358 Compiled template not found in the cache, compiling
+366 Executing recipe docx
+366 docx generation is starting
+1323 Starting child request to render docx dynamic parts
+1327 Starting rendering request 2 (user: null)
+1329 Rendering anonymous template { recipe: html, engine: handlebars }
+1329 Inline data specified.
+1329 Resources not defined for this template.
+1331 Base url not specified, skipping its injection.
+1331 Rendering engine handlebars using in-process strategy
+1334 Compiled template not found in the cache, compiling
+1446 Executing recipe html
+1447 Skipping storing report.
+1447 Rendering request 2 finished in 120 ms
+1666 docx successfully zipped
+1666 docx generation was finished -
Not able to create Blob in Azure Blob using jsreport-azure-storage extension
Hi Jan,
I have Started a Ubuntu Server VM on Azure Cloud and installed the JsReport on it and then created a Storage Account as well to store the Reports in Azure Storage Account.When I am trying to Generate a report from my .Net core application the generated report should be stored in Storage Blob in Specifed Container as mentioned in Jsreport config.
While generating report the report get's generated successfully and Container is created in Azure Storage Blob Service but the Report/Blob is not stored in Azure Storage. You can see the Jsreport Logs below and the error I am getting.
root@jsreport-server-dev:/var/jsreport# jsreport start
2020-12-09T08:53:46.383Z - info: Initializing jsreport@2.10.0 in development mode using configuration file: jsreport.config.json
2020-12-09T08:53:46.386Z - info: Searching for available extensions in /var/jsreport/
2020-12-09T08:53:46.424Z - info: Extensions location cache not found, crawling directories
2020-12-09T08:53:50.755Z - info: Found 36 extensions
2020-12-09T08:53:51.611Z - debug: Writing extension locations cache to /tmp/jsreport/core/locations.json
2020-12-09T08:53:51.611Z - debug: Discovered 36 extensions
2020-12-09T08:53:51.721Z - warn: "templatingEngines.timeout" configuration is deprecated and will be removed in the future, please use "reportTimeout" instead
2020-12-09T08:53:51.721Z - info: Setting in-process strategy for rendering
2020-12-09T08:53:51.731Z - info: Using extension jsrender@2.1.1
2020-12-09T08:53:51.750Z - info: Using extension tags@2.5.0
2020-12-09T08:53:51.759Z - info: Using extension azure-storage@1.1.1
2020-12-09T08:53:52.873Z - info: Using extension templates@2.4.0
2020-12-09T08:53:52.878Z - debug: Extension authentication@2.6.0 is disabled, skipping
2020-12-09T08:53:52.878Z - info: Using extension import-export@2.1.0
2020-12-09T08:53:53.099Z - info: Using extension handlebars@2.1.0
2020-12-09T08:53:53.104Z - info: Using extension cli@2.2.5
2020-12-09T08:53:53.108Z - info: Using extension freeze@2.0.0
2020-12-09T08:53:53.113Z - info: Using extension debug@2.1.3
2020-12-09T08:53:53.119Z - info: Using extension express@2.8.0
2020-12-09T08:53:53.682Z - info: Using extension pptx@0.7.0
2020-12-09T08:53:53.687Z - info: Using extension docx@2.8.0
2020-12-09T08:53:53.694Z - info: Using extension authorization@2.4.0
2020-12-09T08:53:53.727Z - debug: Extension authorization@2.4.0 was disabled
2020-12-09T08:53:53.727Z - info: Using extension chrome-pdf@1.9.0
2020-12-09T08:53:53.748Z - warn: "chrome.timeout" configuration is deprecated and will be removed in the future, please use "reportTimeout" instead
2020-12-09T08:53:54.037Z - debug: Chrome strategy is dedicated-process
2020-12-09T08:53:54.038Z - debug: Chrome custom launch options are args=[--no-sandbox]
2020-12-09T08:53:54.038Z - info: Using extension child-templates@1.4.0
2020-12-09T08:53:54.058Z - info: Using extension browser-client@2.2.2
2020-12-09T08:53:54.067Z - info: Using extension licensing@2.2.3
2020-12-09T08:53:54.070Z - info: Using extension pdf-utils@1.9.0
2020-12-09T08:53:54.418Z - info: Using extension data@2.4.0
2020-12-09T08:53:54.421Z - info: Using extension version-control@1.5.1
2020-12-09T08:53:54.896Z - info: Using extension reports@2.5.0
2020-12-09T08:53:54.909Z - info: Using extension text@2.0.0
2020-12-09T08:53:54.913Z - info: Using extension base@2.0.2
2020-12-09T08:53:54.920Z - info: Using extension static-pdf@0.4.0
2020-12-09T08:53:54.939Z - info: Using extension studio@2.10.1
2020-12-09T08:53:55.217Z - debug: studio request logs are enabled (flush interval: 2000)
2020-12-09T08:53:55.219Z - info: Using extension fs-store@2.9.0
2020-12-09T08:53:55.724Z - info: Using extension scripts@2.6.0
2020-12-09T08:53:55.730Z - info: Using extension html-to-xlsx@2.8.0
2020-12-09T08:53:57.031Z - info: html-to-xlsx detected chrome as available html engine
2020-12-09T08:53:57.031Z - info: Using extension assets@1.7.0
2020-12-09T08:53:57.062Z - info: Using extension studio-theme-dark@0.3.0
2020-12-09T08:53:57.074Z - info: Using extension scheduling@2.5.0
2020-12-09T08:53:57.206Z - info: Using extension xlsx@2.5.0
2020-12-09T08:53:57.752Z - info: Using extension sample-template@2.6.0
2020-12-09T08:53:57.754Z - info: Using extension resources@2.1.0
2020-12-09T08:53:57.758Z - info: Using extension public-templates@2.2.0
2020-12-09T08:53:57.762Z - debug: Extension public-templates@2.2.0 was disabled
2020-12-09T08:53:57.762Z - info: Using fs provider for template store.
2020-12-09T08:53:57.768Z - info: fs store is persisting using fs
2020-12-09T08:53:57.769Z - info: fs store is synchronizing using fs
2020-12-09T08:53:57.855Z - info: fs store is loading data
2020-12-09T08:53:57.922Z - debug: fs store sync is configured to use polling for files watcher
2020-12-09T08:53:57.942Z - info: fs store is initialized successfully
2020-12-09T08:53:57.948Z - debug: studio default theme is: light
2020-12-09T08:53:58.123Z - info: Creating default express app.
2020-12-09T08:53:58.244Z - info: jsreport server successfully started on http port: 5488
2020-12-09T08:53:58.244Z - info: fs store emits sockets to synchronize underlying changes with studio
2020-12-09T08:53:58.362Z - info: Verifying license key free
2020-12-09T08:53:58.364Z - info: Using free license
2020-12-09T08:53:58.369Z - info: reporter initialized
2020-12-09T08:54:15.174Z - info: Starting rendering request 1 (user: null)
2020-12-09T08:54:15.176Z - info: Rendering anonymous template { recipe: docx, engine: handlebars }
2020-12-09T08:54:15.177Z - debug: Inline data specified.
2020-12-09T08:54:15.177Z - debug: Resources not defined for this template.
2020-12-09T08:54:15.182Z - debug: Base url not specified, skipping its injection.
2020-12-09T08:54:15.183Z - debug: Rendering engine handlebars using in-process strategy
2020-12-09T08:54:15.478Z - debug: Compiled template not found in the cache, compiling
2020-12-09T08:54:15.479Z - debug: Executing recipe docx
2020-12-09T08:54:15.480Z - info: docx generation is starting
2020-12-09T08:54:16.507Z - debug: Starting child request to render docx dynamic parts
2020-12-09T08:54:16.512Z - info: Starting rendering request 2 (user: null)
2020-12-09T08:54:16.513Z - info: Rendering anonymous template { recipe: html, engine: handlebars }
2020-12-09T08:54:16.514Z - debug: Inline data specified.
2020-12-09T08:54:16.514Z - debug: Resources not defined for this template.
2020-12-09T08:54:16.516Z - debug: Base url not specified, skipping its injection.
2020-12-09T08:54:16.517Z - debug: Rendering engine handlebars using in-process strategy
2020-12-09T08:54:16.644Z - debug: Compiled template not found in the cache, compiling
2020-12-09T08:54:16.663Z - debug: Executing recipe html
2020-12-09T08:54:16.664Z - debug: Skipping storing report.
2020-12-09T08:54:16.664Z - info: Rendering request 2 finished in 152 ms
2020-12-09T08:54:16.919Z - debug: docx successfully zipped
2020-12-09T08:54:16.919Z - info: docx generation was finished
2020-12-09T08:54:16.933Z - error: Rendering request 1 finished with error in 1759 ms
2020-12-09T08:54:16.933Z - error: Error when processing render request 1 Required argument streamLength for function _createBlobFromStream is not defined ArgumentNullError: Required argument streamLength for function _createBlobFromStream is not defined
at throwMissingArgument (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:476:9)
at ArgumentValidator.value (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:519:7)
at /var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:4191:7
at Object.validateArgs (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:556:3)
at BlobService._createBlobFromStream (/var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:4185:12)
at BlobService.createBlockBlobFromStream (/var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:3167:15)
at Promise (/var/jsreport/node_modules/jsreport-azure-storage/lib/main.js:40:21)
at new Promise (<anonymous>)
at Object.write (/var/jsreport/node_modules/jsreport-azure-storage/lib/main.js:36:14)
at Object.write (/var/jsreport/node_modules/jsreport-core/lib/blobStorage/blobStorage.js:9:23)
at Reports.handleAfterRender (/var/jsreport/node_modules/jsreport-reports/lib/reports.js:300:55)
at <anonymous>
2020-12-09T08:54:16.934Z - error: Error during processing request at http://xyz:5488/api/reportBelow is my Jsreport config details
{
"store": {
"provider": "fs"
},
"blobStorage": {
"provider": "azure-storage"
},
"extensions": {
"chrome-pdf": {
"timeout": 40000
},
"html-to-xlsx": {
"timeout": 40000
},
"unoconv": {
"command": "python unoconv"
},
"chrome-pdf": {
"launchOptions": {
"args": ["--no-sandbox"]
}
},
"authentication": {
"cookieSession": {
"secret": "<your strong secret here>"
},
"admin": {
"username": "admin",
"password": "password"
},
"enabled": false
},
"scripts": {
"timeout": 40000,
"strategy": "http-server"
},
"sample-template": {
"createSamples": true
},
"azure-storage": {
"accountName": "accountName",
"accountKey": "AccountKey",
"container": "ContainerName"
}
},
"httpPort": 5488,
"express": {
"inputRequestLimit": "200mb"
},
"logger": {
"console": {
"transport": "console",
"level": "debug"
},
"file": {
"transport": "file",
"level": "info",
"filename": "logs/reporter.log"
},
"error": {
"transport": "file",
"level": "error",
"filename": "logs/error.log"
}
},
"allowLocalFilesAccess": true,
"templatingEngines": {
"timeout": 600000,
"strategy": "in-process"
},
"chrome": {
"timeout": 40000
},
"office": {
"preview": {
"enabled": false
}
}
}I am using jsreport-azure-storage extension to store the reports in Azure Storage account.
Kindly help me with this error I am getting.
Thanks,
Zahid -
Page break in docx report generation using docx recipe
Hi Jan,
I am using jsreport-docx to generate docx report from docx template and data with docx recipe.
I have also the same requirement referring to this topic => https://forum.jsreport.net/topic/1353/generating-new-pages-based-on-data-size-for-fixed-size-table
Is there any page break concept in docx.
Looking forward for you reply :=).
Thanks & Regards,
Zahid Khan -
RE: Generate PDF Document From docx templates directly
Thanks @jan_blaha I had increased timeout to 20000 ms now I am able to generate 1000 plus report pdf, from docx template and data using unoconv.
"templatingEngines": {
"timeout": 60000,
"strategy": "http-server"
}Will install the latest version of jsreport 2.6.1 and then try to use above configuration.
Thanks for all your help. You guys are doing really a good job, please continue with the good work :-)
Thanks,
Zahid -
RE: Generate PDF Document From docx templates directly
Hi Jan,
One more important thing I forget to mention here I am generating the large document around 1000 page pdf from 1 page docx template with large json data resulting report should be more than 1000 pages.I think this would be the reason why it's taking time becuase first it would convert the docx report from docx template and data, Then it would convert it into pdf using unoconv extension.
My timeout in jsreport configuration is
"scripts": {
"timeout": 40000,
"strategy": "http-server"
},
"templatingEngines": {
"timeout": 10000,
"strategy": "http-server"
},
"chrome": {
"timeout": 40000
}Suggest me if I need to increase the timeout here or something else I need to do.
Thanks,
Zahid -
RE: Generate PDF Document From docx templates directly
Hi Jan,
I had updated the latest package of unoconv@0.3.0 and I was able to successfully generate the pdf from docx template and data using docx recipe. Pdf generation using unoconv is not full proof. Sometime it throw the below error => 2019-11-14T06:35:21.085Z - warn: Error when processing render request Timeout error during executing script Error: Timeout error during executing script at Timeout._onTimeout (C:\jsreportapp\node_modules\script-manager\lib\manager-servers.js:164:25) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at unrefdHandle (timers.js:520:7) at Timer.processTimers (timers.js:222:12). After this whenever I am trying to generate any report (docx to docx , docx to pdf, html-pdf, html-docx,etc.), server throws below error => 2019-11-14T06:35:41.932Z - debug: Base url not specified, skipping its injection. 2019-11-14T06:35:41.933Z - debug: Rendering engine handlebars 2019-11-14T06:35:41.973Z - warn: Error when processing render request Bad request Error: Bad request at IncomingMessage.<anonymous> (C:\jsreportapp\node_modules\script-manager\lib\worker-servers.js:228:25) at IncomingMessage.emit (events.js:203:15) at IncomingMessage.EventEmitter.emit (domain.js:466:23) at endReadableNT (_stream_readable.js:1145:12) at process._tickCallback (internal/process/next_tick.js:63:19) For every request afterwards jsreport server throws the above error. Then I have to restart the jsreport server every time when I am getting above error after then only I am able to generate documents. Kindly share your thoughts. Zahid Khan.
-
RE: Generate PDF Document From docx templates directly
Thanks @jan_blaha will install the latest version of unoconv package😊.
-
RE: Generate Large Docx Document (More Than 1000 pages)
Thanks @jan_blaha & @bjrmatos It's working good for me.
Really appreciate your efforts. -
RE: Generate PDF Document From docx templates directly
Sorry for the above message I am not able to upload the export.zip. It's seem's I don't have permission.
By the way I am using default example of docx.cv which is there on JsReport Playground. -
RE: Generate PDF Document From docx templates directly
Hi Jan,
I have installed the unoconv extension on my server from https://jsreport.net/learn/unoconv and tried to generate pdf from docx template and jason data using docx recipe and handlebar engine. I am getting the below error
TypeError: Cannot read property 'getElementsByTagName' of undefined
at module.exports (C:\jsreportapp\node_modules\jsreport-docx\lib\postprocess\style.js:40:26)
at module.exports (C:\jsreportapp\node_modules\jsreport-docx\lib\postprocess\postprocess.js:6:3)
at Object.execute (C:\jsreportapp\node_modules\jsreport-docx\lib\recipe.js:70:9)When I enable unoconv to generate pdf I got above error but when I disabled unoconv then docx report generated successfully.
Kindly help me if I am missing some configuration.
Thanks
Zahid Khan