Warning the element position is invalid. Text being cropped in iReport Jasperreports - jasper-reports

I am using iReport 4.5
If you look at the image below, you will see a warning. The warning says:
warning the element position is invalid
When I preview and export as pdf, then some of the text at the last block (bottom of the page) is getting cropped. I think it might have something to do with the band height, but I have adjusted it up, and it still doesn't work.
The text and style is embedded in a static text. If need be I can show some code.
I have also blacked out some information which is not needed.
I also sometimes get a warning:
Element bottom reaches outside band area: y=1 height=543 band-height: 543

I fixed it by adjusting the band height from the detail, then I made sure that band height from the text also matched the one from the detail. That seemed to do it.

Related

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.

Vertically center report footer in remaining space on page

Is it possible to vertically center my report footer in the leftover space at the end of the page? The size of this leftover section depends on number of data rows.
There's no easy way to vertically center things in Crystal. Frustrating as it may be, there's no Vertical Alignment property on most things, and the Size/Position of things is static except when other objects push them around to make room for themselves.
However there is a ridiculously silly hack you can do to make this work.
Write a formula, let's call it SillySpaceFormula, that uses a loop to generate a certain number of return characters. Based on the number of records on this page, SillySpaceFormula will grow or shrink inversely. Set Silly's font size to be half the size of your details section. Then place this formula in a section above the orange-outlined box and set "Can Grow" to True.
If you do this just right, SillySpaceFormula will grow by one line when a record is removed and shrink by one line when a record is added. Because the formula field Can Grow, the orange box in your screenshots will be moved up and down automatically.

Text component displaying lines in reverse order

Alright, I do not know how to fix this and only ran into this problem after trying to put in some longer text on a UI Text component. I have tried both pasting a value into its Text attribute through the Unity editor, and setting its value programmatically like this:
t.GetComponent<Text> ().text = "This is where meat, fish, and [...] (long text)"
Because Horizontal wrap is on, the text wraps when it reaches the edge of the available space.
However, the text displays backwards. Meaning, the start of the paragraph is at the bottom, and bottom at the top. Taking off wrap fixes this, but then the font size has to be really small (or it won't all be visible), and it can't form a normal paragraph because it has to... you know... wrap.
Is this a bug in Unity?
This is what happens - as you can see, it is displayed backwards:
The negative Line Spacing value is what is causing the issue here:
When the value of this field is less than 0, the lines will actually be arranged backwards, leading to the behaviour you're currently encountering. Just change the value to a positive number to have the text display correctly.

Jasper sub report border line not covering all tuple height

All Works fine but, rows margin do not cover all height. as shown in attached these two pictures.
How I am doing: I put rectangle in detail band, than sub report and other fields. on all fields, sub-report and rectangle i also apply stretchType="RelativeToTallestObject and isStretchWithOverflow="true" for warping up the text which works fine. I am facing this problem still unresolved.
As per my understanding: sub-Report fields are also stretchType="RelativeToTallestObject but didn't detect or get stretched of its main-report column. while if sub-report need extra space it will show properly. I have tried almost every thing available in iReport-Designer.
Drop figures. Use borders, preferably via report styles.

iReport Designer - dynamic list and page number

I have put a list inside a rectangle with Relative to Tallest Object property which is inside a frame with Float property. All the components are inside the detail band. The size of the list component depends on the list which is sent from my Java application.
When I print a report with 100 objects inside a list, all records are not printed inside a rectangle. I don not know how I can fix it. Just the first page has a rectangle.
Also, I have a problem with page number. I put the page number variable at the bottom of the detail band with maximum height, but it is printed just on the first page. On other pages there is no any page number.
It would great if someone can help me.