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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report generator for Visual C++

Status
Not open for further replies.

Warrioruw

Programmer
Jan 30, 2004
24
CA
Hi, I am searching a third-party report generating software that can be integrated with a VC++ written software we have. The report generator must be able to employ Table, Graph(just like Excel), Bitmap, Text. If anyone knows this stuff, please help.
 
I believe there is no problem just to use Excel.Sheet and Excel.Chart COM objects. All you should know is ActiveX.

Ion Filipski
1c.bmp
 
Thx for the reply. I visited Crystal Report website, and it seems like CR can only be integrated with .NET, Java, and COM applications. I am not sure whether it is applicable to Visual C++. Also, I wanna minimize the cost of our VC++ software, so using a whole version of CR may not be possible. Any idea would be appreciated.
 
That is true partially.
In .NET , Crystal Reports is the standard and it is integrated as a control in the ToolBox.
The CR is working very well with Visual C++ before .NET working in .NET and Java.
There are many ways to use it is C++.
One way is to design your reports using CR standalone and store the reports in .rpt files.
An .rpt file encapsulates everything about report: layout, database, database connection, SQL queries etc...
At run time in your C++ application , only you have to use CR API functions to execute the .rpt files which means: connect with database, generate the report in the background if you want and print it also in background or view it.
CString csPathToRPT = "myreport.rpt";


typedef UINT (CALLBACK* LPFNPEOpenEngine)();
typedef UINT (CALLBACK* LPFNPEOpenPrintJob)(char *reportFilePath);
//

LPFNPEOpenEngine lpfnPEOpenEngine;
LPFNPEOpenPrintJob lpfnPEOpenPrintJob;
LPFNPECloseEngine lpfnPECloseEngine;
HINSTANCE hDLL = (HINSTANCE)::LoadLibrary( "CRPE32.DLL" );
if ( (UINT)hDLL >= (UINT)HINSTANCE_ERROR )
{
lpfnPEOpenEngine = (LPFNPEOpenEngine)GetProcAddress(hDLL, "PEOpenEngine");
if ( lpfnPEOpenEngine() )
{
// Print or view the report
lpfnPEOpenPrintJob = (LPFNPEOpenPrintJob)GetProcAddress(hDLL, "PEOpenPrintJob");
Job = lpfnPEOpenPrintJob((char *)LPCTSTR(csPathToRPT));
}
}
and so on.

-obislavu-

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top