#1 2016-07-23 12:08:18

mahesh
Member
Registered: 2016-07-16

Dynamic list datasource and cap size

Hi

i do like to get more knowledge on Dynamic lists and reporting capacity .

Do we have a option to create a Dynamic list based on XML datasource ?
what is the approach to localize reports (ex: Column headings)  ?



thanks

Last edited by mahesh (2016-07-24 11:17:08)

Offline

#2 2016-07-24 17:58:38

karolina
Member
Registered: 2014-08-09

Re: Dynamic list datasource and cap size

Hi,

XML datasource - you need to create a script datasource and then set is as your Dynamic List datasource. You'll find the details in the Script Guide: https://reportserver.net/en/guides/scri … tasources/

Cheers,
Karolina

Offline

#3 2016-07-24 19:30:13

karolina
Member
Registered: 2014-08-09

Re: Dynamic list datasource and cap size

As for localization of the Dynamic List:

One way would be to use metadata for this, as described in 6.2.4. section of the Admin guide, with a script datasource as the metadata datasource. The cache of the script datasource is set to 0.

The script gets the current locale of a logged-in user and, accordingly, sets the default column alias and description in a given language.

import net.datenwerke.rs.base.service.reportengines.table.output.object.RSTableModel
import net.datenwerke.rs.base.service.reportengines.table.output.object.RSTableRow
import net.datenwerke.rs.base.service.reportengines.table.output.object.TableDefinition
import net.datenwerke.rs.utils.localization.LocalizationServiceImpl

/* get locale */

LocalizationServiceImpl localizationService = GLOBALS.getInstance(LocalizationServiceImpl.class)

String locale = localizationService.getLocale().toString()

/* Making English the fallback locale */

if (locale != "pl"){
    locale = "en"
}

/* define the default aliases and decriptions in different languages */

List technicalColumnNames = ["col_a", "col_b", "col_c"]

Map aliases = ["en": ["Column 1", "Column 2", "Column 3"], "pl": ["Kolumna 1", "Kolumna 2", "Kolumna 3"]]

Map description = ["en": ["My first column", "My second column", "My third column"], "pl": ["Moja pierwsza kolumna",
    "Moja druga kolumna", "Moja trzecia kolumna"]]

/* create the datasource */

TableDefinition tableDefinition = [["column_name", "default_alias", "description"], [String.class, String.class, String.class]]

RSTableModel tableModel = new RSTableModel(tableDefinition)

/* add rows */

technicalColumnNames.eachWithIndex{name, i ->

    ArrayList rowData = [name, aliases[locale][i], description[locale][i]]

    RSTableRow row = new RSTableRow(tableDefinition, rowData)

    tableModel.addDataRow(row)
}

return tableModel

Hope it helps.
Karolina

Offline

#4 2019-06-04 13:23:38

Patryx
Member
Registered: 2019-03-25

Re: Dynamic list datasource and cap size

Hi,
Do you know how I can adapt parameters of reports? I mean name, description depending on language...
It seems to be an unsolvable problem in ReportServer which force you to create two different reports (and variants etc).

Offline

#5 2019-06-04 14:19:35

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Dynamic list datasource and cap size

Hi Patryx,

as I mentioned here: https://forum.reportserver.net/viewtopi … 5838#p5838
we have a ticket open for multilanguage parameters.

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB