Click here to Skip to main content
16,004,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What is the easyest way to get HTTP response header? Pin
George224-Oct-02 18:51
George224-Oct-02 18:51 
GeneralRe: What is the easyest way to get HTTP response header? Pin
Todd Smith25-Oct-02 6:47
Todd Smith25-Oct-02 6:47 
GeneralRichEdit Ctrl question. Pin
JohnnyG24-Oct-02 4:49
JohnnyG24-Oct-02 4:49 
GeneralCrystal Reports Pin
Ruca24-Oct-02 4:49
Ruca24-Oct-02 4:49 
GeneralRe: Crystal Reports Pin
Stephane Rodriguez.24-Oct-02 5:26
Stephane Rodriguez.24-Oct-02 5:26 
GeneralRe: Crystal Reports Pin
Patje24-Oct-02 5:46
Patje24-Oct-02 5:46 
GeneralRe: Crystal Reports Pin
Anonymous24-Oct-02 23:07
Anonymous24-Oct-02 23:07 
GeneralRe: Crystal Reports Pin
Patje25-Oct-02 0:34
Patje25-Oct-02 0:34 
I don't know anything about the CR that comes with VS.Net, but I assume that it's a kind 8.5.Net version, not the brand new CR 9.0.

We are using the CR ActiveX control by using the "AtlAxWin" control (part of ATL 3.0) and passing it

  • "CrystalReport.EmbeddableCrystalReportsDesignerCtrl.8.5" for the embeddable designer
  • "CRViewer.CRViewer.8.0" for the ActiveX viewer

Then use ATL::AtlAxGetControl to get the IUnknown interface of the ActiveX control hosted in the AtlAxWin control.
ATL::AtlAxGetControl (NativeWin, &UnknownInterface);

Then use IUnknownInterface->QueryInterface to get the interface to the CRVIEWERLib::ICrystalReportViewer4Ptr.
hr = UnknownInterface->QueryInterface (__uuidof(CRVIEWERLib::ICrystalReportViewer4),(void **)&CrystalReportViewer);
or for the designer:
hr = UnknownInterface->QueryInterface (__uuidof(CRDESIGNERCTRLLib::ICRDesignerCtrl),(void **)&CrystalReportDesigner);

Then simply use
CrystalReportViewer->ReportSource = MyReport
to set the report in the viewer (similar for the designer).

Don't forget to import the necessary type libraries:
#import "CRAXDDRT.tlb"            // The Crystal Reports designer run-time<br />
#import "CRAXDRT.tlb"             // The Crystal Reports non-designer run-time<br />
#import "crviewer.tlb"            // The Crystal Reports viewer component<br />
#import "CRDesignerCtrl.tlb"      // The Crystal Reports designer module


Also take a look at the generated .tli and .tlh files (by the #import). They're also very interesting if you want to know some of the more technical details.

Hope this helps (this was one of my first C++/COM projects, a real C++/COM guru might write this maybe a bit more efficient).



Enjoy life, this is not a rehearsal !!!
GeneralChanging ComboBox Color Pin
doctorpi24-Oct-02 4:35
doctorpi24-Oct-02 4:35 
GeneralRe: Changing ComboBox Color Pin
alex.barylski24-Oct-02 13:14
alex.barylski24-Oct-02 13:14 
GeneralRecieving rate of exchange for securitypapers from the internet Pin
tabor2524-Oct-02 4:31
tabor2524-Oct-02 4:31 
QuestionHow to calculate how much height and width a string will take in pixels for any font. Pin
Muhammad Kamran24-Oct-02 3:59
Muhammad Kamran24-Oct-02 3:59 
AnswerRe: How to calculate how much height and width a string will take in pixels for any font. Pin
User 665824-Oct-02 4:25
User 665824-Oct-02 4:25 
GeneralSetting the text size such that it fits with in a rectangle. Pin
Muhammad Kamran24-Oct-02 3:53
Muhammad Kamran24-Oct-02 3:53 
GeneralRe: Setting the text size such that it fits with in a rectangle. Pin
alex.barylski24-Oct-02 13:17
alex.barylski24-Oct-02 13:17 
QuestionHow can I make textlinks in my dialogs Pin
Ola Carlsson24-Oct-02 3:47
Ola Carlsson24-Oct-02 3:47 
AnswerRe: How can I make textlinks in my dialogs Pin
valikac24-Oct-02 10:10
valikac24-Oct-02 10:10 
AnswerRe: How can I make textlinks in my dialogs Pin
Roger Stewart24-Oct-02 10:34
professionalRoger Stewart24-Oct-02 10:34 
GeneralRe: How can I make textlinks in my dialogs Pin
Ola Carlsson24-Oct-02 12:53
Ola Carlsson24-Oct-02 12:53 
GeneralMFC vs. Standard C++ vs. C# Pin
Nick Parker24-Oct-02 3:31
protectorNick Parker24-Oct-02 3:31 
GeneralRe: MFC vs. Standard C++ vs. C# Pin
Mike Nordell24-Oct-02 3:40
Mike Nordell24-Oct-02 3:40 
GeneralRe: MFC vs. Standard C++ vs. C# Pin
Daniel Turini24-Oct-02 3:56
Daniel Turini24-Oct-02 3:56 
GeneralRe: MFC vs. Standard C++ vs. C# Pin
Nick Parker24-Oct-02 5:06
protectorNick Parker24-Oct-02 5:06 
GeneralRe: MFC vs. Standard C++ vs. C# Pin
Joe Woodbury24-Oct-02 7:02
professionalJoe Woodbury24-Oct-02 7:02 
GeneralRe: MFC vs. Standard C++ vs. C# Pin
Brian Delahunty24-Oct-02 7:07
Brian Delahunty24-Oct-02 7:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.