report.setName(new TranslatableMessage("common.copyPrefix", name).translate(getTranslations()));
report.setXid(Common.generateXid("REP_"));
DataPointDao dataPointDao = new DataPointDao();
for (int id : dataPointIds) {
DataPointVO dp = dataPointDao.getDataPoint(id);
if (dp == null || !Permissions.hasDataPointReadPermission(user, dp))
continue;
ReportPointVO rp = new ReportPointVO();
rp.setPointId(dp.getId());
rp.setPointKey("p" + dp.getId());
rp.setColour(dp.getChartColour());
rp.setConsolidatedChart(true);
rp.setPlotType(dp.getPlotType());
report.getPoints().add(rp);
}
return report;
}