|
Yes you can specify which fields to sort, and there is, IIRC, even an example in the CR for .NET (not C# .NET - any .NET language unless the CR assemblies aren't CLS-compliant, but that only rules out crappy languages like JScript.NET).
There are several ways you could do this. You could specify a grouping in your report that accepts parameters. There are several ways to pass those, which are documented in the CR documentation. For example, you could set parameters using the ReportDocument.DataDefinition property.
You could also design the report to use an ADO.NET DataSet , which would give you maximum flexibility since you could sort and filter the DataSet and then set that as the report data source using ReportDefinition.SetDataSource .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
My reports have been reporting off of ADO.NET datasets the whole time, this will be perfect I can just sort the dataset before i set the report source!
Thanks Heath
|
|
|
|
|
How would I go about creating a Properties file for the Tab Control ?
|
|
|
|
|
A "Properties file"? Please explain a little more.
If you're talking about displaying the properties for a file, then use P/Invoke the shell helper API, SHObjectProperties :
[DllImport("shell32.dll", CharSet=CharSet.Unicode)]
private static extern bool SHObjectProperties(
IntPtr hWnd,
uint dwType,
string szObject,
string szPage);
public void ShowProperties(string filename)
{
if (filename == null) throw new ArgumentNullException("filename");
if (File.Exists(filename))
SHObjectProperties(this.Handle, 2, filename, null);
} This would only work on Windows 2000 and newer, since SHObjectProperties is only supported in newer versions of shell32.dll. There are other ways to accomplish what this helper API does, but you need to understand the shell APIs and PIDLs.
If you want to add a property page to a file's property sheet, you need to implement the unmanaged interface IShellPropSheetExt , among other interfaces, which means you have to declare managed interfaces, implement them, and register your .NET assembly as a COM server. There are several articles about how to do this here on CodeProject.
If neither of these is what you mean, then you should define what you mean by "Properties file" because that's very vague and not technical at all.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
My apologizes for not explaining further. I want to create a properties file, that when invoked creates a Tab Control and sets its properties. I want to do this programatically not via the properties tool bar, in the Visual Studio.net environment. Thanks for your response
|
|
|
|
|
That still makes absolutely no sense. You can't invoke a file for one thing. You can read it, write it, delete it, copy it, and otherwise modify it, but you can't "invoke" a file.
And what "properties tool bar" are you talking about? You mean the PropertyGrid?
If you're talking about creating controls programmatically from information in a text or binary file, there are several ways of doing this. One is from Marc Clifton who's basically modeled his framework after XAML - the XML dialect for Windows "Longhorn" to create applications (not the only way, mind you). See MyXAML--XAML-style gui generator (added styles)[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I guess i cannot Technically explain it. I was looking for something along these lines :
BackgroundSkin=???.bmp
NumberofTabs=2
Tab1Name=Mike
Tab1Pict = ???.bmp
Tab2Name=Jen
Tab2Pict=???.bmp
etc
|
|
|
|
|
Yeah, and the article I linked is one way to do that.
Basically, if you want to read properties from a file you need to parse the name/value pairs and use reflection to assign properties. This typically means you need a file structure that also dictates what those properties (like the ones you have above) apply to. To have a file for every control is absurd. With Marc Clifton's port of XAML (MyXaml), he does just that through XML hierarchies. You should take a look at it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Can't find a search button for these forums, only the articles. I'm sure there is a wealth of info in the forum database ...
~Steve
|
|
|
|
|
Its to the top right of where the comments start. Click here[^].
#include "witty_sig.h"
|
|
|
|
|
Near the top of each forum is a "Search Comments" link.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
|
|
|
|
|
Beat ya to it! :dances around room waving arms in the air:
#include "witty_sig.h"
|
|
|
|
|
|
Just below the code project logo
or
you can use this link
http://thecodeproject.com/script/comments/search_comments.asp?forumid=1649
Sreejith S S Nair
|
|
|
|
|
I'm developing this app that allows users to add controls that represent tasks by clicking a button. When the button gets clicked, a new TaskControl is created and added to the TaskPanel container.
The TaskControl has a DockStyle.Top. However, when the button gets clicked again to add another TaskControl, the new TaskControl gets added to the TaskPanel above the existing TaskControl(s). I want it to appear below the already existing controls.
How do I go about doing that?
|
|
|
|
|
Try calling .BringToFront() on the control you want at the top. Docking orders depend on the Z order of the controls. Play around with the BringToFront and SendToBack methods.
#include "witty_sig.h"
|
|
|
|
|
They are already displayed "on top", but the problem is that new controls push the old ones down (not on the z-axis, but on the y-axis). So I see 'em all, but like so (crude lineart )
------------------------------------
| container | <-- new one gets inserted here and pushes existing down
| -------------------------------- |
| | control | |
| | | |
| -------------------------------- |
------------------------------------
|
|
|
|
|
//Ok your requirement is to add your task control just beneth to the existing task control when //you click the add button.
//for eg : if this is your location value of panel control
this.yourpannel_control.Location=new System.Drawing.Point(8,0);
//then
//assign to public variable LocX and LocY (forgetting x and y co-ordinates values)
//initial values of LocX and LocY
this.LocX=yourpannel_control.Location.X;
this.LocY=yourpannel_control.Location.Y+32;
//(i gave 32 . you can give any number. based on this value your task control will add from top)
buttion_click()
{
if(_UCtl1==null)
{
_UCtl1=new yourtask_control()
this._UCtl1.Location = new System.Drawing.Point(LocX, LocY);
this.yourpannel_control.Controls.Add(_UCtl1);
}
else
{
_UCtl1=new new yourtask_control()
this._UCtl1.Location = new System.Drawing.Point(LocX, LocY);
this.yourpannel_control.Controls.Add(_UCtl1);
}
LocX=LocX;
LocY=LocY+32;
yourpannel_control.Height=LocY+16;
//(i gave 16. you can give the height of your task control + difference between two task control)
}
this code will add your task control just one beneth the other.
|
|
|
|
|
I want to write an if statement that will write the word "error" on a label when the backcolor of a certian textbox is yellow. This is what I tried.
if (textBox1.BackColor = Color.White)
{
label1.Text = "yellow";
}
When I tried this I got a error that said
" Cannot implicity convert type 'System.Drawing.Color' to Bool"
What do I need to do to make this work?
Can I do this?
|
|
|
|
|
Use "==" and not "=" when doing comparisons.
"=" is for assignments and "==" is the equality check.
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG blog:: brokenkeyboards "It'll be a cold day in Hell when I do VB.NET...", Chris Maunder
|
|
|
|
|
It might be handy to purchase a book that goes into the basics of C#. These questions get answered in the the first 3 chapters of any book on C#.
|
|
|
|
|
|
//for demonstrating this eg. i am using a button,label and a textbox.
//use below mentioned code block inclick event of your button.
//showing color dialogbox
ColorDialog clr=new ColorDialog();
clr.ShowDialog();
//assign selected color
textBox1.BackColor= clr.Color;
//checking color and assigning label.text property
if(textBox1.BackColor==Color.White)
label1.Text="White";
else if(textBox1.BackColor==Color.Yellow)
label1.Text="error";
else
label1.Text="something else";
this is a small idea and you have to apply this based on your requirement.
Sreejith S S Nair
|
|
|
|
|
hi!
i have a .chm file, how can i link this file to menuitem "help" in program so that when some one click the help menuitem, the help file will pop up
thanks...
|
|
|
|
|
See the Help.ShowHelp method documentation in the .NET Framework SDK. The Help class and other related classes like the HelpProvider natively work with HTML Help 1.x files (.chm files) in the .NET Framework. The SDK documentation also includes samples about how to use these classes and their members.
Microsoft MVP, Visual C#
My Articles
|
|
|
|