Hello Telerik folks,can You help here
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
AutoGenerateColumns="false" onitemcommand="RadGrid1_ItemCommand">
<MasterTableView AutoGenerateColumns="false">
<Columns>
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="employeenaem" HeaderText="EmployeeName">
<ItemTemplate>
<%#Eval("Employeename") %>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="employeeDesgination" HeaderText="EmployeeDesignation">
<ItemTemplate>
<%#Eval("EmployeeDesignation")%>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Salary" HeaderText="salary">
<ItemTemplate>
<%#Eval("EmployeeSalary") %>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<telerik:RadButton ID="RadButton1" runat="server" Text="Print"
onclick="RadButton1_Click">
</telerik:RadButton>
.aspx.cs
protected void RadButton1_Click(object sender, EventArgs e)
{
PrintDocument pd = new PrintDocument();
foreach (GridDataItem item1 in RadGrid1.MasterTableView.Items)
{
CheckBox ChkedList = (CheckBox)item1.FindControl("CheckBox1");
if (ChkedList.Checked)
{
Index = item1.ItemIndex;
DrawImage();
}
}
}
public void DrawImage()
{
if (m_oConn.State != ConnectionState.Closed)
{
m_oConn.Open();
}
m_oCmd = new MySqlCommand("select * from printtest",m_oConn);
DataSet ds = new DataSet();
m_aDp = new MySqlDataAdapter(m_oCmd);
m_aDp.Fill(ds);
string dempname,dempdesg;
decimal dsalary;
dempname=(string)ds.Tables[0].Rows[Index]["Employeename"];
dempdesg=(string)ds.Tables[0].Rows[Index]["EmployeeDesignation"];
dsalary=(decimal)ds.Tables[0].Rows[Index]["EmployeeSalary"];
string drawString2 = string.Empty;
Graphics g;
Bitmap b;
Page p;
b = new Bitmap(790, 1050);
g = Graphics.FromImage(b);
p = this.Page;
p.Response.ContentType = "image/jpeg";
g.FillRectangle(new SolidBrush(Color.White), 0, 0, 790, 325);
g.FillRectangle(new SolidBrush(Color.White), 0, 325, 790, 1050)
FontFamily fm1 = new FontFamily("Consolas");
Font drawFont = new Font(fm1, 12);
Font drFont = new Font("Arial", 8);
Font drFont1 = new Font("Arial", 9);
Font drsmallFont = new Font("Arial", 8);
Font drnarrowFont = new Font("Arial Narrow", 8);
Font drnarrowFont1 = new Font("Verdana,sans-serif", 8);
Font drarialblackFont = new Font("Arial Black", 10);
SolidBrush drawBrush = new SolidBrush(Color.Black);
PointF drawPoint = new PointF(140.0F, 290.0F);
Pen pn = new Pen(drawBrush);
string path = Server.MapPath("images/InfoImg.png");
Bitmap logo = new Bitmap(path);
Graphics gra = Graphics.FromImage(logo);
g.DrawImage(logo, 15.0F, 30.0F);
ImageConverter ic = new ImageConverter();
g.DrawString("PAY TO THE ORDER OF ____" + "__________________________________________________________________", drnarrowFont1, drawBrush, 15.0F, 120.0F);
g.DrawString(dempname + "is worked as " + dempdesg + "and erans" + dsalary, drnarrowFont1, drawBrush, 145.0F, 117.0F);
b.Save(p.Response.OutputStream, ImageFormat.Jpeg);
}
Here ...I want to print the .....Data That in database....not current document......based user select Data-rows and then click on Print.. ...presently. I want to print the Multiple Image files...based on user selected rows ..only one Image Show in page......I don't want to show printing information ..I want to Print ...Image files......I search many website...I am not getting results.....That why I am post the thread...
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
AutoGenerateColumns="false" onitemcommand="RadGrid1_ItemCommand">
<MasterTableView AutoGenerateColumns="false">
<Columns>
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="employeenaem" HeaderText="EmployeeName">
<ItemTemplate>
<%#Eval("Employeename") %>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="employeeDesgination" HeaderText="EmployeeDesignation">
<ItemTemplate>
<%#Eval("EmployeeDesignation")%>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Salary" HeaderText="salary">
<ItemTemplate>
<%#Eval("EmployeeSalary") %>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<telerik:RadButton ID="RadButton1" runat="server" Text="Print"
onclick="RadButton1_Click">
</telerik:RadButton>
.aspx.cs
protected void RadButton1_Click(object sender, EventArgs e)
{
PrintDocument pd = new PrintDocument();
foreach (GridDataItem item1 in RadGrid1.MasterTableView.Items)
{
CheckBox ChkedList = (CheckBox)item1.FindControl("CheckBox1");
if (ChkedList.Checked)
{
Index = item1.ItemIndex;
DrawImage();
}
}
}
public void DrawImage()
{
if (m_oConn.State != ConnectionState.Closed)
{
m_oConn.Open();
}
m_oCmd = new MySqlCommand("select * from printtest",m_oConn);
DataSet ds = new DataSet();
m_aDp = new MySqlDataAdapter(m_oCmd);
m_aDp.Fill(ds);
string dempname,dempdesg;
decimal dsalary;
dempname=(string)ds.Tables[0].Rows[Index]["Employeename"];
dempdesg=(string)ds.Tables[0].Rows[Index]["EmployeeDesignation"];
dsalary=(decimal)ds.Tables[0].Rows[Index]["EmployeeSalary"];
string drawString2 = string.Empty;
Graphics g;
Bitmap b;
Page p;
b = new Bitmap(790, 1050);
g = Graphics.FromImage(b);
p = this.Page;
p.Response.ContentType = "image/jpeg";
g.FillRectangle(new SolidBrush(Color.White), 0, 0, 790, 325);
g.FillRectangle(new SolidBrush(Color.White), 0, 325, 790, 1050)
FontFamily fm1 = new FontFamily("Consolas");
Font drawFont = new Font(fm1, 12);
Font drFont = new Font("Arial", 8);
Font drFont1 = new Font("Arial", 9);
Font drsmallFont = new Font("Arial", 8);
Font drnarrowFont = new Font("Arial Narrow", 8);
Font drnarrowFont1 = new Font("Verdana,sans-serif", 8);
Font drarialblackFont = new Font("Arial Black", 10);
SolidBrush drawBrush = new SolidBrush(Color.Black);
PointF drawPoint = new PointF(140.0F, 290.0F);
Pen pn = new Pen(drawBrush);
string path = Server.MapPath("images/InfoImg.png");
Bitmap logo = new Bitmap(path);
Graphics gra = Graphics.FromImage(logo);
g.DrawImage(logo, 15.0F, 30.0F);
ImageConverter ic = new ImageConverter();
g.DrawString("PAY TO THE ORDER OF ____" + "__________________________________________________________________", drnarrowFont1, drawBrush, 15.0F, 120.0F);
g.DrawString(dempname + "is worked as " + dempdesg + "and erans" + dsalary, drnarrowFont1, drawBrush, 145.0F, 117.0F);
b.Save(p.Response.OutputStream, ImageFormat.Jpeg);
}
Here ...I want to print the .....Data That in database....not current document......based user select Data-rows and then click on Print.. ...presently. I want to print the Multiple Image files...based on user selected rows ..only one Image Show in page......I don't want to show printing information ..I want to Print ...Image files......I search many website...I am not getting results.....That why I am post the thread...