Table of content in MS Word 2010 - ms-word

I have a problem figuring this thing out. On other MS Word documents Heading 1 is in normal position (first in line left corner), but in this particular document it's ahead of Heading 2 & Heading 3. I just don't get it why & how I can fix it?Crazy table of content

A short answer, since the topic could also be of interest to developers programming Word:
You need to look at the TOC 1 style. It appears that a FirstLine indent has been set. If this is removed Toc level 1 should align left, same as the other levels.

Related

MS Access - Right Align Formatted number on a Form

If I use Standard format for a number in a control then I can Align Right and it appears on the far right of the control in the Form. However, I am using numbers in millions and so want to format the number so that, for example, 50,123,456 will appear as 50.123. So I use format #,,.0 with decimal places set to 3. If I set alignment to left, it aligns to the left of the field on the form, Align Center and it appears in the center. But Align Right and there is a large space to the right of the number, like padding. Is there a way to get the formatted number to hit right up to the right side on the form?
Replace the ControlSource with the expression:
[Amount]/1000
Set property Format to: Fixed
Set property DecimalCount to: 0
The formating option might not be the right approach to getting the needed solution. Do the following instead
Put the format to general number.
Put the decimal places value to 0.
Then go to VBA and add the following code to the after update event of the control
Private Sub allocatedamount_AfterUpdate()
Me.allocatedamount = Left((Me.allocatedamount / 1000000), 6)
End Sub
In this case i added the code to the after update evnt of the control on the form named allocatedamount
I have attached two images.
This code will work for numbers between 10 million and 99 million, where it is between 100 million and 999 million you will have to add another zero to the constant 1000000 used in the VBA code,so that will entail using an If statement to first determine if the value is between 10 million and 99 million or 100 million to 999 million.

Coordinate system in Crystal Reports

I'm working with CR version 13.0.25 - I believe the actual latest version as of this date is 13.0.26, so, basically the latest version of CR. What I am working with is re-positioning elements on the report dynamically from the C# code.
There are a couple of the reports where the original rpt (designed a number of years ago) spans multiple pages. These in particular are giving me issues, but they are not the only ones. The issue here focuses on the y (vertical) dimension.
CR documents use a coordinate system that is based in the upper left corner of the document, and is also based on twips (1440 twips/in). So, in theory, I should be able to set the Top value for a ReportObject to 1440 and that element should be printed 1" from some benchmark (either top of the page or bottom of the margin - I'm fairly sure it's bottom of the margin).
My results do not seem to reflect this - at least not exactly.
When I set the Top value, it appears that with some of the documents, the y dimension is scaled. In fact, I can apply a constant scaling factor (it varies according to the document) and I can make the fields appear with a relative 1" spacing all of the way to the bottom of the page. However, that scaling factor varies from document to document.
So, besides experimenting in our production code, I have also done the following:
I created a C# console app that opens an rpt file, grabs some of the elements on it, and re-positions them, then sends it to the printer. I designed a new rpt file with headers and footers sized as small as I could get them, and put 10 text fields in the details section. I iterate through the fields (via ReportDocument and ReportObjects and re-position them at 0, 1440 (1"), 2880 (2") etc.
This works perfectly with a document that has the default margins (.167 inches by default on each side). The first element has its top butted against the bottom of the margin, the second element is 1" from the top of the first element to the top of the second element, and so on down the page. If, however, I reduce the margins to zero - either programmatically or in the design, I get this scaling effect. The elements are all now about 7/8" or so apart, instead of the 1" that I would expect.
Does anyone know of any magic formula(s) or documentation on why the coordinate system appears to be changing? I could understand that if I change the margin that could offset everything on the page (assuming that the margin is our baseline) but it would seem to me that the inter-element spacing, being 1440 should still render at 1".
I believe Y is the vertical distance from the top of that section, not from the top of the page.

Tableau Legend Issue

I'm trying to use a legend(which is common for more than 2 columns)
such that
a. tick mark means 3
b. exclamation mark means 2
c. Bold circle means 1
See the screenshot for 2 columns displayed in the attachment.
However i need a common legend for these columns
I tried to go to analysis tab and then click on legends, but this will show legend for only 1 column at a time and i need 1 legend for more than 2 columns.
In general, if the customization and formatting options for the built-in legends and filter controls don't do as you wish, the next approach is to build a worksheet that shows and acts as you desire. Then use that worksheet on your dashboard to serve a replacement for the built-in legends.
In your case, one approach is to make a simple text data source with one row for each item you want to appear in your new custom "legend". Then build the legend worksheet of your dreams :-)

measuring SWT / JFace column header padding size

I have a number of tables in an eclipse SWT application. They are Table/TableViewer tables and consist of a header, a row down the left with text and a series of graphics going across. There are 32 columns other than the text column, numbered from 0 to 31.
On Windows 7 and XP in classic mode, the text is fine, but in XP normal mode, they are truncated so they appear to go 0 1 2 3 4 5 6 7 8 9 1. 1. 1. 1. 1. etc. There is clearly enough room for the text either way.
If I just set the default width to 28 instead of 25, as I found it, they are then fine, but obviously that isn't very good as then I need more room for the interface in Windows 7 and XP Classic, where it was already ok.
I tried getting average width from fontmetrics but the text comes back as 5, in all modes. I can't find any way of either reducing of the padding (which would be the best way), or finding out how much padding there is (which would do). Do I need to draw the column headers manually?
ps: Sorry for the JFace / SWT, have only just started with this and not clear on the differences yet!
Calling TableColumn#pack() should give a column exactly the width it needs to display its content without wasting any space or truncating its content. This includes the column's header text.
You should use the TableLayout for a more dynamic size calculation of your table headers. A good starting point is the following blog article: http://eclipsenuggets.blogspot.com/2007/11/one-of-less-prominent-novelties-in.html

iTextSharp draw line under text (heading) at a random location on a page

does anyone know how I can draw a line under a heading (a short line of bold text) that may be located in a random location on a page.
e.g.
My Heading 1
----------------------------------------------
Some random paragraph
My Heading 2
----------------------------------------------
I can do it as I have done above using a line of Underscores _ but in order to get the line anywhere near the heading I have to set the font size at 2 which results in a spotty ugly line.
I can also add two chunks over the top of each other (one with the heading and one with _) similar to the first example in this article http://www.mikesdotnetting.com/Article/82/iTextSharp-Adding-Text-with-Chunks-Phrases-and-Paragraphs using the same font size but it seems that this only works at the top of the page, once I add other paragraphs and try to do it mid-way down the page the two chunks separate with a clear line-break at the end of the first chunk.
It seems you can draw lines in iTextSharp but I have no idea how to calculate the coordinates, as all the examples I have seen use this method to place a line at the top or bottom of the page in a fixed location.
Any help greatly appreciated.
Cheers
Rob
The LineSeperator object might be what you're looking for. Wrap it with a chunk and put it where you need it.
Here's a sample line seperator:
Chunk linebreak = new Chunk(new LineSeparator(4f, 100f, colorGrey, Element.ALIGN_CENTER, -1));
doc.Add(linebreak);
I know this is an older post but, maybe this will help somebody.
//Create Chunk for underline
Chunk chkHeader = new Chunk("My Title", fnt13Bold);
chkHeader.SetUnderline(1f, -2f);
//Add Chunk to paragraph
Paragraph pHeader = new Paragraph(chkHeader);