Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
SQL
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:

C#
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());
        }
    }
Posted
Updated 17-Aug-14 23:39pm
v2

1 solution

I think you should create sub report for this. Please reffer the link

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900