I have found code to set column best fit for long content. But when the cell content length is too long, while printing the MS project file the content was cut off. So to correct this issue I need to apply wrap text property to TaskName column in MS Project 2010 using C#.
My question
Is it possible to apply wrap text to each cell in Task name column they have multiple lines and to autofit row height?
What I've tried
I tried to select Task Name column alone and to apply text wrap property. But that is not successful. Till now I didn’t get any property to apply text wrapper in MS project using Microsoft.Office.Interop.MSProject.dll in C#.
Related
I am looking to be able to get a range within a Word template from the Headings/Sections shown in the bookmarks.
For the template I have, I have multiple headings templated out and I need to automate the insertion to the document.
So, say I wanted to insert text under each heading without searching for the text (as this will likely change) how would I go about this?
I figured it out. I needed to add bookmarks to my template on the paragraph after and then use this to get the range:
Word.Range range = wordDoc.Bookmarks[bookmarkName].Range;
I can then use range.Text = text to insert the text.
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)
I am trying to set the text value of a RichTextBox by Telerik (ie. RadRichTextBox) to a value read from the database.
To set the value I tried the following which is not working "not setting the values"
InputDescription.Text = i._productDescription;
When I display the value of i._productDescription I do get results. So I am sure it is not empty/null and and the text box should have value.
How can I correctly set a text value to the RichTextBox?
Adding text in RadRichTextBox and RadRichTextEditor is done via importing, not with the Text property (although there is FR for this link).
Please refer to the following article which explains how you can import data in RadRichTextEditor: Import/Export | UI for WinForms Documentation.
I am writing a plugin for Revit 2014. One of its features placing a vertical column by the user. Revit API allows placing family instances by the user with the method PromptForFamilyInstancePlacement, which is what I'm using, like so:
//PillarSymbols is a list containing symbols of various columns available, loaded previously from a file
FamilySymbol symbol = PillarsSymbols.Single(x => x.Kind == selected.Kind).Symbol;
_commandData.Application.ActiveUIDocument.PromptForFamilyInstancePlacement(symbol);
This code enables Modify | Place structural column tool in Revit application. It works as desired, but does not allow the user to switch between Vertical Column and Slanted Column. This option is set to whatever it was set before running the code above.
I have tried to set the symbol parameters before running PromptForFamilyInstancePlacement using:
symbol.get_Parameter(BuiltInParameter.SLANTED_COLUMN_TYPE_PARAM).Set(value);
but get_Parameter() above returns null.
Is there a method to set column type to Vertical Column, before prompting the user to place the column? Also is there a way to pre-set column height?
Unfortunately you can't preset the column height but you can adjust the free end of the item created directly afterwards. You should be returning a FamilyInstance, so if you grab it again then you can adjust the free end of it.
You may be able to prompt the user to place the correct symbol by cycling through the symbols in the family. Try the snippet below and check to make sure that the symbol produced is the one that you want before placement:
FamilySymbol familySymbol = family.Symbols.ForwardIterator().Current as FamilySymbol;
I'm currently updating values in an Excel template and I keep getting my currency fields to have the green triangle in the top corner and the "Number Stored as Text" message. How do I get Excel to recognize the cell is a number and I want it to treat it that way since I already have the cell formatted as currency? (just like what happens if I'm on the cell in Excel, hit F2, and then hit enter)
Here's a simplified version of what I'm currently doing:
UInt32Value moneyFormat = report.createCellFormat(report.Stylesheet, fontIndex, backgroundIndex, borderIndex, 168);
report.UpdateValue("Workbook", "I29", "1234.56", moneyFormat, true, String.Empty);
And here's an image of what my cells look like
You might find the answer in this post:
Open XML SDK 2.0 - how to update a cell in a spreadsheet?
Probably the DataType of the cell is not set correct.