I am using Visual Studio 2012 C# to create reports using the RDLC framework. My report contains columns of TextBoxes fields. Under certain conditions I need to hide the 2nd to last column. When I do this (set hidden property to True) the far right column for those rows with a hidden row slides over to the left rather than being aligned with others in that column. I am not using any properties that I can tell that would cause this. My current workaround is to make the text color for the column to hide White, but this is really a hack in my opinion and won't work if the back color is to change. Does anybody have any thoughts on how I can do this the right way, I.E. using a formula on the Hidden property of the TextBox rather than on the Color one?
Any help regarding this would be very appreciated!
You simply need to define an expression for the Value of the TextbBox that prints nothing when the condition is met.
=Iif(YourCondition = True, "", Fields!YourColumn.Value)
how can i get similar result on Telerik Report with showing percentage instead of the Count value that is shown by default.
i'm using C# in my application.
thanks
This is how it looks in my app
<telerik:PieSeriesDefinition AxisName="YourName"
ShowItemLabels="True"
ItemLabelFormat="#%{P0}"
RadiusFactor="0.7">
The key here is the ItemLabelFormat with RadiusFactor you can move it as far as you want from the center
Forgot to add this to the answer as well. Inside ChartDefaultView.ChartArea add this
<telerik:ChartArea.AxisY>
<telerik:AxisY AxisName="YourName" DefaultLabelFormat="#VAL{p}"/>
</telerik:ChartArea.AxisY>
I have a fully functioning Dynamic chart control( just the regular ASP.net Chart ) It works great but I've run into a problem trying to add check boxes to the legend. I'm trying to add them next to the series names so the user can hide or view the respective series data. The chart is plotting data for roughly 42 employees. So being able to select and hide data is very important. I've been researching this for a few days now and I've found examples for 3rd party chart tools but i need to do this in MSVS 2010 standard charting tool.
This is how I create the Chart.
for (int emp = 1; emp < empRowList.Length; emp++)
{
chartB.Series.Add(empRowList[emp]);
chartB.Series[empRowList[emp]].ChartType = SeriesChartType.Point;
chartB.Series[empRowList[emp]].MarkerSize = 10;
chartB.Series[empRowList[emp]].MarkerStyle = MarkerStyle.Star4;
for (int month = 1; month < 12; month++)
{
chartB.Series[empRowList[emp]].Points.AddXY(mfi.GetMonthName(month), employeeStats[month, emp]);
chartB.Series[empRowList[emp]].Points[chartB.Series[empRowList[emp]].Points.Count - 1].ToolTip = empRowList[emp] + " - " + employeeStats[month, emp];
}
}
Here is how I format the chart
chartB.DataSource = t.Tables["info"];
chartB.DataBind();
chartB.Legends.Add(new Legend("Legend"));
chartB.Legends["Legend"].Alignment = StringAlignment.Center;
chartB.Legends["Legend"].Docking = Docking.Top;
I looked through this post thinking it could be augmented to help but since his series aren't added dynamically i'm not sure if it is the right direction to pursue.
ASP .net 4 Chart Control Legend formatting is not displaying at all
I've also looked in to using custom legends but read that they aren't linked to the data so i thought that might also be that wrong direction.
If anyone could help it would be greatly appreciated i'm kind of at a stand still till I can figure this out.
Thanks in advance
Some code on this would have been wonderful as I was looking to do something similar.
I did however find a post on msdn that states custom legends are not possible.
http://msdn.microsoft.com/en-us/library/bb677428(v=sql.100).aspx
I was able to find a solution similar to what i wanted using the code from the link above but could never quite get the legend to work properly so i scrapped that idea and just dynamically created a check-box bank underneath my chart that hides/shows series. Wasn't too difficult just needed to create a class and deal with the click event verses the redraw of the graph.
This should be very simple.
I have a Label control on my Form and I am trying to put a tab character between text
Label.Text = "Is there a\ttab";
The output is "Is there atab";
What am I doing wrong?
Tab is actually a non-printing character—or rather, a control character. What it does is entirely dependent on the application. What exactly do you expect? 8 spaces? 4 spaces? As many spaces as needed to get to a multiple of 8 columns? Indentation of the following text by one cm?
To put it short: The Label control doesn't support tabs. Actually, Label just uses normal graphics routines for rendering its text and how should they know what you intend to do with your tab character?
If you need to display that character as a number of spaces, then you should replace it by that number of spaces.
I wanted to add tabs ("\t") to a dropdown list of items. The items have a ToString method that gives about 3 words concatenated together. They did not line up. For example:
1-I 45
123-AB 511
123456-MMM 611
A long list like this is hard to read. So I used string.Format like this:
string.Format("{0,6}-{1,-4} {2}",id,name,num);
The number after the comma will right align/pad if positive and left align/pad if negative.
Then I changed my font in the Combobox to be monospaced, like Courier New, and you get something like this:
1-I 45
123-AB 511
123456-MMM 611
That is much easier for a user to read.
Nothing, windows forms labels are very limited in functionality and don't support the \t character.
A (slightly awkward) alternative might be:
label1.Text = "test\ting\t123".Replace("\t"," ");
Old thread, but since none of the answers seemed to work for me, I will go ahead and throw in my 2 cents. I could not get a "\t" or even use manual spaces to add spacing to the label. What I ended up doing was using alt code alt-255 5 times. This worked like a charm. Gotta love total hacks...
Right, to insert a tab, just add the spaces desired.
If you want to offset the next by a specified length, you could try
int offset_text = 20;
label1.Text = "Is there a".PadRight(offset_text)+"Tab";
label2.Text = "More Text".PadRight(offset_text)+"Too";
Just use a literal string and you should be good to go...
label1.Text = #"Test for Tab";
Where that big space is where I actually hit tab three times...hope this helps
I had the same problem. A textbox does instead a label accept Tabs. So if you change the label in a textbox, the pro
Just click in the arrow at the right of the Text property of the label (click in the Text property content and the drop-down-arrow will show up). A box for text-editing will open, and in that box you can use Enter, Tab, and so on.
I created a PieChart with the new Ms Chart Controls. How can I format the Labels (Point Values inside the Pie) like the folllowing: "LabelName AbsoluteValue (Percentage)"? For example: "Usa 856027 (56 %)".
Is this possible with the right format information in LabelFormat alone (How?) or do I have to use a custom label format (How?) ?
Thank you very much!
Rupert Rand
You can include keywords in the Label property, which can either be set in the GUI(through the Series Collection Editor) or in code. I would recommend setting it through the GUI since it would not require a full knowledge of the available keywords. If you instead want to set it in the code, it would look similar to this (assuming I understand what format you are requesting): Chart.Series(0).Label = "#ValX #Val (#ValPercentY{P0})".