cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal RDC - Subreports not counted in section

Former Member
0 Kudos

We are using craxdrt interface with C++ to run a Crystal Reports viewer. We are currently using CRXI but this was happening with CR 10. Years ago, our interface guru wrote ways to pass logon info to subreports. What the code did was to get the count of objects from an ISectionPtr and scan down till if found the crSubreportObject type object.

What was happening is that ISectionPtr::IReportObjectsPtr::GetCount() was was not counting the Subreport objects. If there were 5 field objects and a sub-report, it would return 5. If the section only contained a subreport object, it would return 0.

Here is a chunk of code:

ISectionPtr section = (*_m_pReport)->Sections->GetItem(sectionIdx);

IReportObjectsPtr pReportObjects = section->GetReportObjects();

long reportObjectsCount = pReportObjects->GetCount();

for (long idx = 1; idx <= reportObjectsCount; idx++) {

ReportObjectPtr pReportObject = pReportObjects->GetItem(idx);

if (pReportObject->GetKind() == crSubreportObject) {

// it's a subreport

ISubreportObjectPtr subReportObject = (ISubreportObjectPtr)pReportObject;

...anyway, this is where we put the login information bcause reportObjectsCount is 1 less than it should be, nothing happens to the subreport...

We have a workaround though -- but it is very strange. If we replace the Page Number special field in the page section with Page N of M, the count is correct!!

Is this a bug or is there something missing in that code to find the subreport?

Thanks,

-- John

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi John,

Moved your post to the Legacy SDK forum.

As you may have heard the RDC has now been completely deprecated, meaning it's not longer in a patchable life cycle. CR XI R2 ( version 11.5 ) ends support this summer.

I've never heard of this issue before.... Or at least I don't recall. Did you ever log a case with support to track the issue?

Only option now is you could upgrade to CR XI R2, version 11.5 and use your XI keycode, if it still fails then no other option but to move to VS .NET and use the CR for .NET assemblies.

We now have a full version of CR that integrates into VS 2010, only thing missing is crw32.exe ( external report Designer )

Thank you

Don

Answers (2)

Answers (2)

Former Member
0 Kudos

Forgot to mention... Half our development is on VS10 C# using XML datasource, so that is the direction we are migrating.

Former Member
0 Kudos

Thanks for your quick response, Don.

I knew this was legacy but I couldn't find the forum. Anyway, I know that we are using the RDC in a way noone else in the world is using. From the application level, all we saw was mysterious "Logon Failed" messages when selecting a page that ran the subreport. I am not sure how they discovered that adding the Page N of M field fixed that. It happened recently and I finally traced the inserting of the subreport info and discovered the GetCount() issue.

Since it is deprecated, it is moot now and, I am sure, is not worth investigation on your part. I will relay your upgrade information.

Thanks again,

-- John