📄 dinputreport.cpp
字号:
// DInPutReport.cpp: implementation of the CDInPutReport class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MyProject.h"
#include "DInPutReport.h"
#include "ExternDllHeader.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CDInPutReport::CDInPutReport()
{
}
CDInPutReport::~CDInPutReport()
{
}
void CDInPutReport::Init()
{
this->SetWindowText("商品入库排行分析");
this->m_StaClew.SetWindowText("入库日期");
CString sSQL;
sSQL.Format("SELECT * FROM (\
SELECT 名称,规格,产地,计量单位,SUM(数量) AS 合计数量 FROM(\
SELECT b.名称,b.规格,b.产地,b.计量单位 ,a.入库数量 AS 数量 FROM 入库明细表 a inner JOIN 商品信息表 b on a.商品条型码=b.条形码) DERIVEDTBL\
GROUP BY 名称,规格,产地,计量单位)DERIVEDTBL\
ORDER BY 合计数量 DESC");
rst.Open(sSQL,adCmdText);
this->Invalidate();
this->DlgReport.SetRecordset(rst);
this->DlgChart.SetRecordset(rst);
}
void CDInPutReport::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 名称,规格,产地,计量单位,SUM(数量) AS 合计数量 FROM(\
SELECT b.名称,b.规格,b.产地,b.计量单位 ,a.入库数量 AS 数量 FROM 入库明细表 a inner JOIN 商品信息表 b on a.商品条型码=b.条形码 inner join 入库记录表 AS c on a.入库票号=c.入库票号 WHERE c.入库日期 BETWEEN '%s' AND '%s') DERIVEDTBL\
GROUP BY 名称,规格,产地,计量单位)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);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -