private void CommanCallUserControl(DataSet ds, string reporttype)
    {
        GetConnectionStringSTRING obj = new GetConnectionStringSTRING();

        connectionstring = obj.BAL_EpathshalaString();



        try
        {
            ReportControl1.ConnectionString = connectionstring;


            //reporttype = Server.MapPath("Files/MonthlySummary.xml");
            ReportControl1.XMLReportFile = Server.MapPath(reporttype);

            ReportControl1.Search(ds.Tables[0]);
        }
        catch (Exception ex)
        {
            WebMsg.Show("" + ex.Message.ToString());
        }
    }
示例#2
0
    private void CommanCallUserControl(DataTable dt, string reporttype, int control)
    {
        GetConnectionStringSTRING obj = new GetConnectionStringSTRING();

        connectionstring = obj.BAL_EpathshalaString();



        try
        {
            if (control == 1)
            {
                ReportControl1.ConnectionString = connectionstring;


                //reporttype = Server.MapPath("Files/MonthlySummary.xml");
                ReportControl1.XMLReportFile = Server.MapPath(reporttype);

                ReportControl1.Search(dt);
            }
            else if (control == 2)
            {
                ReportControl2.ConnectionString = connectionstring;


                //reporttype = Server.MapPath("Files/MonthlySummary.xml");
                ReportControl2.XMLReportFile = Server.MapPath(reporttype);

                ReportControl2.Search(dt);
            }
            else if (control == 3)
            {
                //ReportControl3.ConnectionString = connectionstring;


                ////reporttype = Server.MapPath("../ReportXMLFiles/TeacherTrackRPTEmpWiseBMSSCT.xml");
                //ReportControl3.XMLReportFile = Server.MapPath(reporttype);

                //ReportControl3.Search(dt);

                StringBuilder ReportString = new StringBuilder();
                //Header

                //XML to Dataset
                DataSet xmllanguage = new DataSet();
                xmllanguage.ReadXml(Server.MapPath("../ReportXMLFiles/TeacherTrackRPTEmpWiseBMSSCT.xml"));
                //End XML to Dataset

                //HiddenFields list get
                List <string> HiddenFields;
                HiddenFields = GetHiddenFields();
                //End HiddenFields list get

                DataTable dtTableHeder = dt.DefaultView.ToTable(true, "SessionID");
                for (int i = 0; i < dtTableHeder.Rows.Count; i++)
                {
                    CreadeRowColumMainTable(ReportString);


                    //ReportString.Append(xmllanguage.Tables[Session["LANG"].ToString().ToLower()].Rows[0]["Session"].ToString()+" : "+dtTableHeder.Rows[i]["SessionID"].ToString());
                    ReportString.Append(xmllanguage.Tables[Session["Varnindra"].ToString().ToLower()].Rows[0]["Session"].ToString() + " : " + dtTableHeder.Rows[i]["SessionID"].ToString());
                    CloseTDTR(ReportString);

                    OpenTDTR(ReportString);
                    DataView dv1 = dt.DefaultView;
                    dv1.RowFilter = " SessionID = '" + dtTableHeder.Rows[i]["SessionID"].ToString() + "'";
                    DataTable dtNew = dv1.ToTable();



                    ReportString.Append("<table class=\"GridViewCss\" cellspacing=\"2\" cellpadding=\"2\" border=\"1\" style=\"border-width:1px;border-style:None;width:100%;\" rules=\"all\">");

                    ReportString.Append("<tr class=\"GridViewHeadercss\">");



                    for (int j = 0; j < dtNew.Columns.Count; j++)
                    {
                        if (HiddenFields != null)
                        {
                            foreach (string s in HiddenFields)
                            {
                                if (dtNew.Columns[j].ToString().ToLower() != s.ToLower())
                                {
                                    string Columen = dtNew.Columns[j].ToString().Trim().Replace(" ", "");
                                    string str     = xmllanguage.Tables[Session["Varnindra"].ToString().ToLower()].Rows[0][Columen].ToString();
                                    ReportString.Append("<th scope=\"col\">" + str + "</th>");

                                    break;
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                    }
                    ReportString.Append("</tr>");
                    for (int ij = 0; ij < dtNew.Rows.Count; ij++)
                    {
                        ReportString.Append("<tr class=\"GridViewItem\">");
                        for (int ro = 0; ro < dtNew.Columns.Count; ro++)
                        {
                            if (HiddenFields != null)
                            {
                                foreach (string s in HiddenFields)
                                {
                                    if (dtNew.Columns[ro].ToString().ToLower() != s.ToLower())
                                    {
                                        ReportString.Append("<td>" + dtNew.Rows[ij][ro].ToString() + "</td>"); break;
                                    }
                                    else
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                        ReportString.Append("</tr>");
                    }
                    ReportString.Append("</table>");

                    CloseRowColumnMainTable(ReportString);
                }

                div1.InnerHtml = ReportString.ToString();
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show("" + ex.Message.ToString());
        }
    }