FableBlaze
FableBlaze

Reputation: 1895

BIRT part of datasource as parameter

I have a birt report with a database url jdbc:postgresql://randomHost/randomName_2011 I have databases with exactly the same structure for other years. Only difference in the url is the year number.

Would it be possible to give the year number as a parameter when opening the report?

Upvotes: 2

Views: 1948

Answers (1)

jinowolski
jinowolski

Reputation: 2472

It is possible to set database url with "Property Binding".

  • Open your datasource definition
  • Go to "Property Binding"
  • Open Expression Builder for "JDBC Driver URL" field (button "f(x)" right of an input field)
  • Enter expression

    "jdbc:postgresql://randomHost/randomName_" + params["year"].value
    

Upvotes: 3

Related Questions