How do I access the DOM? I can't seem to use document.getElementById for example.
updated the playground. (https://playground.jsreport.net/studio/workspace/SkM6uUaeQ/3)
How do I access the DOM? I can't seem to use document.getElementById for example.
updated the playground. (https://playground.jsreport.net/studio/workspace/SkM6uUaeQ/3)
As per this:
https://playground.jsreport.net/studio/workspace/SkM6uUaeQ/2
How do I call a javascript function that has been defined in <script> tags?
Thanks!
edg
Many months ago, I had help getting a global js working that would return the shortid of the report.
That was here: https://forum.jsreport.net/topic/391/global-javascript-file-and-handlebar-helpers/34
I have updated to v2 and now that isn't working again. Has the playground been updated? The previous link to the playground works for this but I can't get it to work locally in v2.
Thanks!
Okay, went into my package.json, removed reference to pdf-utils, removed node_modules, redid 'npm install' and now I get it to run. Yay. I assume this means I'm migrated over and using 2.0.0.
Onto the next issue.
I ran several reports and none work. The debug log is below.
I also noted that settings were lost. For example, under resources, I had en en-labels for language and my localized setting files. I had to redo those. Is this standard?
Cannot read property 'debug' of undefined
logs:
+0 Starting rendering request 5 (user: null)
+4 Rendering template { name: FieldTopTen, recipe: chrome-pdf, engine: handlebars, preview: true }
+5 Adding sample data r1js8K8Nf
+9 Found 1 applicable resources.
+11 Executing script shortId
TypeError: Cannot read property 'debug' of undefined
at C:\dev\src\Apps\JsReports\node_modules\jsreport-assets\lib\assets.js:69:18
at tryCatcher (C:\dev\src\Apps\JsReports\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\dev\src\Apps\JsReports\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (C:\dev\src\Apps\JsReports\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\dev\src\Apps\JsReports\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\dev\src\Apps\JsReports\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (C:\dev\src\Apps\JsReports\node_modules\bluebird\js\release\promise.js:638:18)
at C:\dev\src\Apps\JsReports\node_modules\bluebird\js\release\nodeback.js:42:21
at C:\dev\src\Apps\JsReports\node_modules\async-replace\async-replace.js:73:9
at C:\dev\src\Apps\JsReports\node_modules\async\lib\async.js:726:13
at C:\dev\src\Apps\JsReports\node_modules\async\lib\async.js:52:16
at done (C:\dev\src\Apps\JsReports\node_modules\async\lib\async.js:246:17)
at C:\dev\src\Apps\JsReports\node_modules\async\lib\async.js:44:16
at C:\dev\src\Apps\JsReports\node_modules\async\lib\async.js:723:17
at C:\dev\src\Apps\JsReports\node_modules\async\lib\async.js:167:37
at C:\dev\src\Apps\JsReports\node_modules\async-replace\async-replace.js:61:21
Okay, restored, via vcs, back to 1.10.0. Ran jsreport-migration. It didn't work. Here are my results. First, my config file, then the results of an npm start. Finally the log file from the run.
Thanks for the help!
jsreport.config.json file:
{
"httpPort": 5488,
"httpsPort": null,
"logger": {
"console": {
"transport": "console",
"level": "debug"
},
"file": {
"transport": "file",
"level": "info",
"filename": "logs/reporter.log",
"maxsize": 10485760,
"maxFiles": 5
},
"error": {
"transport": "file",
"level": "error",
"filename": "logs/error.log",
"maxsize": 10485760,
"maxFiles": 5
}
},
"blobStorage": {
"provider": "fs"
},
"allowLocalFilesAccess": false,
"store": {
"provider": "fs"
},
"templatingEngines": {
"allowedModules": "",
"timeout": 10000,
"numberOfWorks": 3
},
"extensions": {
"authentication": {
"enabled": false
},
"scripts": {
"allowedModules": "",
"timeout": 40000
},
"assets": {
"allowedFiles": ".",
"searchOnDiskIfNotFoundInStore": true
}
}
}
npm start results:
PS C:\dev\src\Apps\JsReports> npm start
jsreport-server@ start C:\dev\src\Apps\JsReports
node server.js
2018-05-17T15:16:12.313Z - info: Initializing jsreport@2.0.0 in development mode using configuration file: jsreport.conf
ig.json
2018-05-17T15:16:12.313Z - info: Searching for available extensions in C:\dev\src\Apps\JsReports
2018-05-17T15:16:12.329Z - info: Extensions location cache C:\Users\JGORAN~1\AppData\Local\Temp\jsreport\core\locations.
json contains older information, crawling
2018-05-17T15:16:13.416Z - info: Found 31 extensions
2018-05-17T15:16:13.416Z - debug: Writing extension locations cache to C:\Users\JGORAN~1\AppData\Local\Temp\jsreport\cor
e\locations.json
2018-05-17T15:16:13.436Z - debug: Discovered 31 extensions
2018-05-17T15:16:13.465Z - info: Setting process based strategy for rendering. Please visit http://jsreport.net/learn/co
nfiguration for information how to get more performance.
2018-05-17T15:16:13.465Z - info: Using extension handlebars
2018-05-17T15:16:13.465Z - info: Using extension import-export
2018-05-17T15:16:13.610Z - info: Using extension templates
2018-05-17T15:16:13.610Z - info: Using extension jsrender
2018-05-17T15:16:13.610Z - debug: Extension authentication is disabled, skipping
2018-05-17T15:16:13.610Z - info: Using extension freeze
2018-05-17T15:16:13.610Z - info: Using extension cli
2018-05-17T15:16:13.610Z - info: Using extension express
2018-05-17T15:16:13.740Z - info: Using extension debug
2018-05-17T15:16:13.740Z - info: Using extension tags
2018-05-17T15:16:13.740Z - info: Using extension data
2018-05-17T15:16:13.740Z - info: Using extension fs-store
2018-05-17T15:16:13.900Z - info: Using extension authorization
2018-05-17T15:16:13.900Z - debug: Extension authorization was disabled
2018-05-17T15:16:13.916Z - info: Using extension html-to-xlsx
2018-05-17T15:16:14.077Z - info: html-to-xlsx detected chrome as available html engine
2018-05-17T15:16:14.077Z - info: Using extension child-templates
2018-05-17T15:16:14.077Z - info: Using extension browser-client
2018-05-17T15:16:14.077Z - info: Using extension chrome-pdf
2018-05-17T15:16:14.077Z - info: Using extension pdf-utils
2018-05-17T15:16:14.261Z - error: Error when loading extension pdf-utils
TypeError: Cannot read property 'modules' of undefined
at Object.module.exports (C:\dev\src\Apps\JsReports\node_modules\jsreport-pdf-utils\lib\main.js:10:26)
at Object._useOne (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\extensions\extensionsManager.js:154:75)
at Object._useMany (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\extensions\extensionsManager.js:73:20)
at <anonymous>
2018-05-17T15:16:14.261Z - error: Error occured during reporter init Error: Error when loading extension pdf-utils
TypeError: Cannot read property 'modules' of undefined
at Object.module.exports (C:\dev\src\Apps\JsReports\node_modules\jsreport-pdf-utils\lib\main.js:10:26)
at Object._useOne (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\extensions\extensionsManager.js:154:75)
at Object._useMany (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\extensions\extensionsManager.js:73:20)
at <anonymous>
at Object._useOne (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\extensions\extensionsManager.js:163:15)
at Object._useMany (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\extensions\extensionsManager.js:73:20)
at <anonymous>
Error: Error when loading extension pdf-utils
TypeError: Cannot read property 'modules' of undefined
at Object.module.exports (C:\dev\src\Apps\JsReports\node_modules\jsreport-pdf-utils\lib\main.js:10:26)
at Object._useOne (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\extensions\extensionsManager.js:154:75)
at Object._useMany (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\extensions\extensionsManager.js:73:20)
at <anonymous>
at Object._useOne (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\extensions\extensionsManager.js:163:15)
at Object._useMany (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\extensions\extensionsManager.js:73:20)
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jsreport-server@ start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jsreport-server@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jgoranson\AppData\Roaming\npm-cache_logs\2018-05-17T15_16_14_309Z-debug.log
log file:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@5.6.0
3 info using node@v8.11.2
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle jsreport-server@~prestart: jsreport-server@
6 info lifecycle jsreport-server@~start: jsreport-server@
7 verbose lifecycle jsreport-server@~start: unsafe-perm in lifecycle true
8 verbose lifecycle jsreport-server@~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\dev\src\Apps\JsReports\node_modules.bin;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\dotnet;C:\Program Files\Perforce;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files (x86)\WinMerge;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Users\jgoranson\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\jgoranson\AppData\Roaming\npm;C:\Users\jgoranson\AppData\Local\Programs\Fiddler;C:\Users\jgoranson\AppData\Local\Microsoft\WindowsApps
9 verbose lifecycle jsreport-server@~start: CWD: C:\dev\src\Apps\JsReports
10 silly lifecycle jsreport-server@~start: Args: [ '/d /s /c', 'node server.js' ]
11 silly lifecycle jsreport-server@~start: Returned: code: 1 signal: null
12 info lifecycle jsreport-server@~start: Failed to exec start script
13 verbose stack Error: jsreport-server@ start: node server.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid jsreport-server@
15 verbose cwd C:\dev\src\Apps\JsReports
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v8.11.2
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error jsreport-server@ start: node server.js
22 error Exit status 1
23 error Failed at the jsreport-server@ start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Okay, I can't get jsreport v2.0.0 to run. I updated jsreport from 1.10.0 to 2.0.0. I try to start it and it didn't start. I confirm that I have the 2.0.0 version installed.
When I attempt to start it, I get this:
PS C:\dev\src\Apps\JsReports> npm start
jsreport-server@ start C:\dev\src\Apps\JsReports
node server.js
2018-05-17T13:09:38.527Z - error: Error occured during reporter init Error: options contain values
he defined base root schema. schema validation errors: rootOptions.blobStorage should be object
at Reporter.init (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\reporter.js:106:15)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
Error: options contain values that does not match the defined base root schema. schema validation
obStorage should be object
at Reporter.init (C:\dev\src\Apps\JsReports\node_modules\jsreport-core\lib\reporter.js:106:15)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jsreport-server@ start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jsreport-server@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jgoranson\AppData\Roaming\npm-cache_logs\2018-05-17T13_09_38_557Z-debug.log
And the log file is:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@5.6.0
3 info using node@v8.11.2
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle jsreport-server@~prestart: jsreport-server@
6 info lifecycle jsreport-server@~start: jsreport-server@
7 verbose lifecycle jsreport-server@~start: unsafe-perm in lifecycle true
8 verbose lifecycle jsreport-server@~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\dev\src\Apps\JsReports\node_modules.bin;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\dotnet;C:\Program Files\Perforce;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files (x86)\WinMerge;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Users\jgoranson\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\jgoranson\AppData\Roaming\npm;C:\Users\jgoranson\AppData\Local\Programs\Fiddler;C:\Users\jgoranson\AppData\Local\Microsoft\WindowsApps
9 verbose lifecycle jsreport-server@~start: CWD: C:\dev\src\Apps\JsReports
10 silly lifecycle jsreport-server@~start: Args: [ '/d /s /c', 'node server.js' ]
11 silly lifecycle jsreport-server@~start: Returned: code: 1 signal: null
12 info lifecycle jsreport-server@~start: Failed to exec start script
13 verbose stack Error: jsreport-server@ start: node server.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid jsreport-server@
15 verbose cwd C:\dev\src\Apps\JsReports
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v8.11.2
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error jsreport-server@ start: node server.js
22 error Exit status 1
23 error Failed at the jsreport-server@ start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Any thoughts on this? What else can I do to help you help me?
Thanks!
Thanks for the updates!
Is this new update for the image urls out?
Is this the new version I have been waiting for with regards to my images not appearing? The chrome headers and footers? Or is this something else?
Where is this announced when released and with notes?
Sorry if these have been answered.
Thanks!
Where do you put those? Is this a custom header/footer? Where did you find this info?
I'm trying to make a custom one with date in the footer as well as page count but didn't find something like this!
Thanks!
Thanks for the response! Really looking forward to the new release!
Greetings!
Two issues.
One, I'm looking for a way to add and control headers and footers in chrome pdfs. I can see that clicking the 'display header/footer' will display them but now I want to control the content in them. How do I do that?
Two, I'm trying to make the rendering of pdf headers via pdf-utils faster. Without a pdf header, my report takes around 2 seconds to render but as soon as I add the header, it jumps to 9 seconds. I have played with the configuration settings, such as tasks.numberOfWorkers to a higher value but that doesn't seem to have made a difference. How else can I improve performance on the render?
Thanks!
Greetings! I am hoping for an update on where the new version of v2 will be released to fix this issue? Thanks!
If you have added it to your assets area, all you should need to do is something like this.
{#asset <nameInAssets> @encoding=utf8}
For example:
<style>
{#asset style.css @encoding=utf8}
</style>
Put that at the top of the template file.
I have seen this pop up from time to time as well. However, I'm usually making changes to the template, or maybe even switching branches in version control. A refresh of the page clears it up. Just another data point for you. I can also look at any errors I get and share if it happens.
Okay! Thanks for the update!
Is there any word on when this will be released? Thanks!
I appreciate the further testing. I will continue to try some things on my side as well but am looking forward to what you found out.
Thanks!
Well, interesting and darn. Thanks on the npm ls jsreport. I forgot it was just stable versions.
I don't know why it's not working for me locally. I will keep looking. Thanks!
Okay, created narwhal locally and then pushed up to a repo.
https://github.com/evildmguy/jsreportsBetaTEsting
I did the commands on here (https://jsreport.net/blog/jsreport-v2-beta) to get this running it's in own folder. That worked in getting jsreport studio up and running.
Created the narwhal project using the pages and data from the playground area. It still doesn't work.
While one of the screen shots shows it is running beta, and this is a fresh directory with nothing else, when I look at version, I get 1.10.0.
What else can I do to help troubleshoot this issue?
Thanks!
Okay, I think I have the beta stuff installed, as per my other post. I don't see any changes to the images in the urls. Further, the playground link above also doesn't work.
What else can I check on this to verify I have everything new on my end?
Thanks!