var OR dynamic data set OR?? [message #827131] |
Thu, 22 March 2012 19:35  |
Eclipse User |
|
|
|
Hi,
I am very new to BIRT and not sure how best to tackle what I need to do.
I need to take values entered in client and pass them to the server and subsequently the BIRT report.
I'm using a POJO:
public List<ReportRecord> getReportValues(String reportStartTime,
String reportEndTime)
{
List<ReportRecord> record = new ArrayList<ReportRecord>();
for (int i = 0; i < record.size(); i++)
{
ReportRecord reportRecord = new ReportRecord();
reportRecord.setReportStartTime(reportStartTime);
reportRecord.setReportEndTime(reportEndTime);
record.add(reportRecord);
}
return record;
}
My open script:
importPackage(Packages.com.reports.server);
count = 0;
// Create instance of
// the class
reportParams = new Packages.com.reports.server.ReportServiceImpl();
//Load the List
userParams = reportParams.getReportValues("Java", "Java");
My fetch:
if (count < userParams.size() )
{
var rtnString = userParams.get(count).getReportStart();
dataSetRow["Start Time:"] = rtnString;
var rtnStrng = userParams.get(count).getReportEndTime
dataSetRow["End Time:"] = rtnString;
count++;
return true;
}
return false;
My values make it to the server (tomcat) fine. However, the default value "Java" show up for both variable. Just to mention this, I am using two different data sets for the same report.
What am I missing?
|
|
|
|
|
|
|
|
|
Re: var OR dynamic data set OR?? [message #830743 is a reply to message #829616] |
Tue, 27 March 2012 22:26  |
Eclipse User |
|
|
|
What do you get when you change:
userParams = reportParams.getReportValues("Java");
to
userParams = reportParams.getReportValues("Java", "Java", "Java");
Jason
On 3/26/2012 10:57 AM, Kris Tannar wrote:
> Hi Jason,
> Went through another iteration making the changes you suggested; please
> see the open and fetch scripts below:
>
> open:
> importPackage(Packages.com.reports.server);
> count = 0;
>
> // Create instance of
> // Service class
>
> reportParams = new Packages.com.reports.server.ReportServiceImpl();
> //Load the List
>
> userParams = reportParams.getReportValues("Java");
>
>
> fetch:
> if (count < userParams.size() )
> {
> var rowdata = userParams.get(count);
>
> importPackage( Packages.java.io );
> out = new PrintWriter( new FileWriter( "c:/temp/Newfetchevents.txt",
> true ) );
> out.println( "row data " + rowdata);
> out.println( "firstCol " + rowdata.getEndUser());
> out.println( "secondCol " + rowdata.getReportStartTime());
> out.println( "ThirdCol " + rowdata.getReportEndTime());
> out.close();
>
> var rtnString = rowdata.getEndUser();
> dataSetRow["End User:"] = rtnString;
>
> var rtnString = rowdata.getReportStartTime();
> dataSetRow["Start Time:"] = rtnString;
>
> var rtnString = rowdata.getReportEndTime();
> dataSetRow["End Time:"] = rtnString;
>
> count++;
>
> return true;
> }
> return false;
>
> However, I receive a BIRT error:
> "Can't find method
> com.reports.server.ReportServiceImpl.getReportValues(string)" from the
> open script.
> This is understandable because the method signature in the script does
> not match the getReportValues(string, string string) signature.
>
> Can't seem to build my scripts properly to retrieve data from the user,
> place it into the report design at run time. What am I missing?
> Any help would be super appreciated!!
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.08150 seconds