为报告创建报告 [英] Creating a report for report

查看:57
本文介绍了为报告创建报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了RDLC报告,显示投诉并有专栏,



ID,ReceivingDate,Message,Is reply



现在它可以工作,但问题是,如果针对每一行,我可能想要打开一份详细的报告。就像任何行的回复是(1),然后我应该单击是,它可能会在查看器中加载一个可能包含1行或更多行的新报表。我不知道怎么办?



Sql查询:

i have developed RDLC report which displays complaint and has columns,

ID, ReceivingDate, Message, Is reply

now it works but problem is that if against each row i may want to open a detailed report. Like if Is Reply of any row is Yes (1), then i should click yes and it might load a new report in viewer which might contain 1 or more rows. i don't know how ?

Sql Query:

Alter PROCEDURE [dbo].[Report_SearchSmsComplaints_RepliesBySmsID_Sp]

    @ParentSmsID int

AS
BEGIN

   Begin Try

    If exists(select * from SdpoReplies_SmsComplaints where ParentSmsID = @ParentSmsID)
    Begin
     SELECT [ID],
       CONVERT(VARCHAR(12), ReceivedMessages.ReceivedDateTime, 113) as ReceivingDate
      ,[FromMobileNo]
      ,[Message]
      ,IsReply_Sdpo = 1
      FROM [CmsSMSDb].[dbo].[ReceivedMessages] where ReceivedMessages.ID = @ParentSmsID
    End
    Else
    Begin
     SELECT [ID],
       CONVERT(VARCHAR(12), ReceivedMessages.ReceivedDateTime, 113) as ReceivingDate
      ,[FromMobileNo]
      ,[Message]
      ,IsReply_Sdpo = 0
      FROM [CmsSMSDb].[dbo].[ReceivedMessages] where ReceivedMessages.ID = @ParentSmsID
    End
   End Try 
   Begin catch
    Select ERROR_MESSAGE() as ErrMsg
   End Catch

END





.cs:





.cs:

protected void btnGenReport_Click(object sender, EventArgs e)
    {
        //This Event Generates Report of Complaints Between Specific Dates.

        try
        {
            DataSet dss = (DataSet)Session["UserData"];
            int UserID = Convert.ToInt32(dss.Tables[0].Rows[0][3].ToString());
            int DesigID = Convert.ToInt32(dss.Tables[0].Rows[0][4].ToString());

            MyComplaints obj = new MyComplaints();
            ReportViewer1.ProcessingMode = ProcessingMode.Local;
            ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Reports/Report_GetSmsComplaints_Replies.rdlc");
            int SmsID = Convert.ToInt32(txtSmsID.Text);
            DataTable dt = ManageRecievedMessage.Report_GetSmsComplaints_RepliesBySmsID(SmsID);

            if (dt.Rows.Count <= 0)
            {
                HiddenFieldSetMessage.Value = "WrongDatesComb";
                HiddenFieldShowMessage.Value = "True";
                ReportViewer1.Visible = false;
            }
            else
            {
                ReportDataSource rpds = new ReportDataSource("DataSet1", dt);
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(rpds);
                ReportViewer1.Visible = true;
            }

        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.ToString());
        }
    }

推荐答案

我认为你应该为此创建子报告。请提供链接



http://shahfaisalmuhammed.blogspot.com/2011/10/building-subreport-in-reporting.html [ ^ ]
I think you should create sub report for this. Please reffer the link

http://shahfaisalmuhammed.blogspot.com/2011/10/building-subreport-in-reporting.html[^]


这篇关于为报告创建报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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