Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, March 2007
Crystal Reports ActiveX component questions


Message 1 in thread

Hi,

I've been experimenting with the Crystal Reports COM engine and I've
almost succeeded in creating a small Qt4 app that uses the COM object.
I'm running into a problem using ActiveX widgets along with COM modules.
The following snippet shows the code to connect the two:

// Create a CR10 application component
crApp		= new QAxObject( (QObject *)0);
crApp->setControl("CrystalRuntime.Application");

// trap exceptions
connect(crApp, SIGNAL(exception(int, const QString &, const QString &,
const QString &)), this, SLOT(exception(int, const QString &, const
QString &, const QString &)));

// Create a CR10 report component
crReport	= crApp->querySubObject("OpenReport(QString, QVariant)",
"D:\\mcmain\\smc2007\\Data\\wokosten.rpt", 0);
// trap exceptions
connect(crReport, SIGNAL(exception(int, const QString &, const QString
&, const QString &)), this, SLOT(exception(int, const QString &, const
QString &, const QString &)));

// Use a Ax widget from the designer file (set to CR10 ActiveX viewer)
// trap exceptions
connect(ui.axWidget, SIGNAL(exception(int, const QString &, const
QString &, const QString &)), this, SLOT(exception(int, const QString &,
const QString &, const QString &)));

// link widget source to report component
ui.axWidget->dynamicCall("SetReportSource(IUnknown*)", crReport-
>asVariant());

// view report output
ui.axWidget->dynamicCall("ViewReport()");

The widget with the CR10 viewer appears, but no report output is
visible. No exceptions are trapped. Does anybody have any ideas what
I've done wrong or know where to look for hints?

I'm using Qt4.2 under MSWinXP/VS2005

Frank Tiekink

--
 [ signature omitted ]