📄 doutputreport.cpp
字号:
// DOutPutReport.cpp: implementation of the CDOutPutReport class.
#include "stdafx.h"
#include "MyProject.h"
#include "DOutPutReport.h"
#include "ExternDllHeader.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
CDOutPutReport::CDOutPutReport()
{
}
CDOutPutReport::~CDOutPutReport()
{
}
void CDOutPutReport::OnButquery()
{
CString sSQL,sDate1,sDate2,sClew;
CTime date1,date2;
m_DtDate1.GetTime(date1);
m_DtDate2.GetTime(date2);
sDate1=CTimeToCString(date1);
sDate2=CTimeToCString(date2);
sSQL.Format("SELECT * FROM (SELECT c.名称, c.规格, c.产地, c.计量单位, sum(b.出库数量) AS 合计数量 FROM 出库记录表 a INNER JOIN 出库明细表 b ON a.出库票号 = b.出库票号 INNER JOIN 商品信息表 c ON b.商品条型码 = c.条形码 WHERE a.出库日期 BETWEEN '%s' AND '%s' GROUP BY c.名称, c.规格, c.产地, c.计量单位) DERIVEDTBL ORDER BY 合计数量 DESC",sDate1,sDate2);
rst.Open(sSQL,adCmdText);
this->DlgReport.m_Grid.DeleteAllItems();
this->DlgReport.m_Grid.AddCellValue(rst);
this->DlgChart.SetRecordset(rst);
}
void CDOutPutReport::Init()
{
this->SetWindowText("出库汇总报表");
this->m_StaClew.SetWindowText("出库日期");
CString sSQL;
sSQL.Format("SELECT * FROM (SELECT c.名称, c.规格, c.产地, c.计量单位, sum(b.出库数量) AS 合计数量 FROM 出库记录表 a INNER JOIN 出库明细表 b ON a.出库票号 = b.出库票号 INNER JOIN 商品信息表 c ON b.商品条型码 = c.条形码 GROUP BY c.名称, c.规格, c.产地, c.计量单位) DERIVEDTBL ORDER BY 合计数量 DESC");
rst.Open(sSQL,adCmdText);
this->DlgReport.SetRecordset(rst);
this->DlgChart.SetRecordset(rst);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -