You are not logged in.
Hi all,
I am looking for a software that could handle one of our requirements for the company: Dynamic Emails and Personalisation.
Basically what we want to achieve is that from utilizing one single report template, e.g. a sales summary report, the software will allow us to personalise it to the users so that they will only receive content relevant to them specifically.
Could ReportServer cater for this requirements and would there be a lot of effort involved?
Thanks.
Offline
Hi julian.hh,
what you describe is easily achievable with user variables, please check here:
"By applying user variables, the same report holds a different base data entirety for different users."
https://reportserver.net/en/guides/admi … Variables/
Regards,
Eduardo
Offline
Hi Eduardo,
Can the user variables be dynamically generated? I've played with the software for a few days, and only noticed that you could only pre-define the variables before the report sends out. What we want to achieve is to "scan" which salesperson has data within this report, then the software will dynamically send the report to them.
Thanks.
Offline
Hi julian.hh,
you can create a script report for this purpose. In this script, you can execute the "real" report and scan the results. Depending on the results, you can send the report to the people you need. More information on script reports here: https://reportserver.net/en/guides/scri … Reporting/
This is a code snippet (just to give you an idea of how to achieve this):
def report = reportService.getReportById 1234 // the id of the real report
def parameterSet = report.parameterInstances
parameterSet.each{ param -> // only necessary if you want to set a parameter in the report
def parameterName = param.definition.name
if ("P_CLIENTID" == parameterName)
param.value = 5678
}
// here you execute the real report
def tableModel = reportExec.execute report, "RS_TABLE", ReportExecutionConfig.EMPTY_CONFIG
// you fetch the table definition for being able to scan the results
def tableDefinition = tableModel.tableDefinition
def indexMyColumn = tableDefinition.originalColumnNames.indexOf "my_column" // you search for the index of my_column
def allData = tableModel.data
def data = allData[0] //here you only scan the first record. For all records, just make it a loop
def myColumnContent = data.row[indexMyColumn]
// now you can do whatever you need with the content of myColumnContent
Instead of scanning the table, though, it would be maybe better to write an sql statement that for each person returns a "1" or "0", depending if the report should be sent to them or not. Then, in the script report, just send the report to the people you have "1" as a result. In this way, the report and the condition would be separated, which may be a better design, since the condition and the report are independent of each other.
Regards,
Eduardo
Offline