 |
|
พอจะมีแนวทาง ดึงข้อมูลแถวที่ติ๊กใน checkbox จาก gridview มาแสดงใน crystal report ไหมครับ |
|
 |
|
|
 |
 |
|
string usercodes = string.Empty;
foreach (GridViewRow row in gridViewUser.Rows)
{
CheckBox ChkUser = (CheckBox)row.FindControl("chkUser");
if (ChkUser.Checked == true)
{
if (!string.IsNullOrEmpty(usercodes))
usercodes += ",";
Label lbl = (Label)row.FindControl("lblUserCode");
usercodes += Convert.ToString("'" + lbl.Text + "'");
}
}
if (!string.IsNullOrEmpty(usercodes))
{
DataTable dt = respository.SelectApplicationByUser(dropDownListAppName.SelectedValue.ToString(), usercodes, ConnectionString.ConnectionValue);
ReportDocument crReportDocument = PrintReport(dt, dropDownListAppName.SelectedValue.ToString(), usercodes);
System.Web.HttpResponse response = this.Page.Response;
Extenstions.PrintPDF(crReportDocument,Resources.AppToUserRes.pdf_filename,response);
}
else
{
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", ScriptsBuilder.OpenDialog("#warningDialog", Resources.DialogRes.title_warning, Resources.DialogRes.no_usercodes_selected), true);
}
|
 |
 |
 |
 |
Date :
2014-02-20 13:46:12 |
By :
oami |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลืมบอกครับว่า พอกดปุ่ม print ให้แสดง crystal report ขึ้นมาเลย ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2014-02-20 15:21:52 |
By :
Help me krub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|