PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Value was either too large or too small for an unsigned byte

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Bug Reports - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
pavalisoft



Joined: 22 Dec 2007
Posts: 1

PostPosted: Sat Dec 22, 2007 6:56 am    Post subject: Value was either too large or too small for an unsigned byte Reply with quote

Hi,
While i am programmin using table using sharpDPF, i am getting the fillowing error "Value was either too large or too small for an unsigned byte."

the code for this is as follows...

pdfTable myTable = new pdfTable();
myTable.borderSize = 0;
myTable.borderColor = predefinedColor.csWhite;
myTable.cellpadding = 1;
myTable.tableHeaderStyle = new pdfTableRowStyle(predefinedFont.csHelvetica, 0, predefinedColor.csBlack, predefinedColor.csWhite);
myTable.rowStyle = new pdfTableRowStyle(predefinedFont.csHelvetica, 14, predefinedColor.csBlack, predefinedColor.csWhite);
myTable.tableHeader.addColumn(new pdfTableColumn("title", predefinedAlignment.csCenter, 570));

int titleCount = objProposalData.DsProposalData.Tables[0].Rows[0]["secondaryGoal"].ToString().Trim().Length;
int titleRows = (int)Math.Ceiling((double)titleCount / 64);
string[] titleStrings = new string[titleRows];
for (int i = 0; i < titleRows ; i++)
{
if (i == (titleRows - 1))
titleStrings[i] = objProposalData.DsProposalData.Tables[0].Rows[0]["secondaryGoal"].ToString().Substring(i * 64, titleCount - ((i * 64)));
else
{
if(i==0 & titleCount <=64)
titleStrings[i] = objProposalData.DsProposalData.Tables[0].Rows[0]["secondaryGoal"].ToString().Trim().Substring(i * 64, titleCount);
else
titleStrings[i] = objProposalData.DsProposalData.Tables[0].Rows[0]["secondaryGoal"].ToString().Trim().Substring(i * 64, 64);
}
//pdfTableRow myRow = myTable.createRow();
//myRow[0].columnAlign = predefinedAlignment.csCenter;
//if (i == (titleRows - 1))
//{
// myRow[0].columnValue = objProposalData.DsProposalData.Tables[0].Rows[0]["secondaryGoal"].ToString().Substring(i * 64, titleCount - ((i * 64) + 2));
//}
//else
//{
// if (i == 0 & titleCount <= 64)
// {
// myRow[0].columnValue = objProposalData.DsProposalData.Tables[0].Rows[0]["secondaryGoal"].ToString().Trim().Substring(i * 64, titleCount);
// }
// else
// {
// myRow[0].columnValue = objProposalData.DsProposalData.Tables[0].Rows[0]["secondaryGoal"].ToString().Trim().Substring(i * 64, 64);
// }
//}
//myTable.addRow(myRow);
}
foreach (string newString in titleStrings)
{
pdfTableRow myRow = myTable.createRow();
myRow[0].columnAlign = predefinedAlignment.csCenter;
myRow[0].columnValue = newString.Trim();
myTable.addRow(myRow);
myRow = null;
}

myPage.addTable(myTable, 21, 771);
myTable = null;

Please any one tell me why the error is occuring.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Bug Reports - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com