GridView 확인란을 기반으로 보고서를 인쇄하려고합니다. 3 행을 선택했다면 3 개의 보고서 여야합니다. 내 코드 ASP.NET GridView, RDLC를 사용하여 여러 보고서를 인쇄하는 방법?
protected void btn_Print_Click(object sender, EventArgs e)
{
if (IsPostBack)
{
try
{
foreach (GridViewRow gvr in grdRV.Rows)
{
RadioButton rbID = (RadioButton)gvr.FindControl("rbID") as RadioButton;
if (rbID != null && rbID.Checked)
{
string sID = grdRV.DataKeys[gvr.RowIndex].Value.ToString().Trim();
if (rbl_Print.SelectedValue == "0")
{
SMTP(sID);
}
else if (rbl_Print.SelectedValue == "1")
{
Material(sID);
}
}
}
}
catch (Exception ex)
{
Session["error"] = ex.Message;
Response.Redirect("MessageBoard.aspx");
}
}
}
private void Material(string sID)
{
string querystring = "../pmis/Reports/RptRFQMatV.aspx?RFQNo=" + lblRFQNo.Text.ToString() + "&ID=" + sID;
Random r = new Random();
string Script = "";
Script += "<script language=JavaScript id='PopupWindow'>";
Script += "confirmWin = window.open(' " + querystring + "','" + r.Next() + "','scrollbars=yes,resizable=1, width=960,height=500,left=50,top=130,status');";
Script += "confirmWin.Setfocus()</script>";
//ClientScript.RegisterStartupScript(typeof(string), "PopupScript", "PopupWindow");
if (!ClientScript.IsClientScriptBlockRegistered("PopupWindow"))
ClientScript.RegisterClientScriptBlock(typeof(string), "PopupWindow", Script);
}
현재이 코드는 누가 나를 도울 수 ... 마지막 행을보고 인쇄 할 수 있습니다 ...이처럼? 감사합니다
이 코드에 중단 점을 설정하면 어떻게됩니까? 왜 당신이 기대하는 3을 잡지 못하는 걸까요? –
@ p.campbell : 3 개의 행을 선택했다고 가정 해 보겠습니다. 3 개의 ID가 있습니다. 예 : A0031, A0027, A0051. 먼저 A0031은 A0027을 마친 후 A0051을 마친 후 재질 블록으로 이동합니다. 따라서 A0051에 대해서만 보고서가 나옵니다. 다른 두 ID는 나오지 않습니다. 덮어 쓰기 또는 뭔가있을 수 있습니다 ... – CMMaung