Jasper reports: Overlapped fields not shown in excel output - jasper-reports

Take the following example:
I have one very wide column (lets say 150pt), positioned on x=0
I have 2 columns of 25pt, positioned on x=100 and x=125. Thus, these are overlapping the first.
Depending on certain conditions (parameters to the report), I do or do not print the 2 overlapping columns. I do this by using the "print when expression ...".
This works like a charm when I use the PDF as output, but when I generate the report in excel, I do not get the big field, it is just missing. As long as I do not print the 2 overlapping fields, everything remains OK.
Any ideas on how to solve this one?
Thanks

Sounds like the answer is no ... hopefully there is a better answer
http://community.jaspersoft.com/questions/503288/missing-columns-excel
... the columns are overlapping. And the so-called "grid
exporters" like the HTML, XLS and CSV exporters do not support
overlappging elements. The elements that are behind do not print.
I hope this helps. Teodor

Related

Extract word between two words in Tableau

My data in a single column looks like this
Environment: PROD_A
JobName: MY JOB NAME 1
MemName: Some_Script_names
My aim is to create a calculated field where it fetches JobName.
In above sample. The output should be MY_JOB_NAME_1
Here's my code in Tableau -
MID([Description],FIND([Description],"JobName: ")+9,
FIND([Description],"MemName: ")-FIND([Description],"JobName: ")-9)
The above logic is same as excel function below. It basically finds first word and last word and then picks the one in between.
=MID(A1,SEARCH("JobName: ",A1)+9,SEARCH("MemName",A1)-SEARCH("JobName: ",A1)-9)
Issue -
Tableau is showing blank data. Not sure where my logic is wrong. Any help is appreciated.
You may be able to use REGEX funtions (depending on your data source). Try this: REGEXP_EXTRACT([Data],'JobName: (.*)')
I see that you commented that the text is in one cell and not one column as you wrote in question.
This finds the JobName and uses that position plus the lenght of it as the startposition, then finds MemName as the endposition (and calculates the number of characters between them)
=MID(A1,FIND("JobName: ",A1)+LEN("JobName: "),FIND("MemName",A1,FIND("JobName: ",A1)+LEN("JobName: ")+1)-(FIND("JobName: ",A1)+Len("JobName: ")))
The following tableau calc works, this assumes that there is no space after MY_JOB_NAME_1 and "MemName:"
MID([Text],
FIND([Text],'JobName: ')+10,
FIND(
MID([Text],
FIND([Text],'JobName: ')+10)," ")-9)

jasperreports studio - hard to get the column header to line up with the detail

I have headers/details in the jasper reports studio. everything about this works wonderful minus one annoying thing I have to constantly line up the column headers with the details to make the alignments act correctly... even though i match the alignment exactly in the designer.
This is probably because I have a different font style on Header versus detail... or something? I'm not sure.
I can workaround the issue by manually tweaking X-coords, export the report, make sure they line up, until it looks nice... resulting in a designer like this:
Notice how I moved the values in the Detail 1 band to the left so that the report with actual values lines up the columns correctly.
I must just be doing something wrong right? Why do I have to do this manual tweak to get things to look ok?
I had the same issue when using Jaspersoft Studio.
I'd recommend you to use iReport instead, it's much more convenient for JRXML development and does not have this annoying issue in fields alignment.
It seems that the cells in "Detail 1" are set to display centralized text while the ones in the "Column Header" are left aligned. Try left aligning the text in the Detail 1's cells and see if things work out.

Column visibility not working when exporting to Excel

I have a column in my report that I want to hide based on an expression:
=IIF((ReportItems!Textbox16.Value ="USD" OR Parameters!BinderID.Value=10263 OR Parameters!BinderID.Value=10536 OR Parameters!BinderID.Value=10718 OR Parameters!BinderID.Value=10248 OR Parameters!BinderID.Value=10535 OR Parameters!BinderID.Value=10960),True,False)
When I run the report the hidden expression is working very well: the column is hidden. However, when I export to Excel the column reappears while it shouldn't.
This discussion would suggest it cannot be done, and would require a work around such as a separate report with only the columns wanted.

Is there a way to detect when a field mark with 'can grow' has truncated the field data?

I do not normally work with crystal, but I have spent nearly 2 days looking for a way to do this.
The problem is that I have a number of lines of text that need to show on a report, but need to cut off after 8 lines and show a 'more' prompt to inform the user that they need to go look at the rest of the details online. This was originally handled by storing the data as individual lines already wrap to size and counting the lines with a formula and conditionally showing a separate 'more' field. They have since added the ability to use html to the text, but this made the current way of doing things wrap incorrectly and show the html mark up.
I wrote a database function to combine the text into a single field and use the HTML text interpretation to display it correctly on 7 other reports that do not limit the text length, and the max line count works great for limiting the text size, I just can't figure out how to show the 'more' prompt when needed.
Any suggestions would be greatly appreciated.
GrumpyGeek,
If your database function now combines the text into a single field does this mean the original way, with the separated lines, is still stored? If so, why not add another calculated field called 'line-count' that tallies the old line-based data?
So you'd still have your new combined HTML field and this new field that you could use to show the 'more' button when 'line-count > x'?
Alternatively, another option might work, but would be a bit touchy. That is to make the formula that shows the more button trigger when the field length exceeds x. The catch is that html mark-up isn't displayed, and heavy use of it would skew the amount of text required before you should show the 'more' button. Put another way, a field with very heavy use of mark-up ( and tags) might force the 'more' button earlier than it should. Unless you could somehow make either your 'line-count' calculated field exclude the mark-up OR make the length calculation do the same.
This would be possible if MSSQL or Crystal Reports could run regex to strip the mark-up.
If NONE of the above works, the only other thing I can suggest is to look into UDFs. Crystal allows you to load an external library that you write. These will read functions you write and show them in the function list inside Crystal. If you do this, then you could easily write a routine that strips the HTML and calculates when the more button should be shown.
Good luck with it.
Ideally, there would be a property of the DB field that would return its displayed line count. Unfortunately, there is no such property.
You could try counting the # of line ending characters (e.g. carriage return, line feed). If they are > 7 then show the hyperlink. In a HTML situation, you have to count ending elements (e.g. ). You could make use of a RegEx UFL to make it easier to identify the elements.
Probably the easiest route is to the DB to calculate the # of lines and return that as another field. Use this field to hide/show the hyperlink.

JasperReports: Items is pdf are printing on top of each other instead of beside each other

I'm using JasperReports to generate pdf files for customers. For some reason some items are stacking on top of each other instead of printing beside like they are supposed to.
Here is a design of my report:
Any help is appreciated.
It sounds like you have the "Position Type" set to "Fix Relative to Top". Change it to "Float".
EDIT: I just received a sample report showing the same behavior. It looks like a bug to me. In that case I got the desired output by appending a space. "JG" would break into 2 lines. But "JG " would be rendered on a single line. I cannot explain this. It's clearly a bug. But if you are hitting the same behavior, then appending a space might solve it for you as well.