更正此代码 [英] correct this code
问题描述
hai
我正在学习如何在c#中的datagridviewer中打印数据
使用了以下代码...但是出现错误数组列表无法转换为int"
是否可以更正..?或其他任何代码
< title>错误:无法检索到所请求的URL
错误
无法检索到所请求的URL
hai
i am learning how to print data in a datagridviewer in c#
the following code is used...but it has error "array list cannot be converted into int"
do it can be corrected..?or anyother codes
<title>ERROR: The requested URL could not be retrieved
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL:
http://www.codeproject.com/script/content/ajax/SniffCode.aspx?text=printing%20datagridview%0Aprivate%20StringFormat%20m_stringFormat%3B%0Aprivate%20double%20m_totalWidth%3B%0Aprivate%20int%20m_rowPos%3B%0Aprivate%20bool%20m_newPage%3B%0Aprivate%20int%20m_pageNo%3B%0Aprivate%20string%20m_pageHeader%20%3D%20%22Header%22%3B%0Aprivate%20string%20m_userName%20%3D%20%22Printed%20by%20%3Cusername%3E%22%3B%0Aprivate%20ArrayList%20m_columnLefts%20%3D%20new%20ArrayList()%3B%0Aprivate%20ArrayList%20m_columnWidths%20%3D%20new%20ArrayList()%3B%0Aprivate%20int%20m_pageHeight%20%3D%200%3B%0Aprivate%20int%20m_pageCount%20%3D%200%3B%0Aprivate%20void%20printDocument1_BeginPrint(object%20sender%2C%20System.Drawing.Printing.PrintEventArgs%20e)%0A%7B%0Am_stringFormat%20%3D%20new%20StringFormat()%3B%0Am_stringFormat.Alignment%20%3D%20StringAlignment.Near%3B%0Am_stringFormat.LineAlignment%20%3D%20StringAlignment.Center%3B%0Am_stringFormat.Trimming%20%3D%20StringTrimming.EllipsisCharacter%3B%0Am_totalWidth%20%3D%200%3B%0Aforeach%20(DataGridViewColumn%20oColumn%20in%20dataGridView1.Columns)%0A%7B%0Am_totalWidth%20%2B%3D%20oColumn.Width%3B%0A%7D%0Am_pageNo%20%3D%201%3B%0Am_newPage%20%3D%20true%3B%0Am_rowPos%20%3D%200%3B%0A%7D%0Aprivate%20void%20printDocument1_PrintPage(object%20sender%2C%20System.Drawing.Printing.PrintPageEventArgs%20e)%0A%7B%0Aint%20nWidth%2C%20i%3B%0Adouble%20nRowsPerPage%20%3D%200%3B%0Aint%20nTop%20%3D%20e.MarginBounds.Top%3B%0Aint%20nLeft%20%3D%20e.MarginBounds.Left%3B%0Aif%20(m_pageNo%20%3D%3D%201)%0A%7B%0Am_columnLefts.Clear()%3B%0Am_columnWidths.Clear()%3B%0Am_pageHeight%20%3D%200%3B%0Am_pageCount%20%3D%200%3B%0Aforeach%20(DataGridViewColumn%20oColumn%20in%20dataGridView1.Columns)%0A%7B%0Adouble%20floorVal%20%3D%20Convert.ToDouble(%20oColumn.Width%20)%20%2F%20m_totalWidth%20*%20m_totalWidth%20*%20(Convert.ToDouble(%20e.MarginBounds.Width)%20%2F%20m_totalWidth)%3B%0AnWidth%20%3D%20Convert.ToInt32(Math.Floor(floorVal))%3B%0Am_pageHeight%20%3D%20Convert.ToInt32(e.Graphics.MeasureString(oColumn.HeaderText%2C%20oColumn.
遇到以下错误:
The following error was encountered:
-
无效的URL
Invalid URL
请求的URL的某些方面不正确.可能的问题:
Some aspect of the requested URL is incorrect. Possible problems:
- 缺少或不正确的访问协议(应为"http://''''或类似名称)
- 缺少主机名
- URL路径中的非法两次转义符
- 主机名中的非法字符;不允许使用下划线
- Missing or incorrect access protocol (should be `http://'''' or similar)
- Missing hostname
- Illegal double-escape in the URL-Path
- Illegal character in hostname; underscores are not allowed
您的缓存管理员是 root .
Your cache administrator is root.
推荐答案
请不要多次发布相同的问题.如果需要添加任何内容,请编辑原件.另外,请预览您发布的内容.上面的内容看起来像是失败的Web查找的复制和粘贴,它没有提供有用的信息.
Please do not post the same question multiple times. Edit the original if you need to add anything. Also please preview what you have posted. The above looks like a copy and paste of a failed web lookup, it provides no useful information.
这篇关于更正此代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!