Ejemplo n.º 1
0
    protected void click_print(object sender, EventArgs e)
    {
        {
            try
            {
                grid();
                if (f_date.Text != "" && t_date.Text != "")
                {
                    //Path
                    if (f_date.Text != "")
                    {
                        string   fdate = f_date.Text;
                        DateTime ft    = DateTime.ParseExact(fdate, "dd/mm/yyyy", CultureInfo.InvariantCulture);
                        fmdate = ft.ToString("yyyy-mm-dd");
                    }
                    if (t_date.Text != "")
                    {
                        string   tdate = t_date.Text;
                        DateTime tt    = DateTime.ParseExact(tdate, "dd/mm/yyyy", CultureInfo.InvariantCulture);
                        tmdate = tt.ToString("yyyy-mm-dd");
                    }

                    DataSet   ds = new DataSet();
                    DataTable dt = new DataTable();
                    dt = DBCon.Ora_Execute_table("select * from jpa_application as ja Left join jpa_write_off as jw on jw.wri_applcn_no=ja.app_applcn_no where ja.app_sts_cd='Y' and jw.wri_crt_dt BETWEEN DATEADD(day, DATEDIFF(day, 0, '" + fmdate + "'), 0) AND DATEADD(day, DATEDIFF(day, 0, '" + tmdate + "'), +1)");

                    Rptviwer_lt.Reset();
                    ds.Tables.Add(dt);

                    Rptviwer_lt.LocalReport.DataSources.Clear();

                    Rptviwer_lt.LocalReport.ReportPath = "Pelaburan_Anggota/pp_semak.rdlc";
                    ReportDataSource rds = new ReportDataSource("pp_shk", dt);

                    Rptviwer_lt.LocalReport.DataSources.Add(rds);

                    ReportParameter[] rptParams = new ReportParameter[] {
                        new ReportParameter("fromDate", f_date.Text),
                        new ReportParameter("toDate", t_date.Text)
                    };


                    Rptviwer_lt.LocalReport.SetParameters(rptParams);

                    //Refresh
                    Rptviwer_lt.LocalReport.Refresh();
                    Warning[] warnings;

                    string[] streamids;

                    string mimeType;

                    string encoding;

                    string extension;

                    string fname = DateTime.Now.ToString("dd_MM_yyyy");

                    string devinfo = "<DeviceInfo><ColorDepth>32</ColorDepth><DpiX>350</DpiX><DpiY>350</DpiY><OutputFormat>PDF</OutputFormat>" +
                                     "  <PageWidth>12.20in</PageWidth>" +
                                     "  <PageHeight>8.27in</PageHeight>" +
                                     "  <MarginTop>0.1in</MarginTop>" +
                                     "  <MarginLeft>0.5in</MarginLeft>" +
                                     "  <MarginRight>0in</MarginRight>" +
                                     "  <MarginBottom>0in</MarginBottom>" +
                                     "</DeviceInfo>";

                    byte[] bytes = Rptviwer_lt.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);


                    Response.Buffer = true;

                    Response.Clear();

                    Response.ClearHeaders();

                    Response.ClearContent();

                    Response.ContentType = "application/pdf";


                    Response.AddHeader("content-disposition", "attachment; filename= Semak_Hapus_Kira_" + f_date.Text + "_To_" + t_date.Text + "." + extension);

                    Response.BinaryWrite(bytes);

                    //Response.Write("<script>");
                    //Response.Write("window.open('', '_newtab');");
                    //Response.Write("</script>");
                    Response.Flush();

                    Response.End();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alert('Medan Input Adalah Mandatori');", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
Ejemplo n.º 2
0
    protected void click_print(object sender, EventArgs e)
    {
        {
            try
            {
                int counter = 0;

                if (Applcn_no.Text != "")
                {
                    //Path
                    foreach (GridViewRow gvrow1 in gvSelected.Rows)
                    {
                        var cb = gvrow1.FindControl("rbtnSelect") as System.Web.UI.WebControls.RadioButton;
                        if (cb.Checked)
                        {
                            counter = counter + 1;
                        }
                    }
                    if (counter != 0)
                    {
                        foreach (GridViewRow gvrow in gvSelected.Rows)
                        {
                            var a_no = (System.Web.UI.WebControls.Label)gvrow.FindControl("app_icno");
                            var a_id = (System.Web.UI.WebControls.Label)gvrow.FindControl("app_id");
                            //var l1 = (System.Web.UI.WebControls.Label)gvrow.FindControl("Label1");
                            //var l2 = (System.Web.UI.WebControls.Label)gvrow.FindControl("Label6");
                            var l_amt  = (System.Web.UI.WebControls.Label)gvrow.FindControl("Label2");
                            var l_amt2 = (System.Web.UI.WebControls.Label)gvrow.FindControl("Label4");

                            //if (c_dte.Text != "")
                            //{
                            var checkbox = gvrow.FindControl("rbtnSelect") as System.Web.UI.WebControls.RadioButton;
                            if (checkbox.Checked == true)
                            {
                                if (l_amt.Text.Trim() != "0.00" && l_amt2.Text.Trim() == "0.00")
                                {
                                    tcode = "Caj Pengeposan";
                                    tamt  = l_amt.Text;
                                    ct    = "01";
                                }
                                if (l_amt2.Text.Trim() != "0.00" && l_amt.Text.Trim() == "0.00")
                                {
                                    tcode = "Caj Lewat";
                                    tamt  = l_amt2.Text;
                                    ct    = "11";
                                }
                                DataSet   ds = new DataSet();
                                DataTable dt = new DataTable();
                                // dt = DBCon.Ora_Execute_table("select * from jpa_charge where id='" + a_id.Text + "' and caj_applcn_no='" + a_no.Text + "'");

                                Rptviwer_lt.Reset();
                                //ds.Tables.Add(dt);

                                //Rptviwer_lt.LocalReport.DataSources.Clear();

                                Rptviwer_lt.LocalReport.ReportPath = "PELABURAN_ANGGOTA/kemaskini_caj.rdlc";
                                //ReportDataSource rds = new ReportDataSource("pp_transaksi", dt);

                                //Rptviwer_lt.LocalReport.DataSources.Add(rds);
                                DataTable applcn = new DataTable();
                                applcn = DBCon.Ora_Execute_table("select ja.app_bank_acc_no,ja.app_applcn_no,ja.app_name,ja.app_permnt_address,ja.app_permnt_postcode,rn.Decription from jpa_application ja left join Ref_Negeri rn on rn.Decription_Code=ja.app_permnt_state_cd where app_applcn_no='" + a_no.Text + "'");
                                ReportParameter[] rptParams = new ReportParameter[] {
                                    new ReportParameter("no_akaun", applcn.Rows[0]["app_bank_acc_no"].ToString()),
                                    new ReportParameter("no_applcn", applcn.Rows[0]["app_applcn_no"].ToString()),
                                    new ReportParameter("tarikh", DateTime.Now.ToString("dd/MM/yyyy")),
                                    new ReportParameter("name", applcn.Rows[0]["app_name"].ToString()),
                                    new ReportParameter("address", applcn.Rows[0]["app_permnt_address"].ToString()),
                                    new ReportParameter("s_code", applcn.Rows[0]["app_permnt_postcode"].ToString()),
                                    new ReportParameter("state", applcn.Rows[0]["Decription"].ToString()),
                                    new ReportParameter("t_code", tcode),
                                    new ReportParameter("kt", ct),
                                    new ReportParameter("t_amt", tamt)
                                };


                                Rptviwer_lt.LocalReport.SetParameters(rptParams);

                                //Refresh
                                Rptviwer_lt.LocalReport.Refresh();
                                Warning[] warnings;

                                string[] streamids;

                                string mimeType;

                                string encoding;

                                string extension;

                                string fname = DateTime.Now.ToString("dd_MM_yyyy");

                                string devinfo = "<DeviceInfo><ColorDepth>32</ColorDepth><DpiX>350</DpiX><DpiY>350</DpiY><OutputFormat>PDF</OutputFormat>" +
                                                 "  <PageWidth>12.20in</PageWidth>" +
                                                 "  <PageHeight>8.27in</PageHeight>" +
                                                 "  <MarginTop>0.1in</MarginTop>" +
                                                 "  <MarginLeft>0.5in</MarginLeft>" +
                                                 "  <MarginRight>0in</MarginRight>" +
                                                 "  <MarginBottom>0in</MarginBottom>" +
                                                 "</DeviceInfo>";

                                byte[] bytes = Rptviwer_lt.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);


                                Response.Buffer = true;

                                Response.Clear();

                                Response.ClearHeaders();

                                Response.ClearContent();

                                Response.ContentType = "application/pdf";

                                Response.AddHeader("content-disposition", "attachment; filename= Kemasukan_Caj_" + a_no.Text + "." + extension);

                                Response.BinaryWrite(bytes);

                                Response.Flush();

                                Response.End();
                            }
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Please Select Min One Check box',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                    }
                }
                else
                {
                    grid();
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukkan Input Carian',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
Ejemplo n.º 3
0
    protected void btnpt_Click(object sender, EventArgs e)
    {
        try
        {
            if (txticno.Text != "")
            {
                DataSet   ds = new DataSet();
                DataTable dt = new DataTable();

                dt = DBCon.Ora_Execute_table("select app_applcn_no from jpa_application JA where JA.app_new_icno='" + txticno.Text + "'");

                Rptviwer_lt.Reset();
                ds.Tables.Add(dt);

                DataTable sel_mdet = new DataTable();
                sel_mdet = DBCon.Ora_Execute_table("select mem_name,ISNULL(rc.cawangan_name,'') as cawangan_name,mem_centre from mem_member as mm left join ref_cawangan as rc on rc.cawangan_code=mm.mem_branch_cd where mem_new_icno='" + txticno.Text + "' and mm.mem_staff_ind='Y'");

                DataTable sel_chlist = new DataTable();
                sel_chlist = DBCon.Ora_Execute_table("select ac.che_staff_supp_doc,ac.che_muflis_ind,ac.che_muflis_remark,ac.che_legal_ind,ac.che_legal_remark,ac.che_active_status_ind  from jpa_application_checklist as ac  left join jpa_application as ap on ap.app_applcn_no=ac.che_applcn_no  left join mem_member as mm on mm.mem_new_icno=ap.app_new_icno where  ap.app_new_icno='" + txticno.Text + "' and mm.mem_staff_ind='Y' and ac.che_appl_sts_ind!='1'");

                string tv1 = string.Empty, tv2 = string.Empty, tv3 = string.Empty, tv4 = string.Empty, tv5 = string.Empty, tv6 = string.Empty;
                string tt1 = string.Empty, tt2 = string.Empty, tt3 = string.Empty, tt4 = string.Empty, tt5 = string.Empty, tt6 = string.Empty, tt7 = string.Empty, tt8 = string.Empty, tt9 = string.Empty;
                if (sel_chlist.Rows.Count != 0)
                {
                    //string appno = (string)sqlReader2["che_muflis_remark"].ToString();
                    tt1 = sel_chlist.Rows[0]["che_muflis_remark"].ToString();
                    tt2 = sel_chlist.Rows[0]["che_legal_remark"].ToString();

                    string radio1 = sel_chlist.Rows[0]["che_muflis_ind"].ToString();

                    string jar1 = radio1.ToString();

                    if (jar1 == "True")
                    {
                        tt3 = "MUFLIS";
                    }
                    else
                    {
                        tt3 = "TIDAK MUFLIS";
                    }

                    string radio2 = sel_chlist.Rows[0]["che_legal_ind"].ToString();

                    string bar2 = radio2.ToString();

                    if (bar2 == "True")
                    {
                        tt4 = "YA";
                    }
                    else
                    {
                        tt4 = "TIDAK";
                    }

                    string radio3 = sel_chlist.Rows[0]["che_active_status_ind"].ToString();

                    string bar3 = radio3.ToString();

                    if (bar3 == "True")
                    {
                        tt5 = "AKTIF";
                    }
                    else
                    {
                        tt5 = "TIDAK AKTIF";
                    }

                    string readText1 = sel_chlist.Rows[0]["che_staff_supp_doc"].ToString();

                    string bar1 = readText1.ToString();
                    for (int i = 0; i <= readText1.Length; i++)
                    {
                        if (i == 0)
                        {
                            if (bar1.Substring(0, 1) == "1")
                            {
                                tv1 = "YA";
                            }
                            else
                            {
                                tv1 = "TIDAK";
                            }
                        }
                        else if (i == 1)
                        {
                            if (bar1.Substring(1, 1) == "1")
                            {
                                tv2 = "YA";
                            }
                            else
                            {
                                tv2 = "TIDAK";
                            }
                        }
                        else if (i == 2)
                        {
                            if (bar1.Substring(2, 1) == "1")
                            {
                                tv3 = "YA";
                            }
                            else
                            {
                                tv3 = "TIDAK";
                            }
                        }
                        else if (i == 3)
                        {
                            if (bar1.Substring(3, 1) == "1")
                            {
                                tv4 = "YA";
                            }
                            else
                            {
                                tv4 = "TIDAK";
                            }
                        }
                        else if (i == 4)
                        {
                            if (bar1.Substring(4, 1) == "1")
                            {
                                tv5 = "YA";
                            }
                            else
                            {
                                tv5 = "TIDAK";
                            }
                        }
                        else if (i == 5)
                        {
                            if (bar1.Substring(5, 1) == "1")
                            {
                                tv6 = "YA";
                            }
                            else
                            {
                                tv6 = "TIDAK";
                            }
                        }
                    }
                }
                Rptviwer_lt.LocalReport.DataSources.Clear();

                Rptviwer_lt.LocalReport.ReportPath = "Pelaburan_Anggota/pa_ssp_staff.rdlc";
                ReportDataSource rds = new ReportDataSource("pa_ssp_s", dt);

                ReportParameter[] rptParams = new ReportParameter[] {
                    new ReportParameter("no_kp", txticno.Text),
                    new ReportParameter("appno", dt.Rows[0]["app_applcn_no"].ToString()),
                    new ReportParameter("nama", sel_mdet.Rows[0]["mem_name"].ToString()),
                    new ReportParameter("pejabat", sel_mdet.Rows[0]["cawangan_name"].ToString()),
                    new ReportParameter("pusat", sel_mdet.Rows[0]["mem_centre"].ToString()),

                    new ReportParameter("cc1", tv1),
                    new ReportParameter("cc2", tv2),
                    new ReportParameter("cc3", tv3),
                    new ReportParameter("cc4", tv4),
                    new ReportParameter("cc5", tv5),
                    new ReportParameter("cc6", tv6),

                    new ReportParameter("cc7", tt1),
                    new ReportParameter("cc8", tt2),
                    new ReportParameter("cc9", tt3),
                    new ReportParameter("cc10", tt4),
                    new ReportParameter("cc11", tt5),
                    new ReportParameter("cc12", tt6)
                };


                Rptviwer_lt.LocalReport.SetParameters(rptParams);

                Rptviwer_lt.LocalReport.DataSources.Add(rds);

                //Refresh
                Rptviwer_lt.LocalReport.Refresh();
                Warning[] warnings;

                string[] streamids;

                string mimeType;

                string encoding;

                string extension;

                string fname = DateTime.Now.ToString("dd_MM_yyyy");

                string devinfo = "   <DeviceInfo><ColorDepth>32</ColorDepth><DpiX>350</DpiX><DpiY>350</DpiY><OutputFormat>PDF</OutputFormat>" +
                                 "   <PageWidth>12.20in</PageWidth>" +
                                 "   <PageHeight>8.27in</PageHeight>" +
                                 "   <MarginTop>0.1in</MarginTop>" +
                                 "   <MarginLeft>0.5in</MarginLeft>" +
                                 "   <MarginRight>0in</MarginRight>" +
                                 "   <MarginBottom>0in</MarginBottom>" +
                                 "   </DeviceInfo>";

                byte[] bytes = Rptviwer_lt.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);

                Response.Buffer = true;

                Response.Clear();

                Response.ClearHeaders();

                Response.ClearContent();

                Response.ContentType = "application/pdf";

                Response.AddHeader("content-disposition", "attachment; filename=SENARAI_SEMAK_PERMOHONAN_KAKITANGAN_" + txticno.Text + "." + extension);

                Response.BinaryWrite(bytes);

                Response.Flush();

                //Response.End();
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukkan Input Carian',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Ejemplo n.º 4
0
    //protected void BindGrid()
    //{
    //    // From and To Date
    //    if (txt_dar.Text != "" && txt_seh.Text != "")
    //    {
    //        DateTime ft = DateTime.ParseExact(txt_dar.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
    //        dar_dt = ft.ToString("yyyy-MM-dd");
    //        DateTime td = DateTime.ParseExact(txt_seh.Text, "dd/mm/yyyy", CultureInfo.InvariantCulture);
    //        seh_dt = td.ToString("yyyy-mm-dd");
    //    }
    //    else
    //    {
    //        dar_dt = "";
    //        seh_dt = "";
    //    }
    //    SqlCommand cmd2 = new SqlCommand("select cmp_id,cmp_staff_no,FORMAT(cmp_complaint_dt,'dd/MM/yyyy', 'en-us') as cmp_complaint_dt,cmp_remark,FORMAT(cmp_action_dt,'dd/MM/yyyy', 'en-us') as cmp_action_dt,cmp_action_remark, case when cmp_sts_cd = '01'  then 'BARU' when cmp_sts_cd= '02' then 'SEDANG DISELENGGARA' when cmp_sts_cd= '03' then 'SELESAI' when cmp_sts_cd= '04' then 'RUJUK PENYELIA' end as ss1,cmp_asset_id from ast_complaint where cmp_complaint_dt>=DATEADD(day, DATEDIFF(day, 0, '" + dar_dt + "'), 0) and cmp_complaint_dt<=DATEADD(day, DATEDIFF(day, 0, '" + seh_dt + "'), 0)", con);
    //    SqlDataAdapter da2 = new SqlDataAdapter(cmd2);
    //    DataSet ds2 = new DataSet();
    //    da2.Fill(ds2);

    //    // Empty Records

    //    if (ds2.Tables[0].Rows.Count == 0)
    //    {
    //        ds2.Tables[0].Rows.Add(ds2.Tables[0].NewRow());
    //        gvSelected.DataSource = ds2;
    //        gvSelected.DataBind();
    //        int columncount = gvSelected.Rows[0].Cells.Count;
    //        gvSelected.Rows[0].Cells.Clear();
    //        gvSelected.Rows[0].Cells.Add(new TableCell());
    //        gvSelected.Rows[0].Cells[0].ColumnSpan = columncount;
    //        gvSelected.Rows[0].Cells[0].Text = "<center><strong>Maklumat Carian Tidak Dijumpai</strong></center>";
    //        if (txt_dar.Text != "" && txt_seh.Text != "")
    //        {
    //            clr2();
    //            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod carian Tidak Wujud.',{'type': 'warning','title': 'warning','auto_close': 2000});", true);
    //        }
    //    }
    //    // Show Records
    //    else
    //    {
    //        gvSelected.DataSource = ds2;
    //        gvSelected.DataBind();
    //    }
    //}

    protected void clk_cetak(object sender, EventArgs e)
    {
        try
        {
            if (lbl_name.Text != "")
            {
                //if (txt_dar.Text != "" && txt_seh.Text != "")
                //{
                //    DateTime ft = DateTime.ParseExact(txt_dar.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                //    dar_dt = ft.ToString("yyyy-MM-dd");
                //    DateTime td = DateTime.ParseExact(txt_seh.Text, "dd/mm/yyyy", CultureInfo.InvariantCulture);
                //    seh_dt = td.ToString("yyyy-mm-dd");
                //}
                //else
                //{
                //    dar_dt = "";
                //    seh_dt = "";
                //}
                DataSet   ds = new DataSet();
                DataTable dt = new DataTable();
                //dt = DBCon.Ora_Execute_table("select jt.txn_applcn_no,jt.txn_cd,ISNULL(jt.txn_credit_amt,'') as txn_credit_amt,ISNULL(jt.txn_bal_amt,'') as txn_bal_amt,ISNULL(jt.txn_debit_amt,'') as txn_debit_amt,ISNULL(jt.txn_gst_amt,'') as txn_gst_amt,jt.txn_crt_dt,rt.txn_description,sum(ISNULL(jt.txn_credit_amt,'')) as tc_amt,sum(ISNULL(jt.txn_bal_amt,'')) as tb_amt,sum(ISNULL(jt.txn_debit_amt,'')) as td_amt,sum(ISNULL(jt.txn_gst_amt,'')) as tg_amt from jpa_transaction as jt left join Ref_jpa_txn as rt on rt.txn_cd=jt.txn_cd where txn_applcn_no='"+Applcn_no.Text+"' group by jt.txn_applcn_no,jt.txn_bal_amt,jt.txn_credit_amt,jt.txn_debit_amt,jt.txn_gst_amt,rt.txn_description,jt.txn_cd,jt.txn_crt_dt");
                dt = DBCon.Ora_Execute_table("select cmp_id,FORMAT(cmp_complaint_dt,'dd/MM/yyyy', 'en-us') as cmp_complaint_dt,cmp_remark,FORMAT(cmp_action_dt,'dd/MM/yyyy', 'en-us') as cmp_action_dt,cmp_action_remark,case when cmp_sts_cd='04' then 'RUJUK PENYELIA' end as cmpsts from ast_complaint where cmp_sts_cd='04' and cmp_id='" + lbl_name.Text + "'");
                Rptviwer_lt.Reset();
                ds.Tables.Add(dt);

                Rptviwer_lt.LocalReport.DataSources.Clear();


                ReportDataSource rds = new ReportDataSource("ast_tinkero_kel", dt);
                Rptviwer_lt.LocalReport.DataSources.Add(rds);
                Rptviwer_lt.LocalReport.ReportPath = "Aset/AST_Tin_kero_kel.rdlc";
                //DataTable applcn = new DataTable();
                //applcn = dbcon.Ora_Execute_table("");
                string sv1 = string.Empty, sv2 = string.Empty;
                string dd1 = string.Empty, dd2 = string.Empty, dd3 = string.Empty, dd4 = string.Empty, dd5 = string.Empty, dd6 = string.Empty;

                if (txt_bx1.Text != "")
                {
                    sv2 = double.Parse(txt_bx1.Text).ToString("C").Replace("$", "");
                }
                else
                {
                    sv2 = "";
                }

                if (DropDownList1.SelectedValue != "")
                {
                    dd1 = DropDownList1.SelectedItem.Text;
                }

                if (DD_Sub.SelectedValue != "")
                {
                    dd2 = DD_Sub.SelectedItem.Text;
                }
                if (DropDownList2.SelectedValue != "")
                {
                    dd3 = DropDownList2.SelectedItem.Text;
                }
                if (DropDownList3.SelectedValue != "")
                {
                    dd4 = DropDownList3.SelectedItem.Text;
                }
                if (DropDownList5.SelectedValue != "")
                {
                    dd5 = DropDownList5.SelectedItem.Text;
                }

                if (DropDownList4.SelectedValue != "")
                {
                    dd6 = DropDownList4.SelectedItem.Text;
                }

                ReportParameter[] rptParams = new ReportParameter[] {
                    new ReportParameter("s1", txtnp.Text),
                    new ReportParameter("s2", txttarikh.Text),
                    //1st
                    new ReportParameter("s3", TextBox4.Text),
                    new ReportParameter("s4", TextBox5.Text),
                    new ReportParameter("s5", TextBox6.Text),
                    new ReportParameter("s6", TextBox7.Text),
                    new ReportParameter("s7", TextBox8.Text),
                    new ReportParameter("s8", TextBox9.Text),
                    //2nd
                    new ReportParameter("s9", dd1),
                    new ReportParameter("s10", dd2),
                    new ReportParameter("s11", dd3),
                    new ReportParameter("s12", dd4),
                    new ReportParameter("s13", TextBox10.Text),
                    new ReportParameter("s14", dd6),
                    //3rd
                    new ReportParameter("s15", txt_area.Value),
                    //4th
                    new ReportParameter("s16", Textarea1.Value),
                    new ReportParameter("s17", sv2),
                    new ReportParameter("s18", dd5),
                    new ReportParameter("s19", Textarea3.Value),
                };
                Rptviwer_lt.LocalReport.SetParameters(rptParams);

                //Refresh
                Rptviwer_lt.LocalReport.Refresh();
                Warning[] warnings;

                string[] streamids;

                string mimeType;

                string encoding;

                string extension;

                string fname = DateTime.Now.ToString("dd_MM_yyyy");

                string devinfo = "<DeviceInfo><ColorDepth>32</ColorDepth><DpiX>350</DpiX><DpiY>350</DpiY><OutputFormat>PDF</OutputFormat>" +
                                 "  <PageWidth>12.20in</PageWidth>" +
                                 "  <PageHeight>8.27in</PageHeight>" +
                                 "  <MarginTop>0.1in</MarginTop>" +
                                 "  <MarginLeft>0.5in</MarginLeft>" +
                                 "  <MarginRight>0in</MarginRight>" +
                                 "  <MarginBottom>0in</MarginBottom>" +
                                 "</DeviceInfo>";

                byte[] bytes = Rptviwer_lt.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);


                Response.Buffer = true;

                Response.Clear();

                Response.ClearHeaders();

                Response.ClearContent();

                Response.ContentType = "application/pdf";


                Response.AddHeader("content-disposition", "attachment; filename=Tindakan_Kerosakan_" + DateTime.Now.ToString("ddMMyyyy") + "." + extension);

                Response.BinaryWrite(bytes);

                //Response.Write("<script>");
                //Response.Write("window.open('', '_newtab');");
                //Response.Write("</script>");
                Response.Flush();

                Response.End();
            }
            else
            {
                //BindGrid();
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukan Aduan No.',{'type': 'warning','title': 'warning','auto_close': 2000});", true);
            }
        }
        catch (Exception ex)
        {
//            BindGrid();
            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Issue.',{'type': 'warning','title': 'warning','auto_close': 2000});", true);
        }
    }
Ejemplo n.º 5
0
    protected void click_print(object sender, EventArgs e)
    {
        {
            try
            {
                //grid();
                if (Applcn_no.Text != "")
                {
                    //Path

                    DataSet   ds = new DataSet();
                    DataTable dt = new DataTable();
                    //dt = DBCon.Ora_Execute_table("select jt.txn_applcn_no,jt.txn_cd,ISNULL(jt.txn_credit_amt,'') as txn_credit_amt,ISNULL(jt.txn_bal_amt,'') as txn_bal_amt,ISNULL(jt.txn_debit_amt,'') as txn_debit_amt,ISNULL(jt.txn_gst_amt,'') as txn_gst_amt,jt.txn_crt_dt,rt.txn_description,sum(ISNULL(jt.txn_credit_amt,'')) as tc_amt,sum(ISNULL(jt.txn_bal_amt,'')) as tb_amt,sum(ISNULL(jt.txn_debit_amt,'')) as td_amt,sum(ISNULL(jt.txn_gst_amt,'')) as tg_amt from jpa_transaction as jt left join Ref_jpa_txn as rt on rt.txn_cd=jt.txn_cd where txn_applcn_no='"+Applcn_no.Text+"' group by jt.txn_applcn_no,jt.txn_bal_amt,jt.txn_credit_amt,jt.txn_debit_amt,jt.txn_gst_amt,rt.txn_description,jt.txn_cd,jt.txn_crt_dt");
                    dt = DBCon.Ora_Execute_table("select tc_amt,tb_amt,td_amt,tg_amt,ISNULL(txn_applcn_no,'') as txn_applcn_no,ISNULL(txn_cd,'') txn_cd, ISNULL(txn_credit_amt,'') txn_credit_amt,ISNULL(txn_bal_amt,'') txn_bal_amt,ISNULL(txn_debit_amt,'') txn_debit_amt,ISNULL(txn_gst_amt,'') txn_gst_amt,ISNULL(txn_crt_dt,'') txn_crt_dt,ISNULL(txn_description,'') txn_description from (select ISNULL(sum(jt.txn_credit_amt),'') as tc_amt,ISNULL(sum(jt.txn_bal_amt),'') as tb_amt,ISNULL(sum(jt.txn_debit_amt),'') as td_amt,ISNULL(sum(jt.txn_gst_amt),'') as tg_amt from jpa_transaction as jt where jt.txn_applcn_no='" + Applcn_no.Text + "') as a full outer join(select jt.txn_applcn_no,jt.txn_cd,ISNULL(jt.txn_credit_amt,'') as txn_credit_amt,ISNULL(jt.txn_bal_amt,'') as txn_bal_amt,ISNULL(jt.txn_debit_amt,'') as txn_debit_amt,ISNULL(jt.txn_gst_amt,'') as txn_gst_amt,jt.txn_crt_dt,rt.txn_description from jpa_transaction as jt left join Ref_jpa_txn as rt on rt.txn_cd=jt.txn_cd where txn_applcn_no='" + Applcn_no.Text + "') as b on b.txn_applcn_no='" + Applcn_no.Text + "' ORDER BY b.txn_crt_dt");
                    Rptviwer_lt.Reset();
                    ds.Tables.Add(dt);

                    Rptviwer_lt.LocalReport.DataSources.Clear();

                    Rptviwer_lt.LocalReport.ReportPath = "PELABURAN_ANGGOTA/transaksi.rdlc";
                    ReportDataSource rds = new ReportDataSource("pp_transaksi", dt);

                    Rptviwer_lt.LocalReport.DataSources.Add(rds);
                    DataTable applcn = new DataTable();
                    //applcn = DBCon.Ora_Execute_table("select ja.app_bank_acc_no,ja.app_applcn_no,ja.app_name,ja.app_permnt_address,ja.app_permnt_postcode,rn.Decription from jpa_application ja left join Ref_Negeri rn on rn.Decription_Code=ja.app_permnt_state_cd where app_applcn_no='"+Applcn_no.Text+"'");
                    applcn = DBCon.Ora_Execute_table("select ja.app_bank_acc_no,ja.app_applcn_no,ja.app_name,ja.app_mailing_address,ja.app_permnt_postcode,rn.Decription,(ja.app_loan_amt + cf.cal_profit_amt) as jum_amt,jp.Description as l_desc from jpa_application ja left join Ref_Negeri rn on rn.Decription_Code=ja.app_permnt_state_cd left join jpa_calculate_fee as cf on cf.cal_applcn_no=ja.app_applcn_no left join Ref_Jenis_Pelaburan as jp on jp.Description_Code=ja.app_loan_type_cd where app_applcn_no='" + Applcn_no.Text + "'");
                    ReportParameter[] rptParams = new ReportParameter[] {
                        new ReportParameter("no_akaun", applcn.Rows[0]["app_bank_acc_no"].ToString()),
                        new ReportParameter("no_applcn", applcn.Rows[0]["app_applcn_no"].ToString()),
                        new ReportParameter("tarikh", DateTime.Now.ToString("dd/MM/yyyy")),
                        new ReportParameter("name", applcn.Rows[0]["app_name"].ToString()),
                        new ReportParameter("address", applcn.Rows[0]["app_mailing_address"].ToString()),
                        new ReportParameter("s_code", applcn.Rows[0]["app_permnt_postcode"].ToString()),
                        new ReportParameter("state", applcn.Rows[0]["Decription"].ToString()),
                        new ReportParameter("jumamt", applcn.Rows[0]["jum_amt"].ToString()),
                        new ReportParameter("loandesc", applcn.Rows[0]["l_desc"].ToString())
                    };


                    Rptviwer_lt.LocalReport.SetParameters(rptParams);

                    //Refresh
                    Rptviwer_lt.LocalReport.Refresh();
                    Warning[] warnings;

                    string[] streamids;

                    string mimeType;

                    string encoding;

                    string extension;

                    string fname = DateTime.Now.ToString("dd_MM_yyyy");

                    string devinfo = "<DeviceInfo><ColorDepth>32</ColorDepth><DpiX>350</DpiX><DpiY>350</DpiY><OutputFormat>PDF</OutputFormat>" +
                                     "  <PageWidth>12.20in</PageWidth>" +
                                     "  <PageHeight>8.27in</PageHeight>" +
                                     "  <MarginTop>0.1in</MarginTop>" +
                                     "  <MarginLeft>0.5in</MarginLeft>" +
                                     "  <MarginRight>0in</MarginRight>" +
                                     "  <MarginBottom>0in</MarginBottom>" +
                                     "</DeviceInfo>";

                    byte[] bytes = Rptviwer_lt.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);


                    Response.Buffer = true;

                    Response.Clear();

                    Response.ClearHeaders();

                    Response.ClearContent();

                    Response.ContentType = "application/pdf";


                    Response.AddHeader("content-disposition", "attachment; filename=CETAK_PENYATA_TRANSAKSI_" + Applcn_no.Text + "." + extension);

                    Response.BinaryWrite(bytes);

                    //Response.Write("<script>");
                    //Response.Write("window.open('', '_newtab');");
                    //Response.Write("</script>");
                    Response.Flush();

                    Response.End();
                }
                else
                {
                    grid();
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukkan Input Carian',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
Ejemplo n.º 6
0
    void bnd_grid()
    {
        DataTable dt = new DataTable();
        DataSet   ds = new DataSet();
        string    fdate = string.Empty, tmdate = string.Empty, tdate = string.Empty, tddate = string.Empty;

        if (txtdari.Text != "")
        {
            fdate = txtdari.Text;
            DateTime tt = DateTime.ParseExact(fdate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            tmdate = tt.ToString("yyyy/MM/dd");
        }

        if (txtseh.Text != "")
        {
            tdate = txtseh.Text;
            DateTime td = DateTime.ParseExact(tdate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            tddate = td.ToString("yyyy/MM/dd");
        }

        if (txtdari.Text != "" && txtseh.Text != "" && DD_Kategori.SelectedValue == "" && DD_Sub.SelectedValue == "" && DropDownList1.SelectedValue == "" && DropDownList2.SelectedValue == "" && DropDownList5.SelectedValue == "")
        {
            dt = dbcon.Ora_Execute_table("select sas_org_id,org_name,sas_asset_cat_cd,ast_kategori_desc,sas_asset_sub_cat_cd,ast_subkateast_desc,sas_asset_type_cd,ast_jeniaset_desc,sas_asset_cd,cas_asset_desc,ISNULL(sas_purchase_amt,'') as sas_purchase_amt  from ast_staff_asset left join hr_organization on org_gen_id=sas_org_id left join Ref_ast_kategori on ast_kategori_code=sas_asset_cat_cd   left join Ref_ast_sub_kategri_Aset on ast_subkateast_Code=sas_asset_sub_cat_cd left join ast_cmn_asset  on cas_asset_cd=sas_asset_cd and cas_asset_cat_cd=sas_asset_cat_cd and cas_asset_sub_cat_cd=sas_asset_sub_cat_cd and cas_asset_type_cd=sas_asset_type_cd left join Ref_ast_jenis_aset on sas_asset_type_cd=ast_jeniaset_Code where  sas_reg_dt>=DATEADD(day, DATEDIFF(day, 0, '" + tmdate + "'), 0) and sas_reg_dt<=DATEADD(day, DATEDIFF(day, 0, '" + tddate + "'), +1) ");
        }
        else if (txtdari.Text != "" && txtseh.Text != "" && DD_Kategori.SelectedValue != "" && DD_Sub.SelectedValue == "" && DropDownList1.SelectedValue == "" && DropDownList2.SelectedValue == "" && DropDownList5.SelectedValue == "")
        {
            dt = dbcon.Ora_Execute_table("select sas_org_id,org_name,sas_asset_cat_cd,ast_kategori_desc,sas_asset_sub_cat_cd,ast_subkateast_desc,sas_asset_type_cd,ast_jeniaset_desc,sas_asset_cd,cas_asset_desc,ISNULL(sas_purchase_amt,'') as sas_purchase_amt  from ast_staff_asset left join hr_organization on org_gen_id=sas_org_id left join Ref_ast_kategori on ast_kategori_code=sas_asset_cat_cd   left join Ref_ast_sub_kategri_Aset on ast_subkateast_Code=sas_asset_sub_cat_cd left join ast_cmn_asset  on cas_asset_cd=sas_asset_cd and cas_asset_cat_cd=sas_asset_cat_cd and cas_asset_sub_cat_cd=sas_asset_sub_cat_cd and cas_asset_type_cd=sas_asset_type_cd left join Ref_ast_jenis_aset on sas_asset_type_cd=ast_jeniaset_Code where  sas_reg_dt>=DATEADD(day, DATEDIFF(day, 0, '" + tmdate + "'), 0) and sas_reg_dt<=DATEADD(day, DATEDIFF(day, 0, '" + tddate + "'), +1) and sas_asset_cat_cd ='" + DD_Kategori.SelectedValue + "' ");
        }
        else if (txtdari.Text != "" && txtseh.Text != "" && DD_Kategori.SelectedValue != "" && DD_Sub.SelectedValue != "" && DropDownList1.SelectedValue == "" && DropDownList2.SelectedValue == "" && DropDownList5.SelectedValue == "")
        {
            dt = dbcon.Ora_Execute_table("select sas_org_id,org_name,sas_asset_cat_cd,ast_kategori_desc,sas_asset_sub_cat_cd,ast_subkateast_desc,sas_asset_type_cd,ast_jeniaset_desc,sas_asset_cd,cas_asset_desc,ISNULL(sas_purchase_amt,'') as sas_purchase_amt  from ast_staff_asset left join hr_organization on org_gen_id=sas_org_id left join Ref_ast_kategori on ast_kategori_code=sas_asset_cat_cd   left join Ref_ast_sub_kategri_Aset on ast_subkateast_Code=sas_asset_sub_cat_cd left join ast_cmn_asset  on cas_asset_cd=sas_asset_cd and cas_asset_cat_cd=sas_asset_cat_cd and cas_asset_sub_cat_cd=sas_asset_sub_cat_cd and cas_asset_type_cd=sas_asset_type_cd left join Ref_ast_jenis_aset on sas_asset_type_cd=ast_jeniaset_Code where  sas_reg_dt>=DATEADD(day, DATEDIFF(day, 0, '" + tmdate + "'), 0) and sas_reg_dt<=DATEADD(day, DATEDIFF(day, 0, '" + tddate + "'), +1) and sas_asset_cat_cd ='" + DD_Kategori.SelectedValue + "' and sas_asset_sub_cat_cd ='" + DD_Sub.SelectedValue + "' ");
        }
        else if (txtdari.Text != "" && txtseh.Text != "" && DD_Kategori.SelectedValue != "" && DD_Sub.SelectedValue != "" && DropDownList1.SelectedValue != "" && DropDownList2.SelectedValue == "" && DropDownList5.SelectedValue == "")
        {
            dt = dbcon.Ora_Execute_table("select sas_org_id,org_name,sas_asset_cat_cd,ast_kategori_desc,sas_asset_sub_cat_cd,ast_subkateast_desc,sas_asset_type_cd,ast_jeniaset_desc,sas_asset_cd,cas_asset_desc,ISNULL(sas_purchase_amt,'') as sas_purchase_amt  from ast_staff_asset left join hr_organization on org_gen_id=sas_org_id left join Ref_ast_kategori on ast_kategori_code=sas_asset_cat_cd   left join Ref_ast_sub_kategri_Aset on ast_subkateast_Code=sas_asset_sub_cat_cd left join ast_cmn_asset  on cas_asset_cd=sas_asset_cd and cas_asset_cat_cd=sas_asset_cat_cd and cas_asset_sub_cat_cd=sas_asset_sub_cat_cd and cas_asset_type_cd=sas_asset_type_cd left join Ref_ast_jenis_aset on sas_asset_type_cd=ast_jeniaset_Code where  sas_reg_dt>=DATEADD(day, DATEDIFF(day, 0, '" + tmdate + "'), 0) and sas_reg_dt<=DATEADD(day, DATEDIFF(day, 0, '" + tddate + "'), +1) and sas_asset_cat_cd ='" + DD_Kategori.SelectedValue + "' and sas_asset_sub_cat_cd ='" + DD_Sub.SelectedValue + "'  and sas_asset_type_cd ='" + DropDownList1.SelectedValue + "'");
        }
        else if (txtdari.Text != "" && txtseh.Text != "" && DD_Kategori.SelectedValue != "" && DD_Sub.SelectedValue != "" && DropDownList1.SelectedValue != "" && DropDownList2.SelectedValue != "" && DropDownList5.SelectedValue == "")
        {
            dt = dbcon.Ora_Execute_table("select sas_org_id,org_name,sas_asset_cat_cd,ast_kategori_desc,sas_asset_sub_cat_cd,ast_subkateast_desc,sas_asset_type_cd,ast_jeniaset_desc,sas_asset_cd,cas_asset_desc,ISNULL(sas_purchase_amt,'') as sas_purchase_amt  from ast_staff_asset left join hr_organization on org_gen_id=sas_org_id left join Ref_ast_kategori on ast_kategori_code=sas_asset_cat_cd   left join Ref_ast_sub_kategri_Aset on ast_subkateast_Code=sas_asset_sub_cat_cd left join ast_cmn_asset  on cas_asset_cd=sas_asset_cd and cas_asset_cat_cd=sas_asset_cat_cd and cas_asset_sub_cat_cd=sas_asset_sub_cat_cd and cas_asset_type_cd=sas_asset_type_cd left join Ref_ast_jenis_aset on sas_asset_type_cd=ast_jeniaset_Code where  sas_reg_dt>=DATEADD(day, DATEDIFF(day, 0, '" + tmdate + "'), 0) and sas_reg_dt<=DATEADD(day, DATEDIFF(day, 0, '" + tddate + "'), +1) and sas_asset_cat_cd ='" + DD_Kategori.SelectedValue + "' and sas_asset_sub_cat_cd ='" + DD_Sub.SelectedValue + "'  and sas_asset_type_cd ='" + DropDownList1.SelectedValue + "' and sas_asset_cd ='" + DropDownList2.SelectedValue + "' ");
        }
        else if (txtdari.Text != "" && txtseh.Text != "" && DD_Kategori.SelectedValue != "" && DD_Sub.SelectedValue != "" && DropDownList1.SelectedValue != "" && DropDownList2.SelectedValue != "" && DropDownList5.SelectedValue != "")
        {
            dt = dbcon.Ora_Execute_table("select sas_org_id,org_name,sas_asset_cat_cd,ast_kategori_desc,sas_asset_sub_cat_cd,ast_subkateast_desc,sas_asset_type_cd,ast_jeniaset_desc,sas_asset_cd,cas_asset_desc,ISNULL(sas_purchase_amt,'') as sas_purchase_amt  from ast_staff_asset left join hr_organization on org_gen_id=sas_org_id left join Ref_ast_kategori on ast_kategori_code=sas_asset_cat_cd   left join Ref_ast_sub_kategri_Aset on ast_subkateast_Code=sas_asset_sub_cat_cd left join ast_cmn_asset  on cas_asset_cd=sas_asset_cd and cas_asset_cat_cd=sas_asset_cat_cd and cas_asset_sub_cat_cd=sas_asset_sub_cat_cd and cas_asset_type_cd=sas_asset_type_cd left join Ref_ast_jenis_aset on sas_asset_type_cd=ast_jeniaset_Code where  sas_reg_dt>=DATEADD(day, DATEDIFF(day, 0, '" + tmdate + "'), 0) and sas_reg_dt<=DATEADD(day, DATEDIFF(day, 0, '" + tddate + "'), +1) and sas_asset_cat_cd ='" + DD_Kategori.SelectedValue + "' and sas_asset_sub_cat_cd ='" + DD_Sub.SelectedValue + "'  and sas_asset_type_cd ='" + DropDownList1.SelectedValue + "' and sas_asset_cd ='" + DropDownList2.SelectedValue + "' and sas_org_id  ='" + DropDownList5.SelectedValue + "'");
        }
        else if (txtdari.Text != "" && txtseh.Text != "" && DD_Kategori.SelectedValue == "" && DD_Sub.SelectedValue == "" && DropDownList1.SelectedValue == "" && DropDownList2.SelectedValue == "" && DropDownList5.SelectedValue != "")
        {
            dt = dbcon.Ora_Execute_table("select sas_org_id,org_name,sas_asset_cat_cd,ast_kategori_desc,sas_asset_sub_cat_cd,ast_subkateast_desc,sas_asset_type_cd,ast_jeniaset_desc,sas_asset_cd,cas_asset_desc,ISNULL(sas_purchase_amt,'') as sas_purchase_amt  from ast_staff_asset left join hr_organization on org_gen_id=sas_org_id left join Ref_ast_kategori on ast_kategori_code=sas_asset_cat_cd   left join Ref_ast_sub_kategri_Aset on ast_subkateast_Code=sas_asset_sub_cat_cd left join ast_cmn_asset  on cas_asset_cd=sas_asset_cd and cas_asset_cat_cd=sas_asset_cat_cd and cas_asset_sub_cat_cd=sas_asset_sub_cat_cd and cas_asset_type_cd=sas_asset_type_cd left join Ref_ast_jenis_aset on sas_asset_type_cd=ast_jeniaset_Code where  sas_reg_dt>=DATEADD(day, DATEDIFF(day, 0, '" + tmdate + "'), 0) and sas_reg_dt<=DATEADD(day, DATEDIFF(day, 0, '" + tddate + "'), +1) and sas_org_id  ='" + DropDownList5.SelectedValue + "'");
        }
        else if (txtdari.Text != "" && txtseh.Text != "" && DD_Kategori.SelectedValue != "" && DD_Sub.SelectedValue == "" && DropDownList1.SelectedValue == "" && DropDownList2.SelectedValue == "" && DropDownList5.SelectedValue != "")
        {
            dt = dbcon.Ora_Execute_table("select sas_org_id,org_name,sas_asset_cat_cd,ast_kategori_desc,sas_asset_sub_cat_cd,ast_subkateast_desc,sas_asset_type_cd,ast_jeniaset_desc,sas_asset_cd,cas_asset_desc,ISNULL(sas_purchase_amt,'') as sas_purchase_amt  from ast_staff_asset left join hr_organization on org_gen_id=sas_org_id left join Ref_ast_kategori on ast_kategori_code=sas_asset_cat_cd   left join Ref_ast_sub_kategri_Aset on ast_subkateast_Code=sas_asset_sub_cat_cd left join ast_cmn_asset  on cas_asset_cd=sas_asset_cd and cas_asset_cat_cd=sas_asset_cat_cd and cas_asset_sub_cat_cd=sas_asset_sub_cat_cd and cas_asset_type_cd=sas_asset_type_cd left join Ref_ast_jenis_aset on sas_asset_type_cd=ast_jeniaset_Code where  sas_reg_dt>=DATEADD(day, DATEDIFF(day, 0, '" + tmdate + "'), 0) and sas_reg_dt<=DATEADD(day, DATEDIFF(day, 0, '" + tddate + "'), +1) and sas_asset_cat_cd ='" + DD_Kategori.SelectedValue + "' and sas_org_id  ='" + DropDownList5.SelectedValue + "'");
        }
        else
        {
            dt = dbcon.Ora_Execute_table("select sas_org_id,org_name,sas_asset_cat_cd,ast_kategori_desc,sas_asset_sub_cat_cd,ast_subkateast_desc,sas_asset_type_cd,ast_jeniaset_desc,sas_asset_cd,cas_asset_desc,ISNULL(sas_purchase_amt,'') as sas_purchase_amt  from ast_staff_asset left join hr_organization on org_gen_id=sas_org_id left join Ref_ast_kategori on ast_kategori_code=sas_asset_cat_cd   left join Ref_ast_sub_kategri_Aset on ast_subkateast_Code=sas_asset_sub_cat_cd left join ast_cmn_asset  on cas_asset_cd=sas_asset_cd and cas_asset_cat_cd=sas_asset_cat_cd and cas_asset_sub_cat_cd=sas_asset_sub_cat_cd and cas_asset_type_cd=sas_asset_type_cd left join Ref_ast_jenis_aset on sas_asset_type_cd=ast_jeniaset_Code where  sas_org_id  =''");
        }

        ds.Tables.Add(dt);

        Rptviwer_lt.Reset();
        Rptviwer_lt.LocalReport.Refresh();

        List <DataRow> listResult = dt.AsEnumerable().ToList();

        listResult.Count();
        int countRow = 0;

        countRow = listResult.Count();

        if (countRow != 0)
        {
            disp_hdr_txt.Visible = true;
            //Display Report
            //Rptviwer_lt.LocalReport.DataSources.Clear();
            Rptviwer_lt.LocalReport.ReportPath = "Aset/ast_pen1.rdlc";
            ReportDataSource rds = new ReportDataSource("aspen", dt);

            //Path

            string branch;
            //ToDate.Text = today.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
            string ss1 = string.Empty, ss2 = string.Empty, ss3 = string.Empty, ss4 = string.Empty, ss5 = string.Empty, ss6 = string.Empty;
            if (DD_Kategori.SelectedValue != "")
            {
                ss1 = DD_Kategori.SelectedItem.Text.ToUpper();
            }
            else
            {
                ss1 = "SEMUA";
            }

            if (DD_Sub.SelectedValue != "")
            {
                ss2 = DD_Sub.SelectedItem.Text.ToUpper();
            }
            else
            {
                ss2 = "SEMUA";
            }

            if (DropDownList1.SelectedValue != "")
            {
                ss3 = DropDownList1.SelectedItem.Text.ToUpper();
            }
            else
            {
                ss3 = "SEMUA";
            }

            if (DropDownList2.SelectedValue != "")
            {
                ss4 = DropDownList2.SelectedItem.Text.ToUpper();
            }
            else
            {
                ss4 = "SEMUA";
            }

            if (DropDownList5.SelectedValue != "")
            {
                ss5 = DropDownList5.SelectedItem.Text.ToUpper();
            }
            else
            {
                ss5 = "SEMUA";
            }

            //Parameters
            ReportParameter[] rptParams = new ReportParameter[] {
                //new ReportParameter("fromDate",FromDate .Text ),
                //new ReportParameter("toDate",ToDate .Text )
                new ReportParameter("s7", txtdari.Text),
                new ReportParameter("s8", txtseh.Text),
                new ReportParameter("s1", ss1),
                new ReportParameter("s2", ss2),
                new ReportParameter("s3", ss3),
                new ReportParameter("s4", ss4),
                new ReportParameter("s5", ss5),
                new ReportParameter("s6", ss6)
            };


            Rptviwer_lt.LocalReport.SetParameters(rptParams);
            Rptviwer_lt.LocalReport.DataSources.Add(rds);
            Rptviwer_lt.LocalReport.DisplayName = "Laporan_Nilai_Keseluruhan_Aset_" + DateTime.Now.ToString("ddMMyyyy");
            //ReportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(AppDomain.CurrentDomain.Evidence);
            //Refresh
            Rptviwer_lt.LocalReport.Refresh();
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod tidak dijumpai.',{'type': 'warning','title': 'warning','auto_close': 2000});", true);
        }
    }
Ejemplo n.º 7
0
    protected void click_print(object sender, EventArgs e)
    {
        {
            try
            {
                if (Applcn_no.Text != "")
                {
                    var ic_count = Applcn_no.Text.Length;
                    //Path var ic_count = Applcn_no.Text.Length;
                    DataTable app_icno = new DataTable();
                    app_icno = DBCon.Ora_Execute_table("select app_applcn_no,isnull(app_current_jbb_ind,'') AS app_current_jbb_ind,app_loan_type_cd,app_loan_amt from jpa_application JA where '" + Applcn_no.Text + "' IN(JA.app_applcn_no, JA.app_new_icno)");
                    if (ic_count == 12)
                    {
                        cc_no = app_icno.Rows[0]["app_applcn_no"].ToString();
                    }
                    else
                    {
                        cc_no = Applcn_no.Text;
                    }

                    string sav_amt = string.Empty, emnth = string.Empty;
                    string s_1 = "51000.00";
                    string s_2 = "101000.00";
                    string s_3 = "201000.00";
                    string s_4 = "300000.00";
                    if (app_icno.Rows[0]["app_loan_type_cd"].ToString() != "P")
                    {
                        //sav_amt = ((0.1 / 100) * double.Parse(a1)).ToString("C").Replace("$","").Replace("RM", "");
                        emnth = "28";
                        if (double.Parse(app_icno.Rows[0]["app_loan_amt"].ToString()) < double.Parse(s_1))
                        {
                            sav_amt = "50.00";
                        }
                        else if (double.Parse(app_icno.Rows[0]["app_loan_amt"].ToString()) < double.Parse(s_2))
                        {
                            sav_amt = "100.00";
                        }
                        else if (double.Parse(app_icno.Rows[0]["app_loan_amt"].ToString()) < double.Parse(s_3))
                        {
                            sav_amt = "200.00";
                        }
                        else if (double.Parse(app_icno.Rows[0]["app_loan_amt"].ToString()) <= double.Parse(s_4))
                        {
                            sav_amt = "300.00";
                        }
                    }
                    else
                    {
                        sav_amt = "0.00";
                    }

                    DataSet   ds    = new DataSet();
                    DataTable dt    = new DataTable();
                    string    c_jbb = string.Empty;

                    dt = Dblog.Ora_Execute_table("select * from (SELECT jn.tpj_applcn_no as tpj_applcn_no,FORMAT(jn.tpj_pay_date,'dd/MM/yyyy', 'en-us') as p_dt, case(ISNULL(jn.tpj_loan_amt,'')) when '0.00' then '' else ISNULL(jn.tpj_loan_amt,'') end as l_amt,jn.tpj_seq_no as seq_no,ISNULL(jn.tpj_approve_amt,'') as a_amt,ISNULL(jn.tpj_profit_amt,'') as pr_amt,ISNULL(case when CONVERT(DATE, jn.tpj_actual_pay_date) = '1900-01-01' then '' else CONVERT(CHAR(10), FORMAT(jn.tpj_actual_pay_date,'dd/MM/yyyy', 'en-us'), 103) END, '') as ap_dt,ISNULL(jn.tpj_pay_amt,'') as p_amt,ISNULL(jn.tpj_actual_pay_amt,'') as ap_amt,ISNULL(jn.tpj_late_excess_amt,'') as le_amt,ISNULL(jn.tpj_saving_amt,'') as sa_amt,ISNULL(jn.tpj_actual_saving_amt,'') as as_amt,ISNULL(jn.tpj_saving_late_excess_amt,'') as sle_amt,ISNULL(jn.tpj_total_pay_amt,'') as tp_amt,ISNULL(jn.tpj_balance_amt,'') as bal_amt,ISNULL(jn.tpj_total_saving_amt,'') as ts_amt,jn.tpj_day_late as dlate,ISNULL(jn.tpj_principal_amt,'') as priamt,ISNULL(jn.tpj_daily_profit_amt,'') as dproamt FROM jpa_jbb_temp_pjs  as jn where jn.tpj_applcn_no='" + cc_no + "' ) as a full outer join (select tpj_applcn_no,sum(tpj_pay_amt) as tot_pamt,sum(tpj_actual_pay_amt) as tot_apamt,sum(tpj_saving_amt) as tot_samt,sum(tpj_actual_saving_amt) as tot_asamt,sum(tpj_total_pay_amt) as tot_tpamt,sum(tpj_principal_amt) as tot_priamt,sum(tpj_daily_profit_amt) as tot_dproamt from jpa_jbb_temp_pjs where tpj_applcn_no='" + cc_no + "' group by tpj_applcn_no) as b on b.tpj_applcn_no=a.tpj_applcn_no full outer join (select * from jpa_calculate_fee as jc where jc.cal_applcn_no='" + cc_no + "') as c on c.cal_applcn_no=b.tpj_applcn_no full outer join (select ja.app_cumm_saving_amt as acs_amt,ja.app_applcn_no as app_no,ja.appl_loan_dur as a_dur,ja.app_name as a_name,ja.app_new_icno as a_icno,rjp.Description from jpa_application as ja left join Ref_Jenis_Pelaburan as rjp on rjp.Description_Code=ja.app_loan_type_cd where ja.app_applcn_no = '" + cc_no + "') as d on d.app_no=c.cal_applcn_no");


                    Rptviwer_lt.Reset();
                    ds.Tables.Add(dt);

                    Rptviwer_lt.LocalReport.DataSources.Clear();

                    Rptviwer_lt.LocalReport.ReportPath = "Pelaburan_Anggota/permohonan_pjs.rdlc";
                    ReportDataSource rds = new ReportDataSource("p_pjs", dt);

                    ReportParameter[] rptParams = new ReportParameter[] {
                        new ReportParameter("samt", sav_amt)
                    };


                    Rptviwer_lt.LocalReport.SetParameters(rptParams);

                    Rptviwer_lt.LocalReport.DataSources.Add(rds);

                    //Refresh
                    Rptviwer_lt.LocalReport.Refresh();
                    Warning[] warnings;

                    string[] streamids;

                    string mimeType;

                    string encoding;

                    string extension;

                    string fname = DateTime.Now.ToString("dd_MM_yyyy");

                    string devinfo = "   <DeviceInfo><ColorDepth>32</ColorDepth><DpiX>350</DpiX><DpiY>350</DpiY><OutputFormat>PDF</OutputFormat>" +
                                     "   <PageWidth>12.20in</PageWidth>" +
                                     "   <PageHeight>8.27in</PageHeight>" +
                                     "   <MarginTop>0.1in</MarginTop>" +
                                     "   <MarginLeft>0.5in</MarginLeft>" +
                                     "   <MarginRight>0in</MarginRight>" +
                                     "   <MarginBottom>0in</MarginBottom>" +
                                     "   </DeviceInfo>";

                    byte[] bytes = Rptviwer_lt.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);

                    Response.Buffer = true;

                    Response.Clear();

                    Response.ClearHeaders();

                    Response.ClearContent();

                    Response.ContentType = "application/pdf";

                    Response.AddHeader("content-disposition", "attachment; filename=PERMOHONAN_PJS_" + cc_no + "." + extension);

                    Response.BinaryWrite(bytes);

                    Response.Flush();

                    //Response.End();
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukkan Input Carian',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                }
                grid();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
Ejemplo n.º 8
0
    protected void click_print(object sender, EventArgs e)
    {
        {
            try
            {
                grid();
                if (Applcn_no.Text != "")
                {
                    //Path
                    var       ic_count1 = Applcn_no.Text.Length;
                    DataTable app_icno1 = new DataTable();
                    app_icno1 = DBCon.Ora_Execute_table("select app_applcn_no from jpa_application JA where JA.app_new_icno= '" + Applcn_no.Text + "'");
                    if (ic_count1 == 12)
                    {
                        cc_no1 = app_icno1.Rows[0]["app_applcn_no"].ToString();
                    }
                    else
                    {
                        cc_no1 = Applcn_no.Text;
                    }
                    DataSet   ds = new DataSet();
                    DataTable dt = new DataTable();
                    dt = DBCon.Ora_Execute_table("select * from (select ja.app_applcn_no,JA.app_new_icno,JA.app_name,RW.Wilayah_Name,ISNULL(RB.branch_desc, '') AS branch_desc,JA.app_loan_amt,JA.appl_loan_dur from jpa_application as JA  Left Join jpa_calculate_fee as JC ON JC.cal_applcn_no=JA.app_applcn_no Left Join Ref_Wilayah as RW ON RW.Wilayah_Code=JA.app_region_cd Left join ref_branch AS RB ON RB.branch_cd=JA.app_branch_cd where JA.app_applcn_no='" + cc_no1 + "') as a full outer join (select * from jpa_call_log where log_applcn_no='" + cc_no1 + "') as b on a.app_applcn_no = b.log_applcn_no order by b.log_seq_no");

                    Rptviwer_lt.Reset();
                    ds.Tables.Add(dt);

                    Rptviwer_lt.LocalReport.DataSources.Clear();

                    Rptviwer_lt.LocalReport.ReportPath = "Pelaburan_Anggota/log_tugasan.rdlc";
                    ReportDataSource rds = new ReportDataSource("l_tugasan", dt);

                    Rptviwer_lt.LocalReport.DataSources.Add(rds);

                    //Refresh
                    Rptviwer_lt.LocalReport.Refresh();
                    Warning[] warnings;

                    string[] streamids;

                    string mimeType;

                    string encoding;

                    string extension;

                    string fname = DateTime.Now.ToString("dd_MM_yyyy");

                    string devinfo = "<DeviceInfo><ColorDepth>32</ColorDepth><DpiX>350</DpiX><DpiY>350</DpiY><OutputFormat>PDF</OutputFormat>" +
                                     "  <PageWidth>12.20in</PageWidth>" +
                                     "  <PageHeight>8.27in</PageHeight>" +
                                     "  <MarginTop>0.1in</MarginTop>" +
                                     "  <MarginLeft>0.5in</MarginLeft>" +
                                     "  <MarginRight>0in</MarginRight>" +
                                     "  <MarginBottom>0in</MarginBottom>" +
                                     "</DeviceInfo>";

                    byte[] bytes = Rptviwer_lt.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);


                    Response.Buffer = true;

                    Response.Clear();

                    Response.ClearHeaders();

                    Response.ClearContent();

                    Response.ContentType = "application/pdf";


                    Response.AddHeader("content-disposition", "attachment; filename=LOG_TUGASAN_" + cc_no1 + "." + extension);

                    Response.BinaryWrite(bytes);

                    //Response.Write("<script>");
                    //Response.Write("window.open('', '_newtab');");
                    //Response.Write("</script>");
                    Response.Flush();

                    Response.End();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Medan Input Adalah Mandatori',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }