Fix Metric find_all_by_range query

The Metric::Finders.find_all_by_range method attempted to build a query that
can find different metrics records for a list of resources.  However, when
presented with a list of disparate resource types, this query builder would
build an invalid query.  For instance when presented with "VmOrTemplate" and
"Storage" resource types, the query would look something like:

  SELECT "metrics".* FROM "metrics"
  WHERE (timestamp = '2014-09-04T15:00:00Z'
  AND   (resource_type = 'VmOrTemplate' AND resource_id IN ( ... ))
  AND   (resource_type = 'Storage' AND resource_id IN ( ... )))

The problem with this query is that a single metrics record cannot belong to
both a "VmOrTemplate" as well as a "Storage" resource type.

To fix this, the resource type condition was changed to join using an "OR"
operator.

https://bugzilla.redhat.com/show_bug.cgi?id=1138442
Merge pull request #509 from blomquisg/bz1125455-datastore-summary-metrics

Process derived storage cap&u fields
Set @report value based on session[:rpt_task_id] or [:report_result_id]

While downloading a PDF for Timelines, @report is nil causing a crash,
which has been fixed.

https://bugzilla.redhat.com/show_bug.cgi?id=1138829
Merge pull request #511 from AparnaKarve/bz1138829_render_pdf_fix_for_timelines

Fixed crash while downloading PDF for Timelines