Hi Jan,
Thanks for the quick response. The issue I'm having with running 1.9.8 is getting images to render in the footer (even though I have added the display:none to the template as outlined in doc). Am I doing something wrong?
Hi Jan,
Thanks for the quick response. The issue I'm having with running 1.9.8 is getting images to render in the footer (even though I have added the display:none to the template as outlined in doc). Am I doing something wrong?
Hi,
When I try and use Phantom PDF version 2.1.1, it does not generate table headings on page break. It only works with version 1.9.8.
Any ideas?
Hi,
I am working with PhantomPDF 2.1.1 and when I put in a header, it seems to have a margin around it that I can not control. I have modeled it here:
https://playground.jsreport.net/w/anon/wE5wOs85
You can see that the border and the blue coloured sections are not the same size. How can I control the size of the blue section?
We have switched to jsreport-core and are now getting the error message as seen below.
Here is the server.js
var jsreport = require('jsreport-core')();
var express = require('express');
var app = express();
app.use(express.json());
jsreport.use(require('jsreport-express')({app: app}));
jsreport.use(require('jsreport-phantom-pdf')());
jsreport.use(require('jsreport-jsrender')());
jsreport.use(require('jsreport-templates')());
jsreport.use(require('jsreport-fs-store')());
jsreport.init().catch((e) => {
// error during startup
console.error('Error during startup');
console.error(e.stack);
process.exit(1);
});
// health check
app.get('/health', (req, res) => {
res.sendStatus(200);
})
// report posting
app.post('/api/report', function(req,res) {
console.log('\n');
console.log(req.body);
console.log('\n');
jsreport.render(req.body).then(function(res) {
console.log(res.content.toString());
}).catch((e) => {
// error during render
console.error('Error during render');
console.error(e.stack);
})
});
app.listen(5489);
Post (I have tried using both shortid and name to ensure that it is correct):
{
"template": {
"shortid": "HkVI7bmHE"
},
"data": {
...
}
}
Error:
Error: Unable to find specified template or user doesnt have permissions to read it: Main
at module.exports (/app/node_modules/jsreport-core/lib/util/createError.js:11:13)
at Reporter.createError (/app/node_modules/jsreport-core/lib/reporter.js:265:12)
at AsyncFunction.<anonymous> (/app/node_modules/jsreport-templates/lib/templates.js:142:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
Hi,
I am in the common situation where I am building dynamic tables that are overflowing to multiple pages. If I am correct there is no feature to detect the page breaks so ideally I would like to force page breaks after x
number of rows and repeat the table headings at the top of each page.
I tried to implement a counter using https://www.jsviews.com/#allowcodetag@sample as a guide. This did not seem to work with jsreports. Any ideas how I can do this in a clean way?
I am also looking for use of this as described https://www.jsviews.com/#allowcodetag@sample
Ok I will consider a couple options, thanks so much for all your help!
😳 Wow. That fixed it! Amazing amazing!
One last question... When uploading the PDF to S3, it sets random characters for the name. Is there another place I am supposed to be setting the name?
{
"template": {
"name": "Main"
},
"options": {
"reportName": "myreport",
"reports": { "save": true }
},
"data": {...}
}
Hi, I'm not sure if I have messed something else up, but this is the error I get when I run what you have requested:
error: Error when processing render request The authorization header is malformed; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request". AuthorizationHeaderMalformed: The authorization header is malformed; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request".
at Request.extractError (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/services/s3.js:583:35)
at Request.callListeners (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
at Request.emit (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
at callNextListener (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
at IncomingMessage.onEnd (/app/node_modules/jsreport-aws-s3-storage/node_modules/aws-sdk/lib/event_listeners.js:294:13)
at IncomingMessage.emit (events.js:194:15)
at IncomingMessage.EventEmitter.emit (domain.js:441:20)
2019-03-25T16:58:04.405Z - error: Error during processing request at https://localhost:5489/api/report
I am walking through the s3.js file now to see if I can figure out where this is breaking.
Hmm ok that seems to have fixed some of it! It now loads my keys into aws-s3-storage
which is printing out in the logs. But when I log in to AWS, the PDF file is not uploaded to the S3 bucket. I know the bucket name and keys are correct since I am using them elsewhere to upload a CSV successfully and I did double check that {"save": true}
. Any other ideas?
Ah I see what you are asking... here is the file
const AWS = require('aws-sdk');
const process = require('process');
async function beforeRender(req, res, done) {
//filter out script execution for phantom header & footer
if (req.options.isChildRequest)
return done();
console.log('beforeRender - Building report for payee with Id ' + req.data.header.payeeId + ' for period ' + req.data.header.reportingPeriodFrom + ' - ' + req.data.header.reportingPeriodTo);
done();
}
function afterRender(req, res, done) {
//filter out script execution for phantom header & footer
if (req.options.isChildRequest)
return done();
// Create CSV
prepareStatementCSV(req, res);
// Save pdf to S3 bucket - Method 1
var jsreport_core = require('jsreport-core') ({ blobStorage: { provider: 'aws-s3-storage' } });
jsreport_core.use(require('jsreport-aws-s3-storage')({
"accessKeyId": process.env.S3_SECRET_ACCESS_KEY,
"secretAccessKey": process.env.S3_ACCESS_KEY_ID,
"bucket": process.env.S3_BUCKET_NAME,
"s3Options": {}
}));
console.log("afterRender - Report creation completed successfully.");
done();
}
I'm just using the default server.js built in to jsreports. Unless I'm misunderstanding what you are asking for?
Hi, yes it should be the latest version of jsreport-aws-s3-storage
.
Here is the jsreport.config.json
content:
{
"extensions": {
"authentication": {
"cookieSession": {
"secret": "<your strong secret here>"
},
"admin": {
"username": "admin",
"password": "password"
},
"enabled": false
},
"scripts": {
"timeout": 40000,
"strategy": "http-server",
"allowedModules": ["jsreport", "jsrender", "jquery", "request", "express", "aws-sdk", "process", "jsreport-core", "jsreport-aws-s3-storage"]
},
"sample-template": {
"createSamples": false
},
"express": {
"inputRequestLimit": "250mb"
},
"assets": {
"allowedFiles" : "/highcharts/js/themes/**.js"
}
},
"httpPort": 5488,
"httpsPort": 5489,
"certificate": {
"key": "~/.ssh/jsreport.key",
"cert": "~/.ssh/jsreport.cer"
},
"store": {
"provider": "fs"
},
"blobStorage": {
"provider": "fs"
},
"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": 10000,
"strategy": "http-server"
},
"chrome": {
"timeout": 40000
},
"phantom": {
"strategy": "phantom-server",
"defaultPhantomjsVersion": "2.1.1"
},
"freeze": {
"hardFreeze": false
}
}
In my original post, you can see that { blobStorage: { provider: 'aws-s3-storage' } }
.
Hi there,
Here are the logs:
2019-03-24T19:50:00.159Z - info: Initializing jsreport@2.4.0 in development mode using configuration file: jsreport.config.json
2019-03-24T19:50:00.164Z - info: Searching for available extensions in /app/
2019-03-24T19:50:00.186Z - info: Extensions location cache contains up to date information, skipping crawling in /app/
2019-03-24T19:50:02.493Z - info: Found 33 extensions
2019-03-24T19:50:02.611Z - debug: Writing extension locations cache to /tmp/jsreport/core/locations.json
2019-03-24T19:50:02.612Z - debug: Discovered 33 extensions
2019-03-24T19:50:02.909Z - info: Using extension import-export
2019-03-24T19:50:03.872Z - info: Using extension tags
2019-03-24T19:50:03.883Z - info: Using extension aws-s3-storage
2019-03-24T19:50:05.130Z - debug: Extension aws-s3-storage was disabled
2019-03-24T19:50:05.131Z - info: Using extension templates
2019-03-24T19:50:05.141Z - info: Using extension jsrender
2019-03-24T19:50:05.147Z - debug: Extension authentication is disabled, skipping
2019-03-24T19:50:05.147Z - info: Using extension handlebars
2019-03-24T19:50:05.159Z - info: Using extension cli
2019-03-24T19:50:05.164Z - info: Using extension freeze
2019-03-24T19:50:05.169Z - info: Using extension debug
2019-03-24T19:50:05.175Z - info: Using extension express
2019-03-24T19:50:06.103Z - info: Using extension phantom-pdf
2019-03-24T19:50:06.216Z - info: Using extension data
2019-03-24T19:50:06.222Z - info: Using extension chrome-pdf
2019-03-24T19:50:06.648Z - debug: Chrome strategy is dedicated-process
2019-03-24T19:50:06.649Z - info: Using extension child-templates
2019-03-24T19:50:06.673Z - info: Using extension browser-client
2019-03-24T19:50:06.686Z - info: Using extension licensing
2019-03-24T19:50:06.701Z - info: Using extension pdf-utils
2019-03-24T19:50:07.096Z - info: Using extension authorization
2019-03-24T19:50:07.113Z - debug: Extension authorization was disabled
2019-03-24T19:50:07.113Z - info: Using extension version-control
2019-03-24T19:50:07.598Z - info: Using extension reports
2019-03-24T19:50:07.616Z - info: Using extension text
2019-03-24T19:50:07.622Z - info: Using extension base
2019-03-24T19:50:07.627Z - info: Using extension studio
2019-03-24T19:50:07.727Z - debug: studio request logs are enabled (flush interval: 2000)
2019-03-24T19:50:07.727Z - info: Using extension fs-store
2019-03-24T19:50:09.372Z - info: Using extension scheduling
2019-03-24T19:50:09.526Z - info: Using extension scripts
2019-03-24T19:50:09.548Z - info: Using extension html-to-xlsx
2019-03-24T19:50:10.141Z - info: html-to-xlsx detected chrome as available html engine
2019-03-24T19:50:10.143Z - info: html-to-xlsx detected phantom as available html engine
2019-03-24T19:50:10.144Z - info: Using extension assets
2019-03-24T19:50:10.196Z - info: Using extension xlsx
2019-03-24T19:50:10.772Z - info: Using extension sample-template
2019-03-24T19:50:10.780Z - debug: Creating samples is disabled
2019-03-24T19:50:10.780Z - info: Using extension resources
2019-03-24T19:50:10.784Z - info: Using extension public-templates
2019-03-24T19:50:10.796Z - debug: Extension public-templates was disabled
2019-03-24T19:50:10.800Z - info: fs store is persisting using fs
2019-03-24T19:50:10.800Z - info: fs store is synchronizing using fs
2019-03-24T19:50:10.821Z - info: fs store is loading data
2019-03-24T19:50:10.998Z - debug: fs store sync is configured to use polling for files watcher
2019-03-24T19:50:11.257Z - info: fs store is initialized successfully
2019-03-24T19:50:11.299Z - info: Creating default express app.
2019-03-24T19:50:11.406Z - debug: Reading ssl certificate from /app/node_modules/jsreport-express/certificates/jsreport.net.cert
2019-03-24T19:50:11.424Z - info: jsreport server successfully started on https port: 5489
2019-03-24T19:50:11.425Z - info: jsreport server successfully started on http port: 5488
2019-03-24T19:50:11.427Z - info: fs store emits sockets to synchronize underlying changes with studio
2019-03-24T19:50:11.548Z - info: Verifying license key free
2019-03-24T19:50:12.179Z - info: Using enterprise trial license
2019-03-24T19:50:12.190Z - info: reporter initialized
2019-03-24T19:50:56.773Z - info: Starting rendering request 1 (user: null)
2019-03-24T19:50:56.776Z - info: Rendering template { name: Main, recipe: phantom-pdf, engine: jsrender, preview: true }
2019-03-24T19:50:56.778Z - debug: Adding sample data S1xaFZ0M_V
2019-03-24T19:50:56.779Z - debug: Resources not defined for this template.
2019-03-24T19:50:56.783Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:57.015Z - debug: Executing script statementGenerator.js
2019-03-24T19:50:58.560Z - debug: beforeRender - Building report for payee with Id 123456 for period Jan 01 2018 - Dec 01 2018
2019-03-24T19:50:58.560Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:58.584Z - debug: Replaced assets ["main.css"]
2019-03-24T19:50:58.598Z - debug: Rendering child template Summary
2019-03-24T19:50:58.599Z - info: Starting rendering request 2 (user: null)
2019-03-24T19:50:58.600Z - debug: Rendering child template TransactionDetails
2019-03-24T19:50:58.600Z - info: Starting rendering request 3 (user: null)
2019-03-24T19:50:58.603Z - debug: Rendering child template SummaryByWork
2019-03-24T19:50:58.603Z - info: Starting rendering request 4 (user: null)
2019-03-24T19:50:58.604Z - debug: Rendering child template SummaryByIncomeGroup
2019-03-24T19:50:58.604Z - info: Starting rendering request 5 (user: null)
2019-03-24T19:50:58.606Z - debug: Rendering child template SummaryByIncomeType
2019-03-24T19:50:58.606Z - info: Starting rendering request 6 (user: null)
2019-03-24T19:50:58.607Z - debug: Rendering child template SummaryByIncomeSource
2019-03-24T19:50:58.607Z - info: Starting rendering request 7 (user: null)
2019-03-24T19:50:58.608Z - debug: Rendering child template SummaryByTerritory
2019-03-24T19:50:58.609Z - info: Starting rendering request 8 (user: null)
2019-03-24T19:50:58.610Z - info: Rendering template { name: Summary, recipe: html, engine: jsrender, preview: true }
2019-03-24T19:50:58.611Z - info: Rendering template { name: TransactionDetails, recipe: html, engine: jsrender, preview: true }
2019-03-24T19:50:58.612Z - info: Rendering template { name: SummaryByWork, recipe: html, engine: jsrender, preview: true }
2019-03-24T19:50:58.612Z - info: Rendering template { name: SummaryByIncomeGroup, recipe: html, engine: jsrender, preview: true }
2019-03-24T19:50:58.613Z - info: Rendering template { name: SummaryByIncomeType, recipe: html, engine: jsrender, preview: true }
2019-03-24T19:50:58.614Z - info: Rendering template { name: SummaryByIncomeSource, recipe: html, engine: jsrender, preview: true }
2019-03-24T19:50:58.615Z - debug: Inline data specified.
2019-03-24T19:50:58.615Z - info: Rendering template { name: SummaryByTerritory, recipe: html, engine: jsrender, preview: true }
2019-03-24T19:50:58.616Z - debug: Resources not defined for this template.
2019-03-24T19:50:58.617Z - debug: Inline data specified.
2019-03-24T19:50:58.617Z - debug: Resources not defined for this template.
2019-03-24T19:50:58.618Z - debug: Inline data specified.
2019-03-24T19:50:58.619Z - debug: Resources not defined for this template.
2019-03-24T19:50:58.619Z - debug: Inline data specified.
2019-03-24T19:50:58.620Z - debug: Resources not defined for this template.
2019-03-24T19:50:58.620Z - debug: Inline data specified.
2019-03-24T19:50:58.620Z - debug: Resources not defined for this template.
2019-03-24T19:50:58.621Z - debug: Inline data specified.
2019-03-24T19:50:58.622Z - debug: Resources not defined for this template.
2019-03-24T19:50:58.622Z - debug: Inline data specified.
2019-03-24T19:50:58.622Z - debug: Resources not defined for this template.
2019-03-24T19:50:58.623Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:58.623Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:58.625Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:58.629Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:58.630Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:58.631Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:58.633Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:58.687Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:50:58.687Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:50:58.687Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:50:58.688Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:50:58.688Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:50:58.689Z - debug: Rendering engine jsrender
2019-03-24T19:50:58.690Z - debug: Rendering engine jsrender
2019-03-24T19:50:58.690Z - debug: Rendering engine jsrender
2019-03-24T19:50:58.694Z - debug: Rendering engine jsrender
2019-03-24T19:50:58.695Z - debug: Rendering engine jsrender
2019-03-24T19:50:58.699Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:50:58.715Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:50:58.716Z - debug: Rendering engine jsrender
2019-03-24T19:50:58.723Z - debug: Rendering engine jsrender
2019-03-24T19:50:59.016Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:50:59.017Z - debug: Executing recipe html
2019-03-24T19:50:59.018Z - debug: Skipping storing report.
2019-03-24T19:50:59.019Z - info: Rendering request 2 finished in 420 ms
2019-03-24T19:50:59.024Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:50:59.025Z - debug: Executing recipe html
2019-03-24T19:50:59.025Z - debug: Skipping storing report.
2019-03-24T19:50:59.026Z - info: Rendering request 6 finished in 420 ms
2019-03-24T19:50:59.037Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:50:59.038Z - debug: Executing recipe html
2019-03-24T19:50:59.038Z - debug: Skipping storing report.
2019-03-24T19:50:59.039Z - info: Rendering request 4 finished in 436 ms
2019-03-24T19:50:59.044Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:50:59.045Z - debug: Executing recipe html
2019-03-24T19:50:59.046Z - debug: Skipping storing report.
2019-03-24T19:50:59.047Z - info: Rendering request 5 finished in 442 ms
2019-03-24T19:50:59.066Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:50:59.069Z - debug: Executing recipe html
2019-03-24T19:50:59.070Z - debug: Skipping storing report.
2019-03-24T19:50:59.073Z - info: Rendering request 3 finished in 472 ms
2019-03-24T19:50:59.090Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:50:59.092Z - debug: Executing recipe html
2019-03-24T19:50:59.093Z - debug: Skipping storing report.
2019-03-24T19:50:59.095Z - info: Rendering request 7 finished in 488 ms
2019-03-24T19:50:59.103Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:50:59.105Z - debug: Executing recipe html
2019-03-24T19:50:59.105Z - debug: Skipping storing report.
2019-03-24T19:50:59.106Z - info: Rendering request 8 finished in 497 ms
2019-03-24T19:50:59.111Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:50:59.112Z - debug: Rendering engine jsrender
2019-03-24T19:50:59.121Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:50:59.124Z - debug: Rendering child template RoyaltiesStatement
2019-03-24T19:50:59.124Z - info: Starting rendering request 9 (user: null)
2019-03-24T19:50:59.127Z - info: Rendering template { name: RoyaltiesStatement, recipe: html, engine: jsrender, preview: true }
2019-03-24T19:50:59.129Z - debug: Inline data specified.
2019-03-24T19:50:59.129Z - debug: Resources not defined for this template.
2019-03-24T19:50:59.130Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:59.145Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:50:59.145Z - debug: Rendering engine jsrender
2019-03-24T19:50:59.171Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:50:59.174Z - debug: Executing recipe html
2019-03-24T19:50:59.175Z - debug: Skipping storing report.
2019-03-24T19:50:59.176Z - info: Rendering request 9 finished in 52 ms
2019-03-24T19:50:59.193Z - debug: Executing recipe phantom-pdf
2019-03-24T19:50:59.230Z - debug: Starting child request to render pdf header
2019-03-24T19:50:59.231Z - info: Starting rendering request 10 (user: null)
2019-03-24T19:50:59.233Z - info: Rendering template { name: Main, recipe: html, engine: jsrender, preview: true }
2019-03-24T19:50:59.234Z - debug: Inline data specified.
2019-03-24T19:50:59.234Z - debug: Resources not defined for this template.
2019-03-24T19:50:59.235Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:59.248Z - debug: Executing script statementGenerator.js
2019-03-24T19:50:59.269Z - debug: beforeRender - Building report for payee with Id 123456 for period Jan 01 2018 - Dec 01 2018
2019-03-24T19:50:59.270Z - debug: Executing script helperFunctions.js
2019-03-24T19:50:59.333Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:50:59.333Z - debug: Rendering engine jsrender
2019-03-24T19:50:59.342Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:50:59.346Z - debug: Executing recipe html
2019-03-24T19:50:59.348Z - debug: Skipping storing report.
2019-03-24T19:50:59.351Z - debug: Executing script anonymous
2019-03-24T19:51:05.316Z - debug: prepareStatementCSV complete. returning records.
2019-03-24T19:51:05.316Z - debug: afterRender - Report creation completed successfully.
2019-03-24T19:51:05.317Z - info: Rendering request 10 finished in 6086 ms
2019-03-24T19:51:05.318Z - debug: Starting child request to render pdf footer
2019-03-24T19:51:05.319Z - info: Starting rendering request 11 (user: null)
2019-03-24T19:51:05.320Z - info: Rendering template { name: Main, recipe: html, engine: jsrender, preview: true }
2019-03-24T19:51:05.321Z - debug: Inline data specified.
2019-03-24T19:51:05.321Z - debug: Resources not defined for this template.
2019-03-24T19:51:05.323Z - debug: Executing script helperFunctions.js
2019-03-24T19:51:05.372Z - debug: Executing script statementGenerator.js
2019-03-24T19:51:05.391Z - debug: beforeRender - Building report for payee with Id 123456 for period Jan 01 2018 - Dec 01 2018
2019-03-24T19:51:05.391Z - debug: Executing script helperFunctions.js
2019-03-24T19:51:05.411Z - debug: Base url not specified, skipping its injection.
2019-03-24T19:51:05.412Z - debug: Rendering engine jsrender
2019-03-24T19:51:05.422Z - debug: Compiled template not found in the cache, compiling
2019-03-24T19:51:05.459Z - debug: Executing recipe html
2019-03-24T19:51:05.461Z - debug: Skipping storing report.
2019-03-24T19:51:05.462Z - debug: Executing script anonymous
2019-03-24T19:51:05.526Z - debug: prepareStatementCSV complete. returning records.
2019-03-24T19:51:05.526Z - debug: afterRender - Report creation completed successfully.
2019-03-24T19:51:05.527Z - info: Rendering request 11 finished in 208 ms
Hi,
I am trying to upload the phantom-pdf rendered to an S3 bucket using the jsreport-aws-s3-storage
extension with the details defined by environment variables. I have the following in my config file as described in documentation:
{
"template": { "shortid" : "g1PyBkARK" },
"data" : { ... },
"options": {
"reports": { "save": true }
}
}
In my .js file, I have
var jsreport_core = require('jsreport-core') ({ blobStorage: { provider: 'aws-s3-storage' } });
jsreport_core.use(require('jsreport-aws-s3-storage')({
"accessKeyId": process.env.S3_SECRET_ACCESS_KEY,
"secretAccessKey": process.env.S3_ACCESS_KEY_ID,
"bucket": process.env.S3_BUCKET_NAME,
"s3Options": {}
}));
The variables are passing in fine, but the file is not being uploaded into the S3 bucket. Any tips?