Hi,
we use CR (with the old RDC activeX) for one of our native C++ applications. Since RDC is no longer supported we try to migrate to CR XI V4.
We've created a C# com library that hosts the report viewer control and call library functions via IDispatch methods.
When trying to load a report we get an C++ MalformedURLException
Testcode:
ReportDocument rd = new ReportDocument();
rd.Load(@"test.rpt"); // Throws exception
I was able to trace back this to a call into xerces-c_2_1_0.dll:
void XMLURL::parse(const XMLCh* const urlText)
{
// Simplify things by checking for the psycho scenarios first
if (!*urlText)
ThrowXML(MalformedURLException, XMLExcepts::URL_NoProtocolPresent);
//
// The first thing we will do is to check for a file name, so that
// we don't waste time thinking its a URL. If its in the form x:\
// or x:/ and x is an ASCII letter, then assume that's the deal.
//
if (((*urlText >= chLatin_A) && (*urlText <= chLatin_Z))
|| ((*urlText >= chLatin_a) && (*urlText <= chLatin_z)))
{
if (*(urlText + 1) == chColon)
{
if ((*(urlText + 2) == chForwardSlash)
|| (*(urlText + 2) == chBackSlash))
{
ThrowXML(MalformedURLException, XMLExcepts::URL_NoProtocolPresent);
}
}
}
urlText points to "C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\java\CRConfig.xml".This file doesn't exist and is invalid in above context.
The above sample works fine when using in a standard C# application.
Any ideas ?
Gunnar