Page 1 of 1
Mathematics on variables?
Posted: Tue Aug 11, 2015 6:54 am
by Atlas
Hi Guys,
I'm messing around with Flare for the first time and trying to do some mathematics (adding, subtracting, etc) on variables.
Google mentioned nothing about this. Is it even possible to do?
Cheers,
Alexander
Re: Mathematics on variables?
Posted: Tue Aug 11, 2015 8:30 am
by sarrants
What are you trying to accomplish?
Re: Mathematics on variables?
Posted: Tue Aug 11, 2015 7:01 pm
by doc_guy
Variables in Flare may not be exactly the same thing you're thinking of. If you think of it from a programming perspective, all Flare variables are string variables, not number variables, so you can't do any math with them in Flare. I suppose if you wanted to write some javascript to do that on the fly, you could parse out the text of the variable and do something with it, but I'm not sure why you would want to.
So, I'm with sarrants. What are you trying to do? Maybe there is a better way.
Re: Mathematics on variables?
Posted: Tue Aug 11, 2015 11:31 pm
by Atlas
Cheers for the reply guys!
What we want to achieve is a nice way to integrate documentation and customer quotes. So we want to involve some kind of pricing in Flare.
For example: we will have 4 variables for the cost prices of the products and 1 profit margin variable. cost price * profit margin = final customer price which needs to be displayed on the exported PDF.
Is this doable in Flare (withouth too much JS scripting), or do we need to look further?
Re: Mathematics on variables?
Posted: Wed Aug 12, 2015 5:43 am
by NorthEast
Atlas wrote:Cheers for the reply guys!
What we want to achieve is a nice way to integrate documentation and customer quotes. So we want to involve some kind of pricing in Flare.
For example: we will have 4 variables for the cost prices of the products and 1 profit margin variable. cost price * profit margin = final customer price which needs to be displayed on the exported PDF.
Is this doable in Flare (withouth too much JS scripting), or do we need to look further?
I'd say it's not doable within Flare itself.
Flare variables don't support calculations.
It also wouldn't be possible with Javascript, since that's for web-based scripting, and you wanted this for a PDF.
However, if you have Adobe Acrobat, I think it's possible to create PDFs that include forms which can handle calculations; e.g. you can fill in boxes and it calculates a result.
Perhaps you could create a PDF in Acrobat, that includes the section requiring the calculation, and then stitch that PDF into your Flare project.
Re: Mathematics on variables?
Posted: Wed Aug 12, 2015 5:48 am
by sarrants
Atlas wrote:Cheers for the reply guys!
What we want to achieve is a nice way to integrate documentation and customer quotes. So we want to involve some kind of pricing in Flare.
For example: we will have 4 variables for the cost prices of the products and 1 profit margin variable. cost price * profit margin = final customer price which needs to be displayed on the exported PDF.
Is this doable in Flare (withouth too much JS scripting), or do we need to look further?
No, you can't do this with Flare Variables. It is possible with JavaScript, but not for PDF. You can do this in Acrobat. I've seen and used PDFs that ask for information like this in dialogs when opening the document. But unless you're creating this documents more than a few times a week it probably makes more sense to just open the PDF and fill in the calculation areas.