Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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:




  • Invalid URL




Some aspect of the requested URL is incorrect. Possible problems:


  • 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

Your cache administrator is root.






Generated Thu, 28 Jan 2010 11:52:13 GMT by xavy (squid/2.6.STABLE21)























3
Posted

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900