关于报表初始化的问题
无来 2006-10-12 04:09:31 现在想对一些数据生成报表,使用File/Open打开文件后,把文件处理然后生成报表
希望点击“report”按钮后能够根据数据生成曲线图
现在的问题是。按钮映射的函数在CGrDemoApp文件中如下:
void CGrDemoApp::OnViewLinesframe()
{
POSITION curTemplatePos = GetFirstDocTemplatePosition();
while(curTemplatePos != NULL)
{
CDocTemplate* curTemplate =
GetNextDocTemplate(curTemplatePos);
CString str;
curTemplate->GetDocString(str, CDocTemplate::docName);
if(str == _T("GrDemo"))
{
curTemplate->OpenDocumentFile(NULL);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return;
}
}
AfxMessageBox("Can not create the lines frame window!");
}
上面的代码中,OpenDocumentFile函数调用后生成新的CGrDemoDoc对象(class CGrDemoDoc : public CDocument),我在CGrDemoDoc中添加了一些自己的变量,怎么样初始化这些变量?然后再生成CGrDemoView的调用?