Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional sections #9

Closed
smbatpetrosyan opened this issue Feb 23, 2018 · 21 comments
Closed

Conditional sections #9

smbatpetrosyan opened this issue Feb 23, 2018 · 21 comments

Comments

@smbatpetrosyan
Copy link

smbatpetrosyan commented Feb 23, 2018

Is there a possibility to construct the template so that some of text sections are included selectively (conditionally).

@smbatpetrosyan smbatpetrosyan changed the title Is there a possibility to construct the template so that some of text sections are included selectively (conditionally) Conditional sections Feb 23, 2018
@anthonywebb
Copy link

I suppose you could store the text in your JSON and conditionally include or not include it in your JSON @smbatpetrosyan

@bip91
Copy link

bip91 commented Aug 28, 2018

I have the same request to include conditionnally large piece of text.
As conditonnal content is managed by end-user, inclusion in template seems the best approach.

@dgrelaud
Copy link
Member

If the text is in JSON, it can be done with ifEqual.
But if the text is in the document itself, there is no solution for now.

We will find a solution and it will be in the community edition of Carbone ;)

@robotoni
Copy link

I am also interested in conditional text, tables, sections, images in the document itself.

Do you have a time line, when it will be implemented?

Thanks in advance.

@willemevenwel
Copy link

If the text is in JSON, it can be done with ifEqual.
But if the text is in the document itself, there is no solution for now.

We will find a solution and it will be in the community edition of Carbone ;)

Congratulations on a great solution. Any idea if this is due soon?

@viincenb
Copy link
Contributor

We will try to publish something to answer your needs about conditional sections within the year. We can't give you a publishing date or even a month due to other priorities that we have, however we can tell you that we will spend more time on Carbone from april 😄

Thank you for your interest in Carbone, this is motivating 😉

@KAVA-Leigh
Copy link

Any update on when this one might be available? unfortunately this is a deal breaker for us at the moment, but really keen to use Carbone as a replacement of a current solution, looking great so far.

@viincenb
Copy link
Contributor

viincenb commented May 22, 2019

We're currently working on a new Studio with new pricing/solutions and high-available render API in order to provide a fully functional solution for enterprise needs. We want to develop a robust SaaS and then focus more on Carbone itself, answer your needs. Also, we're improving the dynamic pictures handling (and add the possibility to put a picture as base64 in the data instead of a public url).
So, no conditional sections for now 😕 but we don't forget you 😉

@chuchiperriman
Copy link

Well, I've tried to create a document with:

  • Added variable to the document: hide_section = {d.hide_section}
  • Section with a hide condition: hide_section == "hide"

Then I create the json with hide_section = "hide" and merge the document with it.

When I open de document, the section is visible but if I press F9 (refresh fields), the section is hidden automatically.

Is there any option to automatically refresh fields when a odt document is open? If yes, we could use this technique to hide sections very easy.

@steevepay steevepay added P: High S: on hold The issue is on hold until further notice T: Feature A new feature labels Oct 7, 2019
@steevepay
Copy link
Member

This issue is one of the most important feature requested from the community.
Conditional sections is a different logic in contrast to the carbone substitution logic.
Right now, we are investigating some solutions, we will give you updates.

@willemevenwel
Copy link

Any feedback on conditional sections yet?

@leandro-almeida
Copy link

This feature would be very nice, a game changer for carbone. And after that, subreports to include in a document also would be fantastic! Do you have any idea when this issue will be available? Thanks for this awesome project and for sharing it!

@steevepay
Copy link
Member

Hi @leandro-almeida, the team focus on shipping a new version of Carbone planned for the past month, we're running a behind schedule. We have rewritten some part to improve and include new features. Conditional sections POC is in stand by for the moment.

@steevepay
Copy link
Member

The team and I are happy to announce to you that the "if block" works in real test cases!
conditionalBlock
Now, we need to clean up the code and add some documentation. This feature will be available this week (maybe tomorrow). I will let you know.

@steevepay steevepay added S: work in progress and removed S: on hold The issue is on hold until further notice labels May 11, 2020
@willemevenwel
Copy link

willemevenwel commented May 11, 2020 via email

@dgrelaud
Copy link
Member

Will it be released in the opensource library aswell?

Yes it will be open source.

@leandro-almeida
Copy link

You are awesome!!!!

@dgrelaud
Copy link
Member

Thank you. It will be even better than I thought!
For example, you can do complex conditions with new conditional formatters in v2.0:

{d.car:ifEQ('delorean'):and(.speed):ifGT(80):showBegin}

Travel in time (Block to hide or show)

{d.car:showEnd}

We are merging everything together and this new version will be public in few hours ;)

@willemevenwel
Copy link

willemevenwel commented May 13, 2020 via email

@steevepay
Copy link
Member

We have published a v2 branch with conditional sections, new formatters, variables into formatters, and many more... For the moment, the documentation is not up to date but the changes are available on the changlog with examples.
It is also available on NPM: npm install carbone@2.0.0-beta.0

@steevepay
Copy link
Member

It is available on the latest release 2.0.0, I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests