如:
本来的
<td width=\"15\"  align=\"left\" fontname=\"宋体\" fontsize=\"9\" fontcolor=\"Black\" b=\"false\" i=\"false\" u=\"false\" bgcolor=\"White\" Circle=\"NFILL\">0</td>");
已经可以改成
<td width=\"15\" >0</td>");
但这里面的width=\"15\"
我想在打印中设成百分比那个RemotePrint里面要改哪里

解决方案 »

  1.   

    RemotePrint里面那个程序就是打印的
    而程序里面的getData.aspx是生成一个xml文件
    把xml文件发送给RemotePrint他就根据这个xml里面的东西画出打印的页面
      

  2.   

    要看你这个控件后台是怎么解析这个xml的.
      

  3.   

    我发到你邮箱了
    我想添加一个valing做找不到相应的属性
      

  4.   

    Table.Cs的DrawTr方法:
    private void DrawTR(int x, int y, XmlNode tr, Pen pen, Graphics g)
    {
    int height = int.Parse(tr.Attributes["height"].InnerText);
    int width;
    //g.DrawLine(pen, x, y, x, y + height);//画左端线条
               
    foreach(XmlNode td in tr)
    {
     
                    
                    string swidth = td.Attributes["width"].InnerText;
                    if (swidth.Substring(swidth.Length - 1, 1) == "%")
                    {
                        swidth = swidth.Substring(0, swidth.Length - 1);                    width = Convert.ToInt32(Convert.ToInt32(swidth) * this.GrphicWidth / 100);                    //g.DrawString("宽度:"+this.GrphicWidth, new Font("宋体", 12), new SolidBrush(Color.Green),new RectangleF(0,0,100,100));
                    }
                    else
                    {
                        width = int.Parse(td.Attributes["width"].InnerText);
                    }
    DrawTD(x, y, width, height, td, g);
    //g.DrawLine(pen, x + width, y, x + width, y + height);//右线
    //g.DrawLine(pen, x, y + height, x + width, y + height);//底线
    x += width;
    }
    }
      

  5.   

    PrintControl.cs 的 printDocument1_PrintPage方法private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
    {
    Graphics g = e.Graphics;

    bool HasMorePages = false;
    PrintElement printElement = null;

    foreach(XmlNode node in doc["root"]["reporttable"].ChildNodes)
    {
    printElement = Parser.CreateElement(node,this.printDocument1.DefaultPageSettings.Bounds.Width);//调用解析器生成相应的对象
    try
    {
    HasMorePages = printElement.Draw(g);//是否需要分页
    }
    catch(Exception ex)
    {
    this.label1.Text = ex.Message;
    }
    } //在页底中间输出页码
    // Font font = new Font("黑体", 12.0f);
    // Brush brush = new SolidBrush(Color.Black);
    // g.DrawString("第" + Pages.ToString() + " 页",
    // font,brush,e.MarginBounds.Width / 2 + e.MarginBounds.Left - 30, 
    // e.PageBounds.Height - 60); if(HasMorePages)
    {
    Pages++;
    }
    e.HasMorePages = HasMorePages; }
      

  6.   

    Parser.cs的CreateElement方法public static PrintElement CreateElement(XmlNode element,int iWidth)
    {
    PrintElement printElement = null;
    switch(element.Name)
    {
    case "text":
                        printElement = new Text(element);
    break;
    case "table":
                        printElement = new Table(element, iWidth);
    break;
    default:
    printElement = new PrintElement();
    break;
    }
    return printElement;
    }
      

  7.   

    table.cs中声明一个变量 private int GrphicWidth;修改构造函数: 
    public Table(XmlNode Table,int iwdth)
    {
    table = Table;
                this.GrphicWidth = iwdth;
    }
      

  8.   

    说明:在输出报表前,先把当前设置的页面的绝对宽度传到Table类中,画的时候要用到这个宽度画td的时候如果遇到百分比的宽度,换成绝对宽度再输出.
      

  9.   

    说明:在输出报表前,先把当前设置的页面的绝对宽度传到Table类中,画的时候要用到这个宽度画td的时候如果遇到百分比的宽度,换成绝对宽度再输出.
    --------------------------------------
     Response.Write("<tr height=\"20\">");
                            Response.Write("<td width='20%'>  单日成人票</td>");
                            Response.Write("<td width='50%'  >0</td>");
                            Response.Write("<td width=\"15\"  >1</td>");
                            Response.Write("<td width=\"15\"  >2</td>");
                            Response.Write("<td width=\"15\"  >3</td>");
                            Response.Write("<td width=\"15\"  >4</td>");
                            Response.Write("<td width=\"95\"  >5</td>");
    我这样已经可以正确了上面的“说明”
    是要我注意什么
    谢谢