|
|
i was to use the crystal report dynamically bt have no idea to pass parameter dynamically i connect the table and databse also dynamically bt help anybody plz help me in parameter passing.
Nikesh Kr. Yadav
CSS Infotech
Sec- 31
Gurgaon,
Haryana(India)
|
|
|
|
|
Hi!
You can use
CrystalReport1.DataDefinition.RecordSelection = "Order = ..." to pass parameters you want
Hope my help!
It seem to be a solution or an answer.
|
|
|
|
|
plz provide some more code bcoz
<br />
StockCrystalReport1.DataDefinition. is not showing RecordSelection <br />
StockCrystalReport1.DataDefinition.RecordSelectionFormula = <br />
Nikesh Kr. Yadav
CSS Infotech
Sec- 31
Gurgaon,
Haryana(India)
|
|
|
|
|
I think this code can help you
object obj = "";
// Create new instance from Report file
CrystalReport1 crystalReportFile = new CrystalReport1();
crystalReportFile.SetDataSource(datasource);
crystalReportViewer.ReportSource = crystalReportFile;
// Set parameters here .
crystalReportFile.SetParameterValue("Name", obj);
This is importnat :
Always set parameter after binding to datasource and set ReportSource properties
DMASTER
|
|
|
|
|
Hello experts,
An application I'm currently developing pops-up reminder windows.
Being a popup window, it should not "steal" the focus, as it can be unpleasent to the user if he's in the middle of something.
I've tried overriding the ShowWithoutActivation property and returning true , but the form still gets focused.
My guess is that a LinkLabel control I have on the form is receiving focus, thus having the form receive focus even when the ShowWithoutActivation property has returned true .
How can I deactivate the form?
Thanks in advance,
Shy.
|
|
|
|
|
Have you tried just using the Hide method?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
I don't want to hide the form...
I want it to appear on top, but not to steal focus.
|
|
|
|
|
Maybe you're using ShowDialog instead of simply show...
|
|
|
|
|
Correct. I did use ShowDialog() .
However, even using Show() it still steals the focus.
|
|
|
|
|
Ok. Why you don't try to pass the parent form to the constructor of the new modal form and then call the Activate method when the new form is shown?
An alternative is when you call show, a line below return the focus to any control of the form.
If the previous alternative don't like you try to save the ActiveControl before open in a var and after open the new form, in the Show next line call var.Focus().
Try any of this three alternative.
|
|
|
|
|
Problem solved!
It appears that because I set TopMost to true , the ShowWithoutActivation property became useless.
When I used the TopLevel property instead, it worked.
Regards,
Shy.
|
|
|
|
|
Good for you. I was going to mention the setting of TopMost , but you figured it out before I got up this morning
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
The following code can read Xml file and put elements into treeview as nodes. I wish to do two things; 1)move parameters out from the tree and only leave table's name on the tree 2)when mouse click on table's name, the parameter associtated with the table will show up in text box.
The following is a sample of xml file. ServerSession and ClientSessions are table names in dataset. others are parameters. It should have <> symbol but because it won't show the content if with the symbol.
?xml version="1.0" standalone="yes"?
UserSession xmlns="http://tempuri.org/UserSession.xsd"
ServerSession
StartTime 2007-07-20T13:57:39.7346316-02:30/StartTime
ServerSessionID 0 /ServerSessionID
EndTime 2007-07-20T13:57:39.7346316-02:30 /EndTime
ClientSessions
StartTime 2007-07-20T13:59:52.8972108-02:30 /StartTime
ClientIP 127.0.0.1:2138 /ClientIP
ClientSessionID0/ClientSessionID
ServerSessionID 0 /ServerSessionID
/ClientSessions
/ServerSession
/UserSession
<br />
private void AddNode(XmlNode inXmlNode, TreeNode inTreeNode)<br />
{ XmlNode xNode;<br />
TreeNode tNode;<br />
XmlNodeList nodeList;<br />
int i;<br />
string name = "";<br />
if (inXmlNode.HasChildNodes)<br />
{<br />
nodeList = inXmlNode.ChildNodes;<br />
for (i = 0; i <= nodeList.Count - 1; i++)<br />
{<br />
xNode = inXmlNode.ChildNodes[i];<br />
inTreeNode.Nodes.Add(new TreeNode(xNode.Name));<br />
tNode = inTreeNode.Nodes[i];<br />
AddNode(xNode, tNode);<br />
}<br />
}<br />
else<br />
{<br />
inTreeNode.Text = (inXmlNode.OuterXml).Trim();<br />
}<br />
}<br />
|
|
|
|
|
Hello everyone,
I am populating a DataTable by data from a remote database. I was wondering if there is a way that I can check to see that DataTable has been populated with all the data from the remote database?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Yes, just check the DataTable to see if it has any rows.
<br />
DataTable dt = new DataTable();<br />
if(dt.Rows.Count > 0)<br />
{<br />
}<br />
else<br />
{<br />
}<br />
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
thankx
Nikesh Kr. Yadav
CSS Infotech
Sec- 31
Gurgaon,
Haryana(India)
|
|
|
|
|
I am nor sure this is the best place to post this but here goes.
I have a tool (in this case Crystal Reports) that exports to RTF format. My problem is that I now need to combine existing rtf files into 1 rtf file. Does any know of a project that does this. I posted my question here since I use C#.
|
|
|
|
|
I would like to know how to implement generic functions.
I have a few classes: CdRecord, BookRecord, Record, and RecordManager.
CdRecord inherits from Record. BookRecord inherits from Record.
In my RecordManager class, I have a bunch of functions.
Two of the functions in RecordManager read info from a table in an SQL DB.
rough code:
using...
namespace MyProject
{
class RecordManager
{
List<cdrecord> CDrecords = new List<cdrecord>();
List<bookrecord> BOOKrecords = new List<bookrecord>();
public void readBooks()
{
// connect to DB
// fill BOOKrecords with entries from table
}
public void readCds()
{
// connect to DB
// fill CDrecords with entries from table
}
}
}
Now, once I've filled CDrecords and BOOKrecords, I need a function that will split them, and re-arrange the order of the records. I realise I can make one function that takes a List<bookrecord> parameter and one function that takes a List<cdrecord> parameter, but I'd prefer to have one function be able to handle them both. I also know that I can just send an extra parameter (int i for example) that indicates what type i am working with (if i == 1, BookRecord list, etc). However, I don't like this method either. In the future, I may end up with many more classes that inherit from Record, that I'll have lists of that need to be split, and I don't want to have a function for each type because I may end up with 20 redundant functions. Similarly, I don't want to send an extra parameter because of readability (if i == 1, if i == 2, .... if i == 20). How do I make one function that is able to take a paramater of type List<t> where T can be CdRecord or BookRecord?
I have tried the following, and it does not work:
public void SplitRecords<t>(List<t> records, int start, int end)
{
//some code
for(int i = start; i <= end; i++)
{
//some code
records[i].memberFunction();
//some code
}
}
The reason it doesn't work is because "memberFunction()" is a function of Record (which is inherited by BookRecord and CdRecord) but "T" does not have a definition for "memberFunction()"
How do I correct this? Could I be experiencing problems because I am trying to use classes I wrote with generics, rather than int/short/etc.?
Thanks in advance for any assistance!
|
|
|
|
|
You can limit what T can be, and so you'll have access to the methods of the base types from the T instance.
where T : Record is what you need on the end of your generic class definition.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am trying to call the event OnHelpButtonClicked.
I am unsure of how to get it to work. I am using the following code:
private void button1_Click(object sender, EventArgs e)
{
CancelEventArgs Arg1 = new CancelEventArgs();
Arg1.Cancel = false;
OnHelpButtonClicked(Arg1);
}
|
|
|
|
|
Hello,
The question is not clear at all, I think.
But if you have a button on your form, which is named HelpButton, you could use the PerformClick[^] method of the Button.
HelpButton.PerformClick();
If you mean the Help funktionality "F1", you could use SendKeys.Send[^]
SendKeys.Send("{F1}");
Hope it helps!
All the best,
Martin
|
|
|
|
|
I don't think I have made myself clear. I am trying to use the Help Button that can be added to the title bar of a window, the problem with using it in the title bar of the window is that you have to remove Max and Min window (as seen here http://davidkean.net/images/helpwindow.jpg).
What I would like to do is link this Help Button to a button that I have created on my form. Thus the following code.
CancelEventArgs Arg1 = new CancelEventArgs();
Arg1.Cancel = false;
OnHelpButtonClicked(Arg1);
The problem is when I call this nothing happens, I know it is getting into the OnHelpButtonClicked function (as I override the function) but it does nothing when it enters the base.OnHelpButtonClicked.
Thanks for the help.
PS I tried the HelpButton.PerformClick(); and it does not have it
|
|
|
|
|
Just add a little more information into this, I now am starting to think that I am not overriding the right function as when I override the OnHelpButtonClicked and remove the base class it still works.
|
|
|
|
|
Ok,
Now I understand your problem.
I tried it with SendKeys, and it opens the help!
All the best,
Martin
|
|
|
|