水晶报表生成中的错误 [英] Error In Crystal Report Generation

查看:92
本文介绍了水晶报表生成中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我有一个Web表单,可在其中从不同的选项生成报告,例如按部门,日期或项目名称获取报告.我正在生成带有存储过程的水晶报表.但是,当我从下拉列表中选择任何选项时(例如,如果我选择了计算机部门.),水晶报表必须仅显示计算机部门的数据),但它显示所有部门.数据,就像其他选项一样.存储过程中有些错误,但我没有得到.如何获得相关选项的报告?

预先存储的程序在这里:


Hello All,
I have a webform from where I am generating reports from different options like getting reports by department wise, date wise or by item name wise. I am generating crystal report with stored procedure. But when I select any option from drop-downs(like if I have selected computer deptt.) the crystal report have to show data of computer deptt only) but it shows all deptt. data, same is like with other options. There is something error in stored procedure, but I am not getting that. How to get report of related options?

Htored procedure is here:


ALTER PROCEDURE Test
(
@id as int,
@itemid as int,
@date as datetime
)
As
begin
select it.Item_Allot_Date,it.Item_Allot_Id,it.Item_Allot_Desc,
it.Item_Alloted_Unit,dep.Dept_Name,st.Item_Id,
st.Store_Item_Name,st.Store_Item_Desc,
st.Store_Item_Unit,st.Store_Purchased_Unit,
st.Store_Item_Cost,st.Store_Item_TotalCost,
st.Stroe_Item_Remaining_Unit from sss_store_alloted_items as it 
left join sss_sub_dept_master as dep on it.Item_Allot_Dep_Id=dep.Dept_ID
left join sss_store_items as st on it.Item_Allot_Item_Id=st.Item_Id
end
Begin
          If (@id>0 and @itemid=0)
              Begin
                       select it.Item_Allot_Date,it.Item_Allot_Id,it.Item_Allot_Desc,
it.Item_Alloted_Unit,dep.Dept_Name,st.Item_Id,
st.Store_Item_Name,st.Store_Item_Desc,
st.Store_Item_Unit,st.Store_Purchased_Unit,
st.Store_Item_Cost,st.Store_Item_TotalCost,
st.Stroe_Item_Remaining_Unit from sss_store_alloted_items as it 
left join sss_sub_dept_master as dep on it.Item_Allot_Dep_Id=dep.Dept_ID
left join sss_store_items as st on it.Item_Allot_Item_Id=st.Item_Id
where it.Item_Allot_Dep_Id=@id 
             End
         Else if(@id>0 and @itemid>0)
              Begin
                        select it.Item_Allot_Date,it.Item_Allot_Id,it.Item_Allot_Desc,
it.Item_Alloted_Unit,dep.Dept_Name,st.Item_Id,
st.Store_Item_Name,st.Store_Item_Desc,
st.Store_Item_Unit,st.Store_Purchased_Unit,
st.Store_Item_Cost,st.Store_Item_TotalCost,
st.Stroe_Item_Remaining_Unit from sss_store_alloted_items as it 
left join sss_sub_dept_master as dep on it.Item_Allot_Dep_Id=dep.Dept_ID
left join sss_store_items as st on it.Item_Allot_Item_Id=st.Item_Id
where it.Item_Allot_Dep_Id=@id or st.Item_Id=@itemid 
              End
              else
              if(@id>0 and @itemid>0 and @date>0)
              begin
              select it.Item_Allot_Date,it.Item_Allot_Id,it.Item_Allot_Desc,
it.Item_Alloted_Unit,dep.Dept_Name,st.Item_Id,
st.Store_Item_Name,st.Store_Item_Desc,
st.Store_Item_Unit,st.Store_Purchased_Unit,
st.Store_Item_Cost,st.Store_Item_TotalCost,
st.Stroe_Item_Remaining_Unit from sss_store_alloted_items as it 
left join sss_sub_dept_master as dep on it.Item_Allot_Dep_Id=dep.Dept_ID
left join sss_store_items as st on it.Item_Allot_Item_Id=st.Item_Id
where it.Item_Allot_Dep_Id=@id or st.Item_Id=@itemid or it.Item_Allot_Date=@date

              end
              
end
return




仅在一次我传递一个参数,然后将零值传递给前端的其他参数.




Only at a time I am passing one parameter and I am putting zero values to other parametres in front end.

推荐答案

亲爱的amit

数据库的第一个输出用于Crystal Report.

Dear amit

The first output from database is used in Crystal Report.

begin
select it.Item_Allot_Date,it.Item_Allot_Id,it.Item_Allot_Desc,
it.Item_Alloted_Unit,dep.Dept_Name,st.Item_Id,
st.Store_Item_Name,st.Store_Item_Desc,
st.Store_Item_Unit,st.Store_Purchased_Unit,
st.Store_Item_Cost,st.Store_Item_TotalCost,
st.Stroe_Item_Remaining_Unit from sss_store_alloted_items as it 
left join sss_sub_dept_master as dep on it.Item_Allot_Dep_Id=dep.Dept_ID
left join sss_store_items as st on it.Item_Allot_Item_Id=st.Item_Id
end


上面的代码返回所有值,因此,水晶报表将显示所有值

确保仅从SQL过程返回所需的输出


the above code returns all the values hence, the crystal report shows up all the values

Ensure that, the required output is only returned from the SQL Procedure


这篇关于水晶报表生成中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆