Open MSDelorme opened 1 year ago
In addition, for some things you can make a working around (not the once mention in my first message). Adding a grid , connect to a data source and hide this element. This is however not a very elegant solution IMHO. In general I would say that is very useful to able able to determine variables based on a data source without having to add items to a designs body and that it is executed before generation is started.
I don't have a solution, but I have to admit this is an interesting question. I was in the same situation several times.
I would say that for most things you can use the workaround you mentioned (with a hidden layout element bound to a data set), and I think that this workaround is pretty reasonable. I tend to use red font color to mark these "logic in the layout" and our reports usually don't output red text, so the developer sees immediately that some logic is happening here.
This workaround doesn't work in all cases. E.g. once I wanted to modify and populate a grid (including removing columns etc), with input coming from the DB. I was able to use the DE API to basically clone the existing Data Source and create a Data Set in the beforeFactory(?) event of the report, but while I was able to create a connection, I was not able to read the report parameter values. I remember that I thought: If only there was a way to open and execute a data set from Javascript within the report (at a stage where I also can access the report parameters).
So I'm +1 for adding such an API. But I'm not able to provide it myself.
There are quite some use-cases where you want to be able to determine certain properties of the output based on information from a data source. A number of things are processed before a connection with data-source is established. Some examples:
The only possibility to get data from a data source earlier in the process, is using a dynamic parameter. However when the runtime engine is used this is not a viable way.
Would it be possible to have some init process step where you can connect a data-source to determine these kind of things?