没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
目录
1
写存储过程,并在
UFData
库执行
................................................................................................
2
2
新建报表
.........................................................................................................................................
3
3
数据权限控制
...............................................................................................................................
10
4
过滤条件支持多选
.......................................................................................................................
11
5
过滤条件支持自定义枚举
...........................................................................................................
12
6
过滤条件支持系统枚举
...............................................................................................................
13
1
写存储过程,并在
UFData
库执行
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[LJYC_SaleOrderReport_Pro]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[LJYC_SaleOrderReport_Pro]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[LJYC_SaleOrderReport_Pro]
@cStartTime varchar(20) = '1900-01-01', --开始日期
@cStopTime varchar(20) = '1900-01-01',--结束日期
@IsClose varchar(20) = '-1',--是否已关闭,全部,是,否
@cCusCode varchar(2000) = '-1'--客户
as
begin
declare @esql varchar(8000)
declare @iwhere varchar(2000) --过滤条件
declare @dStartTime datetime
declare @dStopTime datetime
declare @cPStartTime varchar(255)
declare @cPStopTime varchar(255)
set @cCusCode = replace(@cCusCode,char(9),''',''')
set @iwhere = ' 1=1'
set @cPStartTime = @cStartTime
set @cPStopTime = @cStopTime
set @dStartTime = cast(@cStartTime as datetime)
set @dStopTime = cast(@cStopTime as datetime)
set @dStopTime = DATEADD(hour,24,@dStopTime)
set @dStopTime = DATEADD(Second,-1,@dStopTime)
set @cStartTime = CONVERT(varchar(100), @dStartTime, 20)
set @cStopTime = CONVERT(varchar(100), @dStopTime, 20)
--过滤条件
if @cCusCode!='-1' and @cCusCode!=''
begin
set @iwhere = @iwhere + ' and isnull(A.cCusCode,'''') in ('''+@cCusCode+''')'
end
if @cPStartTime!='1900-01-01'
set @iwhere = @iwhere+' and dDate>='''+@cStartTime+''''
if @cPStopTime!='1900-01-01'
set @iwhere = @iwhere+' and dDate<='''+@cStopTime+''''
if @IsClose = '是'
begin
set @iwhere = @iwhere + ' and isnull(cCloser,'''')!='''' '
end
if @IsClose = '否'
begin
set @iwhere = @iwhere + ' and isnull(cCloser,'''')='''' '
end
set @esql = 'SELECT A.cSOCode AS 单据号,CONVERT(VARCHAR(100),A.dDate,23) AS 单据日
期,A.cCusCode AS 客户编码,CT.cCusName AS ccusname,B.cInvCode AS 存货编码,I.cInvName AS
存货名称,CONVERT(DECIMAL(18,2),B.iQuantity) AS 数量 FROM dbo.SO_SOMain A INNER JOIN
dbo.SO_SODetails B ON A.ID = B.ID LEFT JOIN dbo.Customer CT ON A.cCusCode = CT.cCusCode LEFT
JOIN dbo.Inventory I ON B.cInvCode = I.cInvCode where ' + @iwhere
exec(@esql)
end
GO
2 新建报表
剩余14页未读,继续阅读
资源评论
maybecrazy14
- 粉丝: 1
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功