|
as i do,
dataGrid1.DataSource = DataView1
DataView1.Table = "//correct_datatable"
you can get corresponding row via DataView1
Ex:(to get i-th DataRow )
DataView1.Item[i].row
|
|
|
|
|
Hello there.
I'm not sure if this forum is the correct place to post my quest. But I was searching for so long to get any information about a way to show Crystal's database progress from within an application. Business Objects (distributor) says there is no way. Actually the technical support of Business Objects is not worth mentioning, is it?
If there is defacto no way, I wonder why Crystal Reports is such a successful tool. There must be threads or processes on the system that are running invisibly.
So perhaps there's no way to picture the progress at all is there a possibility to catch the end of the crystalreportviewers work? If that I could show a waitcursor at least.
My report app is build in c# (on a windows system of course) and I have installed Crystal Reports 9 Developer Edition.
Hopefully
T. Labenche
|
|
|
|
|
Being a little impatient, aren't you? Posting your question once an hour will not get it answered any faster.
Anyway, CR doesn't expose any kind of event that you can use to monitor its database progress. Since CR itself doesn't know how many records are going to be returned beforehand, there is no way to tell when the progress will end.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That is what I feared for. Anyway, thanks for your reply.
Another thing: You are not that kind of person who reprimand without reflections, are you? Perhaps a crash of the IE was the reason why I have (unwittingly) posted the message twice. Sometimes I might be impatient, but I am by no means impatient when I'm expecting unkind messages!!!
Even though
Best regards
T. Labenche
|
|
|
|
|
I want to do a simple search function in a richtextbox. I have loaded a file and by using the Find method it's possible to find a text string, highlight the string and extract the line number, but how can I programatically scroll down to the line?
private int findText(string searchText, int searchStart, int searchEnd)
{
int indexToText = richTextBox1.Find(searchText, searchStart, searchEnd, RichTextBoxFinds.MatchCase);
richTextBox1.SelectionColor = Color.Blue;
int lineNo= richTextBox1.GetLineFromCharIndex(indexToText);
return indexToText;
}
|
|
|
|
|
Why not just use the ScrollToCaret() method of RichTextBox ?
Regards,
mav
|
|
|
|
|
Embarrisingly enough I tried that first but discrded as not working. Just to find out that the control needed focus before it worked...
So it was just to add
richTextBox1.Focus();
richTextBox1.ScrollToCaret();
|
|
|
|
|
Hello there.
I'm not sure if this forum is the correct place to post my quest. But I was searching for so long to get any information about a way to show Crystal's database progress from within an application. Business Objects (distributor) says there is no way. Actually the technical support of Business Objects is not worth mentioning, is it?
If there is defacto no way, I wonder why Crystal Reports is such a successful tool. It is hardly reasonable to customers I think. There must be threads or processes on the system that are running invisibly.
So perhaps there's no way to picture the progress at all is there a possibility to catch the end of the crystalreportviewers work? If that I could show a waitcursor at least.
My report app is build in c# (on a windows system of course), VS 2003 and I have installed Crystal Reports 9 Developer Edition.
I'm looking forward to any information.
Hopefully
T. Labenche
|
|
|
|
|
In VC++ when I used to write a Windows Service, I used to parse the command line arguments. If it is '-install' I used to call functions OpenSCManager() and CreateService() to register the service OR DeleteService() to remove it from the SC manager. (winsvc.h )
I am new to VC#... Please tell me the equivalent functions/code piece to do the above task. I am keen on doing this programmatically (if possible, off course) rather than using the installutil and stuff…
|
|
|
|
|
use ServiceInstaller Class
Look into MSDN for help
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
I am trying to use Excel.WorksheetFunction.VLookup but cant use it. Can someone give me an example of how i should use it. I dont seem to be able to get up any of the WorksheetFunction members when using VS which leads me to think that i need to initialise something.
|
|
|
|
|
hi,
Check this article.
http://www.codeproject.com/csharp/csharp_excel.asp
http://www.codeproject.com/aspnet/getsheetnames.asp
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Thanks for your input but they dont use any WorksheetFunctions so i still need help
|
|
|
|
|
Excel.WorksheetFunction wsf = ThisApplication.WorksheetFunction;
Thought i had found all my answers but my app doesnt have ThisApplication defined as i am not using the VS MS office templates. So what do i need to replace ThisApplication with to get this working?
|
|
|
|
|
Hi,
I hope I'm understanding the problem correctly. You can get an reference to the app through:
Excel.Application app = new Excel.ApplicationClass();
Then there are two ways I can think of to evaluate functions:
object result = app.Evaluate("=LEN(\"ABC\")");<br />
double lnVal = app.WorksheetFunction.Ln(System.Math.E);
and don't forget to quit Excel:
app.Quit();
Hope this helps
|
|
|
|
|
Thankyou, that was the answer i was looking for.
|
|
|
|
|
Hi all,
I've wrote a scheduling application for someone and it needs to be running permanently in the system tray which is all done and works fine. During testing i came up with a problem though.
When Form.Close() is called i check for a password that has been hardcoded into the application. When the PC is shut down i want the program to close without user intervention as the machines will be used off site and the admins will be the only ones with the password.
In short i need to be able to check for a password when Form.Close() is called by the user and not check when it is called by the System shutting down.
Hope you can help.
Kev
|
|
|
|
|
hi,
You can check the user name and password when you call form.close() method. If you want to do some additional work(checking user name and pwd) on the time of closing then you need to override the oncloseing event.
protected override void OnClosing(CancelEventArgs e)
{
try
{
if(MessageBox.Show("This Will Close your form. Do You Want To Continue ?","Conformation",MessageBoxButtons.YesNo,MessageBoxIcon.Information) == DialogResult.No)
{
e.Cancel = true;
//This block will execute if he refuse to close the form.
}
else
{
//This block will execute if he deside to close the form. So you can put your logic here for checking the credentials.
e.Cancel = false;
}
base.OnClosing (e);
}
catch(Exception Ex)
{
MessageBox.Show(Ex.Message.ToString(),"Information",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
This will help you to check the user name and password.
And i am not much sure about how handle the shutdown process.;)
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
OK, Lets try to make things a little clearer.
I can already check for the password using the Form.Closing event.
<br />
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)<br />
{<br />
SaveSchedules();<br />
<br />
if (!(CheckPassword()))<br />
e.Cancel = true;<br />
else<br />
notifyIcon.Visible = false;<br />
}
CheckPassword() returns a bool depending on the password entered.
The above bit is the easy part, what i need to do is to know wether
the user is closing the aplication by clicking on the cross on the form
or the system is closing the application because the user has tried to log
off / shut down the PC.
Kev
P.S. How do you get the Yellow background behind code samples??
|
|
|
|
|
exhaulted wrote:
P.S. How do you get the Yellow background behind code samples??
using the menu below (if u reply a message) or using the "code" tag.
to u'r question, i'm not sure u can, in managed code.
there are no facts, only interpretations
|
|
|
|
|
The code tag just makes things red .
I wondered how people put large code samples in with yellow backgrounds, like in Articles
Kev
|
|
|
|
|
Use <pre> tags.
Charlie
if(!curlies){ return; }
|
|
|
|
|
thanks
Kev
|
|
|
|
|
Process the OnEndSession event. This occurs when the Windows session ends. Do what you need to do here and set a flag so that OnClose does what it needs (or dosen't need) to do.
[Clarification: The events which I have described are MFC names for the corresponding Window events. Please find the .NET equivalents yourself. They must be something like: SessionEnding and Closing]
|
|
|
|
|
All i can find in the help for OnEndSession relates to MFC and C++. Assuming i can use this in C#, what do i have to do?
Kev
|
|
|
|