Hi guys,
I'm having huge troubles with an application that I've "inherited" from someone. All it does is open a crystal report and export it into a html file (well, that's what it's supposed to do). The code that I've got doesn't spit out any errors, but it doesn't actually export the file either. It doesn't produce any output at all. Here's what it looks like:
String strFileName = "c:\MyReport.rpt";
String strExportName = "c:\Output.html";
wchar_t *w_RptFile;
w_RptFile = StringToOleStr(strFileName);
//App1 is a TApp activex control from craxdrt.bpl
IReportPtr Rpt = App1->OpenReport(w_RptFile, 1);
Rpt->DiscardSavedData();
Rpt->ExportOptions->FormatType = crEFTHTML40;
Rpt->ExportOptions->DestinationType = crEDTDiskFile;
Rpt->ReadRecords();
w_RptFile = StringToOleStr(strExportName);
Rpt->ExportOptions->HTMLFileName = w_RptFile;
Rpt->Export(false);
Close();
Can anyone see what I might be missing? I've got all the required dlls as far as I can tell - when I open the report in crystal I am able to manually export it to html without any problems.
Regards,
Andrew
I'm having huge troubles with an application that I've "inherited" from someone. All it does is open a crystal report and export it into a html file (well, that's what it's supposed to do). The code that I've got doesn't spit out any errors, but it doesn't actually export the file either. It doesn't produce any output at all. Here's what it looks like:
String strFileName = "c:\MyReport.rpt";
String strExportName = "c:\Output.html";
wchar_t *w_RptFile;
w_RptFile = StringToOleStr(strFileName);
//App1 is a TApp activex control from craxdrt.bpl
IReportPtr Rpt = App1->OpenReport(w_RptFile, 1);
Rpt->DiscardSavedData();
Rpt->ExportOptions->FormatType = crEFTHTML40;
Rpt->ExportOptions->DestinationType = crEDTDiskFile;
Rpt->ReadRecords();
w_RptFile = StringToOleStr(strExportName);
Rpt->ExportOptions->HTMLFileName = w_RptFile;
Rpt->Export(false);
Close();
Can anyone see what I might be missing? I've got all the required dlls as far as I can tell - when I open the report in crystal I am able to manually export it to html without any problems.
Regards,
Andrew