on 07-13-2011 7:23 AM
Hi All,
I am migrating our appn VC++ 6.0 code to VS 2010(MFC code compiled in VS2010). I could able to compile all the code in VS 2010 and i am created vb.net report application using crystalreport viewer, it working fine, afterthat i am converted vb.net code to C#.
My questions are,
1) how to add crystalreportviewer control in VC++ (searched not found) or alternative any control is available in vc++ using same c# code?
2) if its possible , to load rpt files without viewer control ? ,if yes, please provide me sample code.
Regards,
Esha Abdullah M
Hi Again Esha,
Why are you writing in VB and then converting to C#, would it not make more sense to just write in C#... but I don't want to know...
1. It's the same, add a form to your app and then add the viewer to the form. C# it looks like this and ONCE AGAIN GO TO OUR DOWNLOAD PAGE AND GET SOME OF THEM...
http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsSDKSampleApplications
rptClientDoc = rpt.ReportClientDocument;
crystalReportViewer1.ReportSource = rpt;
2. Don't set the report to the viewer, same as above:
#using "CrystalDecisions.CrystalReports.Engine.dll"
#using "CrystalDecisions.Shared.dll"
int main(int argc, char** argv)
{
CrystalDecisions::CrystalReports::Engine::ReportDocument^ reportDocument = gcnew CrystalDecisions::CrystalReports::Engine::ReportDocument();
reportDocument->FileName = ".//don.rpt";
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi DON,
Thanks for your reply..
i don't know, how to write in C# , so only i wrote in vb.net afterthat converted to C#..
THANK YOU VERY MUCH FOR YOUR SAMPLE CODE.
BUT MY DOUBT WAS, HOW TO ADD CRYSTALREPORTVIEWER CONTROL IN VC++ (MFC CODE COMPILED IN VS2010).
i added dialog form and searched tool box, i am only found crystal Activex report viewer 13.0, but Crystalreportviwer is not available,
PLEASE.... GUIDE ME.... HOW TO ADD CRYSTALREPORTVIEWER IN MY VC++ APPLICATION.
Thanks in Advance...........
Regard,
Esha Abdullah M
I found one, since you never looked, to get you going. It's written in C++, just change the assemblies to CR for VS 2010
General
Crystal Reports .NET - All Sample Applications
This set includes the following samples:
cr_net_sdk_tutorial_samples_en.zip
crsdk_net_samples_12.zip
NET-CPP2005_CRNET_CR115_Change_Record-Selection-Formula.zip
#using <C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.CrystalReports.Engine.dll>
#using <C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.Shared.dll>
#using <C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.Windows.Forms.dll>
And comment out the Page event, seems they don't work in 2010, we changed the event handler:
// this->crViewer->ClickPage += new CrystalDecisions::Windows::Forms::PageMouseEventHandler (this,&ViewForm::crystalReportViewer1_ClickPage);
// this->crViewer->DoubleClickPage += new CrystalDecisions::Windows::Forms::PageMouseEventHandler (this,&ViewForm::crystalReportViewer1_ClickPage);
Don
Edited by: Don Williams on Jul 13, 2011 9:05 AM
Hi DON,
Thanks you for your reply !
Have you given sample code and sample guide, I am successfully created Report Application in C#.
I think, I am in final Stage, how to mix VC++ code (MFC CODE COMPILED IN VS2010) to C# report application code?
Please help me..... This is my life first time, I am facing more difficulties ,
THIS WOULD HAVE BEEN NOT POSSIBLE WITHOUT YOUR HELP
PLEASE ...................HELP ME
Thanks in Advance !
Regards,
Esha Abdullah M
I don't have any examples but you can compile your C# app into a dll, you have to change your project or create a new one, and then you can pass the report object from your C++ app to the dll to process.
Lots of people do this so search Microsoft's site on how to call a managed dll from a C++ app.
Thanks
Don
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.