Hi, I need to process variables from a template because I am asking the user for the values at execution time. When I call the "Run" method, the program throws an exception due to undefined variables.
The configuration sheet includes a column titled "Report Variables" (Column K), but I couldn't find a method or property to consult these variables in the template.
Is it possible to include these variables in an event of the report? In the meantime, what is the best event to include the variables when processing the template?
Hi Adrian, thanks for your response. My primary language is spanish ( i'm from Colombia).
For you response, i think that i have to implement an algorithm to process the variables in Config sheet in the "BeforeReadTemplate" event, and then prompt and set the value of each variable.
The class FlexCelReport has the events "UserTable" and "LocalTable" for add data on demand.
Is possible to add an to Flexcel event to add variables on demand? for set values when i need.
Hola Adrian, gracias por tu respuesta.
Por tu respuesta, pienso que me toca implementar un algoritmo para procesar las variables de la hoja de configuración en el evento "BeforeReadTemplate" para preguntar y poner el valor a cada variable.
La clase FlexcelReport tiene los eventos "UserTable" y "LocalTable" para añadir los datos en demanda.
¿Es posible agregar un evento para añadir las variables en demanda? Para poner los valores según el uso.
Entonces, si defines una UDF "Value" con un parametro que es el nombre de la variable, puedes escribir en la template:
<#value(valor1)>
<#value(valor2)>
Y la funcion sera llamada con el argumento "valor1" y "valor2" respectivamente. En ese momento puedes mostrar un dialogo al usuario y preguntar por el valor de la variable, y devolverlo en la UDF. Nota que si usas "valor1" mas de una vez, deberias guardar el valor para no preguntarlo 2 veces. (la segunda vez simplemente retornas lo que guardaste la primera vez)