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

Add possibility to process data from a datasource before generation starts. #1351

Open
MSDelorme opened this issue Jun 27, 2023 · 2 comments

Comments

@MSDelorme
Copy link

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:

  • output file name
  • output type
  • master page background image

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?

@MSDelorme
Copy link
Author

MSDelorme commented Jun 27, 2023

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.

@hvbtup
Copy link
Contributor

hvbtup commented Jun 27, 2023

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.

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

No branches or pull requests

2 participants