Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal reports 2008 RAS and ttx files

Status
Not open for further replies.

Havenotaclue

Programmer
Jan 30, 2009
1
SE
I have a rather complex report with about 20 subreports. The main report has a dataSource to a regular MS database and the subreports varies bewteen MS database and ttx files.

The report works fine as long as I don't try to set anything in the ttx subreports. But as soon as I try to do that I get the "Invalid subreport name"

I have followed the thread "thread149-679644" without luck.

The report is made in CR9 and we have done no changes - but have tried anything in order the get it to work with the same result...

In a dummy report made by scratch I can use the same ttx files and get it to work, but in this particular report it does not work.


Heres the pojo method we use:

private static void passPOJO(ReportClientDocument clientDoc,
ReportPojoHolder pojoHolder, String reportName, Tables tables)
throws ReportSDKException,ClassNotFoundException {

//Its a pojo data source, but it's nothing in it
if (pojoHolder.getPojos().size() == 0) {
return;
}

String reportTable = pojoHolder.getTableName();
Object pojo = pojoHolder.getPojos().iterator().next();

POJOResultSetFactory factory = new POJOResultSetFactory(pojo.getClass());
POJOResultSet resultSet = factory.createResultSet(pojoHolder.getPojos());


if(reportName == null || reportName.equals("")) {
clientDoc.getDatabaseController().setDataSource(resultSet, reportTable, reportTable);
}

else {

System.err.println("Setting data in pojo " + pojoHolder.getTableName() + ", pojo: " + reportName);

clientDoc.getSubreportController().getSubreport(reportName).
getDatabaseController().setDataSource(resultSet, pojoHolder.getTableName(), pojoHolder.getTableName());

}

Does anyone have anything inorder to help getting further. I'm starting to get quite frustrated.

Regards Patrik

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top