Click to See Complete Forum and Search --> : Crystal Reports View


Samantha
May 31st, 1999, 07:54 AM
How can I attach my crystal report view to the child window created in a mdi application.I am trying to place the window in the view area below the tool bar but it is not coming in that way...
is there anyway i can accomplish it.....pls..help me........urgent...

thanks

Masaaki
May 31st, 1999, 06:46 PM
Hi.

Today I checked the content of new book "Programming Windows 98 with
MFC second editon by Jeff Prosise" Microsoft Press.(p 1280?)

I found some clue for your desire. But I just did only SDI application. I use Calender 8.0 control.

int CTestView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here
m_calendar.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0,0,400,300),
this,IDC_CALENDAR, NULL);

return 0;
}

As Jeff's books,
1) Create dummy dialog.
2) Insert ActiveX control at dialog.
3) Generate new dialog class.
4) Copy and paster this from dialog class to CTestview.
BEGIN_EVENTSINK_MAP(CTestView, CView)
//{{AFX_EVENTSINK_MAP(CCalendarOleDlg)
ON_EVENT(CTestView, IDC_CALENDAR, -600 /* Click */, OnClick, VTS_NONE)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

5) Delete the dummy dialog and class.

Later, I try to do this on MDI. But don't trust me?

HTH.
-Masaaki Onishi-

David Langis
May 31st, 1999, 09:14 PM
The CRPE API always create its own view, you can't create a view yourself and attach it to the Report Job. In the API, there is two way of creating a view, one that creates the entire MDI window and the other one that creates only the view.

To attach the view to your own MDI window, use the API function that creates only the view. Create your MDI window and view yourself and the send the handle of the Crystal Report view to your MDI view.

Override OnSize to fit the crystal report view to your own view. That's not very nice but at least it works...