|
Why did you ask this, delete your post, and ask it again ?
Why do you need a dataset with thousands of rows ? Wouldn't it be better to ask for the data in the form you want it ? Why do you need to break it up ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Can someone tell me or refer me to an example of how to print data from a datatable please? I need to get the data from a data table and print it in a report. Thanks.
|
|
|
|
|
use Crystal report
wasim khan
|
|
|
|
|
Best option, use Crystal Report and print it as your custome format
|
|
|
|
|
hi have to print my datagrid values like this........
Printed out should be like
Pepsi 500ml £1.09 coke 500ml £1.09
Fanta 500ml £1.09 Sprite 500ml .99p
but i am getting print out like......
Pepsi 500ml £1.09
coke 500ml £1.09
Fanta 500ml £1.09
Sprite 500ml .99p
|
|
|
|
|
Wow - I answer your question, so you repost it ? Why didn't you respond to my answer ? It's clear to me from the code you posted that you're getting by copying and pasting code you find on the internet and do not understand. If you remotely understood the code you posted, this change would be trivial for you. Either way, I explained how to do it.
If you don't understand something when it's explained to you, ask on the same thread. Don't repost, it makes you look rude, and it also leaves us with the feeling that you're looking for a complete cut and paste solution because you're too lazy to learn how to do it yourself. I can write this code for you, but I prefer to encourage people to learn for themselves. That tends to help people who want to be programmers, and cut out people who just want to take on work and get us to do it for them.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
sorry one of my frind posted it again...
|
|
|
|
|
You have two people sharing an account, and trying between you to work out how to print items in two columns ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
now i got some idea from u thank u very much
|
|
|
|
|
>>Sorry my friend posted it again.
Who is your friend?
cse.vidiya>>It's another bot.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
|
|
You want to split hte data between two datasets ? Did you have a use for the full dataset as well, or would you be best to handle this by getting the two sets from your data source in the first place?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Please Don't Delete Any message
|
|
|
|
|
Abhijit Jana wrote: Please Don't Delete Any message
There are no such thing as stupid questions, only stupid people, right?
|
|
|
|
|
leppie wrote: There are no such thing as stupid questions, only stupid people, right?
Nope. I'm pretty sure that there are stupid questions. My wife keeps me well informed when she thinks I hit the mark.
|
|
|
|
|
I'm using XP and I can't search eventlogs for a specific string like vista.
is there any tool to do that?
|
|
|
|
|
From Eventviewer -> View -> Filter, you can filter Data.
If you want search String, you can create your custome Tool. and i thing that you can do with some Effort.
|
|
|
|
|
hello does someone know how to put a code in one of the treeview nodes???
i want every nodes to open differennt window forms..
how can i do it??
please some sample codes.. i really appreciate it,
ginji
|
|
|
|
|
Well, I assume the nodes have a tag property. You could set that, handle the selected node changed event, check the tag and based on that, open a form.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi ginji
do not Cry too much its not good for ur health and it never make you a good developer.
check the tree node events there is event call on node click in this event
<br />
<br />
if(e.Node ==Name of the Node)<br />
{<br />
Form2 obj = new Form2();<br />
obj.Show();<br />
<br />
}<br />
wasim khan
|
|
|
|
|
i want the flag true in if condition c the if condition and c the comments plz thx
just put a button on form and past those methods
private void button2_Click(object sender, EventArgs e)
{
CheckRegistration("your email here@any.com", "your reg code here");
}
public bool CheckRegistration(string _regMail, string _regCode)
{
bool flag = false;
non = _regCode;
if (((_regMail.Length > 5) && (_regCode.Length > 7)) && GetRegCode(_regMail).Equals(_regCode))
{
flag = true;
int k = 0;
}
MessageBox.Show(flag.ToString());
return flag;
}
private static int ConvReg(char _c)
{
int num = 0x2a;
char[] chArray = new char[] {
'q', '1', 'c', 'a', 'x', 'l', '-', '7', 'u', 'd', '3', 'b', '2', '9', 'n', 'g',
'f', 'v', 't', 'j', 'k', '5', 'm', 'e', 'o', 'p', '6', '@', 's', 'i', '8', 'h',
'w', '4', 'y', '_', '0', 'r', '.', 'z'
};
for (int i = 0; i < chArray.Length; i++)
{
if (_c == chArray[i])
{
num = i;
}
}
return num;
}
public static string GetRegCode(string _regMail)
{
string str = "2X";
if (_regMail.Length > 5)
{
char[] chArray = _regMail.ToLower().ToCharArray();
int index = _regMail.IndexOf("@");
str = (((str + ConvReg(chArray[0]).ToString()) + ConvReg(chArray[1]).ToString() + ConvReg(chArray[index - 1]).ToString()) + _regMail.Length.ToString() + ConvReg(chArray[index + 1]).ToString()) + ConvReg(chArray[index + 2]).ToString() + ConvReg(chArray[_regMail.Length - 1]).ToString();
}
return str;
}
its me yami
now cheers
|
|
|
|
|
I am at a loss to understand what you're asking. Which bit of code do you have a problem with ?
If the mail address and code are long enough, then the input to the program determines if it's true or not. We can't make it true in code, without short circuiting the logic that checks if it should be true.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
theredonion wrote:
Christian Graus wrote:If the mail address and code are long enough, then the input to the program determines if it's true or not. We can't make it true in code, without short circuiting the logic that checks if it should be true.
how to do short circuit. i just want those parameters which can make if condition true is it posible please help me!
like if i send parameters (myemail@yahoo.com,abc123); if this makes the if condition true then i need these parameters how it posible or which parameters should i send which make the if condition true thx
its me yami
now cheers
Reply to the forums, don't email me.
Did you not write this code ? I'm assuming now that you've used reflection to read the registration code for a piece of software you want to steal, and you can't work out how to reverse engineer this process to do it.
If you wrote the code, then you should know how to create codes that work with it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi,
i am print concept to print the dtagrid rows.....
i am using c# coding......
while taking the print i am getting output as(givn below)....
Pepsi 500ml £1.09
coke 500ml £1.09
Fanta 500ml £1.09
Sprite 500ml .99p
but my uotput should be like the given below......
Pepsi 500ml £1.09 coke 500ml £1.09
Fanta 500ml £1.09 Sprite 500ml .99p
tell me where i have to change my coding paart:
my coding is;
public class DataGridPrinter
{
private PrintDocument ThePrintDocument;
private DataTable TheTable;
private DataGridView TheDataGrid;
public int RowCount = 0; // current count of rows;
//private const int kVerticalCellLeeway = 10;
public int PageNumber = 1;
public ArrayList Lines = new ArrayList();
int PageWidth;
int PageHeight;
int TopMargin;
int BottomMargin;
public DataGridPrinter(DataGridView aGrid, PrintDocument aPrintDocument, DataTable aTable)
{
//
// TODO: Add constructor logic here
//
TheDataGrid = aGrid;
ThePrintDocument = aPrintDocument;
TheTable = aTable;
// TheTable.Columns.RemoveAt(3);
PageWidth = 350;
TopMargin = 30;
// PageWidth = ThePrintDocument.DefaultPageSettings.PaperSize.Width;
PageHeight = ThePrintDocument.DefaultPageSettings.PaperSize.Height;
//TopMargin = ThePrintDocument.DefaultPageSettings.Margins.Top;
//TopMargin = 100;
BottomMargin = ThePrintDocument.DefaultPageSettings.Margins.Bottom;
}
public void DrawHeader(Graphics g, int ff)
{
//SolidBrush ForeBrush = new SolidBrush(TheDataGrid.HeaderForeColor);
//SolidBrush BackBrush = new SolidBrush(TheDataGrid.HeaderBackColor);
//Pen TheLinePen = new Pen(TheDataGrid.GridLineColor, 1);
StringFormat cellformat = new StringFormat();
cellformat.Trimming = StringTrimming.EllipsisCharacter;
cellformat.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
int ht = ff + 2;
int columnwidth = 30;
int initialRowCount = RowCount;
// draw the table header
//float startxposition = TheDataGrid.Location.X;
float startxposition = 30;
RectangleF nextcellbounds = new RectangleF(0, 0, 0, 0);
RectangleF HeaderBounds = new RectangleF(0, 0, 0, 0);
HeaderBounds.X = TheDataGrid.Location.X;
HeaderBounds.Y = TheDataGrid.Location.Y + TopMargin + (RowCount - initialRowCount) * (TheDataGrid.Font.SizeInPoints + ht);
HeaderBounds.Height = TheDataGrid.Font.SizeInPoints + ht;
HeaderBounds.Width = PageWidth;
//g.FillRectangle(BackBrush, HeaderBounds);
for (int k = 0; k < TheTable.Columns.Count; k++)
{
string nextcolumn = TheTable.Columns[k].ToString();
//Command Line
//RectangleF cellbounds = new RectangleF(startxposition, TheDataGrid.Location.Y + TopMargin + (RowCount - initialRowCount) * (TheDataGrid.Font.SizeInPoints + kVerticalCellLeeway),
// columnwidth,
// TheDataGrid.HeaderFont.SizeInPoints + kVerticalCellLeeway);
//nextcellbounds = cellbounds;
//if (startxposition + columnwidth <= PageWidth)
//{
// g.DrawString(nextcolumn, TheDataGrid.HeaderFont, ForeBrush, cellbounds, cellformat);
//}
//startxposition = startxposition + columnwidth;
//Command LIne
}
//if (TheDataGrid.GridLineStyle != DataGridLineStyle.None)
//g.DrawLine(TheLinePen, TheDataGrid.Location.X, nextcellbounds.Bottom, PageWidth, nextcellbounds.Bottom);
}
public bool DrawRows(Graphics g, int fz)
{
int lastRowBottom = TopMargin;
int hh = fz + 60;
try
{
SolidBrush ForeBrush = new SolidBrush(TheDataGrid.ForeColor);
SolidBrush BackBrush = new SolidBrush(TheDataGrid.BackColor);
//SolidBrush AlternatingBackBrush = new SolidBrush(TheDataGrid.AlternatingBackColor);
//Pen TheLinePen = new Pen(TheDataGrid.GridLineColor, 1);
StringFormat cellformat = new StringFormat();
cellformat.Trimming = StringTrimming.EllipsisCharacter;
cellformat.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.LineLimit;
//int columnwidth = PageWidth/TheTable.Columns.Count;
int columnwidth = (PageWidth / TheTable.Columns.Count);
//columnwidth = 100;
int initialRowCount = RowCount;
RectangleF RowBounds = new RectangleF(0, 0, 0, 0);
// draw vertical lines
Font printFont = new Font("Arial", fz);
// draw the rows of the table
for (int i = initialRowCount; i < TheTable.Rows.Count; i++)
{
DataRow dr = TheTable.Rows[i];
int startxposition = TheDataGrid.Location.X;
//startxposition = 20;
RowBounds.X = TheDataGrid.Location.X;
RowBounds.Y = TheDataGrid.Location.Y + TopMargin + ((RowCount - initialRowCount) + 1) * (TheDataGrid.Font.SizeInPoints + hh);
RowBounds.Height = TheDataGrid.Font.SizeInPoints + hh;
RowBounds.Width = PageWidth;
Lines.Add(RowBounds.Bottom);
if (i % 2 == 0)
{
g.FillRectangle(BackBrush, RowBounds);
}
else
{
//g.FillRectangle(AlternatingBackBrush, RowBounds);
}
for (int j = 0; j < TheTable.Columns.Count; j++)
{
RectangleF cellbounds = new RectangleF(startxposition,
TheDataGrid.Location.Y + TopMargin + ((RowCount - initialRowCount) + 1) * (TheDataGrid.Font.SizeInPoints + hh),
columnwidth,
TheDataGrid.Font.SizeInPoints + hh);
//200 + kVerticalCellLeeway);
if (startxposition + columnwidth <= PageWidth)
{
g.DrawString(dr[j].ToString(), printFont, ForeBrush, cellbounds, cellformat);
lastRowBottom = (int)cellbounds.Bottom;
}
startxposition = startxposition + columnwidth;
}
RowCount++;
if (RowCount + 1 * (TheDataGrid.Font.SizeInPoints + fz) > (PageHeight * PageNumber) - (BottomMargin + TopMargin))
{
DrawHorizontalLines(g, Lines);
//DrawVerticalGridLines(g, TheLinePen, columnwidth, lastRowBottom);
return true;
}
}
DrawHorizontalLines(g, Lines);
//DrawVerticalGridLines(g, TheLinePen, columnwidth, lastRowBottom);
return false;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return false;
}
}
void DrawHorizontalLines(Graphics g, ArrayList lines)
{
//Pen TheLinePen = new Pen(TheDataGrid.GridLineColor, 1);
//if (TheDataGrid.GridLineStyle == DataGridLineStyle.None)
return;
for (int i = 0; i < lines.Count; i++)
{
// g.DrawLine(TheLinePen, TheDataGrid.Location.X, (float)lines[i], PageWidth, (float)lines[i]);
}
}
void DrawVerticalGridLines(Graphics g, Pen TheLinePen, int columnwidth, int bottom)
{
//if (TheDataGrid.GridLineStyle == DataGridLineStyle.None)
return;
for (int k = 0; k < TheTable.Columns.Count; k++)
{
g.DrawLine(TheLinePen, TheDataGrid.Location.X + k * columnwidth,
TheDataGrid.Location.Y + TopMargin,
TheDataGrid.Location.X + k * columnwidth,
bottom);
}
}
public bool DrawDataGrid(Graphics g, int ff)
{
try
{
DrawHeader(g, ff);
bool bContinue = DrawRows(g, ff);
return bContinue;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return false;
}
}
}
|
|
|
|
|