sforgelogin Posted September 13, 2006 Share Posted September 13, 2006 While working on a project I created a report template to be used with two slightly different versions of a database. In the report I used a query like: select a.* from table a this returned all the columns for this table, however I only used a few. In one version of the database there was an extra column that was not in the other version, however iReport does not refresh the xml when switching datasources, and I got an error stating that the column could not be found. I think that only putting the fields used in the actual report or refreshing the xml would be a great idea since this type of scenario seems fairly common. Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted September 13, 2006 Share Posted September 13, 2006 "select *" is never a safe (and good) approach. Select always only the fields your really need: this for two reasons:1. You are safe is a field you don't use in your report disappear from the table2. The engine reads only the really needed fields from the datasource, saving memory and time. Giulio Link to comment Share on other sites More sharing options...
dsachdev Posted September 13, 2006 Share Posted September 13, 2006 You may also need to uncheck: "Automatically retrieve fields" if you are bouncing back and forth between two databases that have differen schemas. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now