Thanks for the reply, I suspected so but thought it was worth asking.
Adam Richards
@Adam Richards
Posts made by Adam Richards
-
RE: Chrome-PDF page break on split page table rows?
-
Chrome-PDF page break on split page table rows?
I've tried reading the chrome-pdf docs and what I can find about headless Chrome, but I can't find what I'm looking for. I'm trying to find a way to make chrome-pdf document rendering to force page breaks if a <tr> splits onto two pages.
I know this is probably very difficult, if possible at all, as the size of the page and the content in it aren't necessarily known until after it's rendered. But does anyone know if there's a way? It would just make the output of my documents (which are heavily table-reliant) look cleaner.
-
RE: Local install of JSReport crashed - now won't start
I'm removed it and get the same error.
-
RE: Local install of JSReport crashed - now won't start
which jsreport folder will the data folder be in? I'm not overly familiar with the structure.
-
RE: Local install of JSReport crashed - now won't start
I'm on 2.1.0, but I can't find that file to delete?
-
Local install of JSReport crashed - now won't start
As the title says, I have a local install that I've been experimenting with, and it's been working fine. I was working on trying to get some external data with scripts, when my computer crashed (blue screen - Windows 10). Once it did the disk scan and repair, I tried to load jsreport again from the command line and get this error each time.
2018-07-18T10:46:37.907Z - info: Using extension public-templates 2018-07-18T10:46:37.918Z - debug: Extension public-templates was disabled 2018-07-18T10:46:37.927Z - info: fs store is persisting using fs 2018-07-18T10:46:37.929Z - info: fs store is synchronizing using fs 2018-07-18T10:46:38.019Z - info: fs store is loading data 2018-07-18T10:46:38.095Z - error: Error occured during reporter init SyntaxError: Unexpected token in JSON at position 0 at JSON.parse (<anonymous>) at parse (C:\Users\ar206747\node_modules\jsreport-fs-store\lib\customUtils.js:77:15) at Array.map (<anonymous>) at loadFlatDocument (C:\Users\ar206747\node_modules\jsreport-fs-store\lib\persistence.js:148:58) at <anonymous> An error has occurred when trying to initialize jsreport (2). Unexpected token in JSON at position 0 (1). caused by error (2) -> stack = Error: at instance.init.then.catch (C:\Users\ar206747\node_modules\jsreport-cli\lib\instanceHandler.js:31:29) at <anonymous> caused by error (1) -> stack = SyntaxError: at JSON.parse (<anonymous>) at parse (C:\Users\ar206747\node_modules\jsreport-fs-store\lib\customUtils.js:77:15) at Array.map (<anonymous>) at loadFlatDocument (C:\Users\ar206747\node_modules\jsreport-fs-store\lib\persistence.js:148:58) at <anonymous>
The odd thing is the error it's reporting about unexpected token in json at <anonymous> is the problem I was trying to debug in my script when the computer crashed.
I've tried
jsreport repair
but it hasn't fixed the problem.Any ideas?
-
RE: Using multiple data sources in a single template?
Ignore that, I fixed it by changing
{{each $resource.modules.modules}}
to{{each ../$resource.modules.modules}}
. I didn't realise that I'd have to be that explicit when using $resource. -
RE: Using multiple data sources in a single template?
Thanks, it really does. The problem I'm having now is that when I try to each loop with a different resource as the source the nested loop, nothing happens.
<tr> <td>{{#each $resource.course.Modules}} {{this.[Module Code]}} {{#each $resource.modules.modules}} <p>1</p> {{/each}} {{/each}} </td> </tr>
The
<p>1</p>
is in there for my own testing. it never gets printed/output, like the inner loop just isn't happening. -
RE: Using multiple data sources in a single template?
Hi, thanks, yes I got that working now.
If I can be a pain and ask, is it possible to iterate over two nest each loops to match data in the two sources? As per my original idea.
So I have a data source called course, which has a list of associated modules, held in array, with an identifier 'modulecode'. I have a second data source called modules which have the same 'modulecode' identifier, but then extended information like name, duration etc.
What l'd like to do is to step over each module code in courses, then loop over the array of modules and output the name for example on a match. Is it possible?
I understand that for each loop of the each, I can refer to the current record as 'this.', but what happens when it's nested? I need the equivalent of this pseudocode:
{{#each $resource.course.module}} <p>Module {{8}}: </p> {{#each $resource.modules.modules}} {{#if this.modulecode **meaning the modules data source** == parent.modulecode **is there a concept of parent for nests?**}} {{this.modulename}} {{/if}} {{/each}} {{/each}}
Does that make sense? Is it achievable without merging the datasets? Is it using @root as above?
-
RE: Using multiple data sources in a single template?
I just wanted to update to say I think the problem must be in my template somewhere, and I don't know where. I copied the HTML out to a new template, didn't choose a data source and set the resources up the same way and it works. It seems that it didn't like having a data source chosen and then removed?