I'm having a .jrxml file in which I have a text field whose width I've set to the maximum possible and I've set the "print when details overflow" and "stretch with overflow flag".
But when generating the report in pdf format from a collection source the text field stretches to 3 lines and for first entry and for next entry it stretches to 5 lines. But the data which I have in collection object is of 7 lines each. While generating the same for .odt format the textfield stretches to 7 lines for both the entries.
What is the issue which I'm facing here?
Solved the issue. I had used Calibri as my font to text field. Changed it to Arial and it stretched to full text.
http://jasperforge.org/node/531750
Referred this link. It had a comment mentioning that certain fonts create problem while exporting to pdf.
Related
I have a field that I'm sure does not have white space in it at a certain location, but for some reason Crystal Reports is automatically adding space to the field but only after X's in certain scenarios. This is a text field which I'm sure is pulling down from a text field in the db as well.
This is hard to explain without a pictured example, so here's what I mean:
Random Spaces
As you can see, there is whitespace after the X's. it should not be there, as this is not what is coming from the db. And strangely, when copy/pasted from the report, there is no white space either! Here it is when copy/pasted straight from the report:
"Test 15dig w spaces XXXXXXXXXXX2345"
Why is this occurring, and how can it be corrected? Currently there is no real formula for the field, it is just taking whatever it coming from the db straight into that field. The whitespace is being added automatically somehow, and I'm not sure at all why.
Here is what I've tried: Have tried calling ToText on the field (even though it is already a text field). Have also tried formatting the field in various different ways. Tried asking on SAP forum but no help as of yet.
Copy & Paste the text "Test 15dig w spaces XXXXXXXXXXX2345" into a text object in Crystal. Apply the same font and formatting (use the brush toolbar button to clone the formatting).
If you don't see the same strange space, the problem is due to non-printable characters in the database field. In that case, you can strip away such characters using a formula and the Replace() function.
I have a field that I'm displaying on a report that is a combination of text and codes that represent an image. Some of those icons have ascii symbols that I've used a replace formula to display them as their ascii version. For two or three of the images, I have no luck and have to display a mini picture for the representation.
The codes being sent are something like:
^he^ = ♥ ^st^ = ⭐ ^cl^ = 🍀 etc...
So for the clover leaf, there is no emoji support in my version of Crystal for clover leaves, and the ascii icon I found online for it just shows the empty square icon when an emoji isn't supported.
My workaround for this is to have a formula that converts all my icons to the appropriate ascii where supported, and to leave two blank spaces for the unsupported icons.
>stringvar gift_msg;
>gift_msg:= {DataTable1.gift_field};
>gift_msg := replace(gift_msg,"^CL^"," ");
>gift_msg := replace(gift_msg,"^HE^","♥");
>gift_msg := replace(gift_msg,"^ST^","★");
>gift_msg
I then put a suppression formula on each image that looks like this:
>mid({DataTable1.gift_field},2,4)<>"^CL^"
So I duplicated the image along the length of the field and increment the mid formula to match the field. I also set the font to Consolas so that it's fixed width to remove any surprises in spacing. My issue is that this still creates very strange spacing, and I'm almost certain there's a much easier way to do this.
One option is to use a free service such as Calligraphr.com to convert your image to a font.
Given that your image relies on several colors, the font option might not work.
Another option is to build the expression as html with image source directives where you need them. You would then need a create or use a 3rd-party UFL to convert the full expression to an image that you can load on the fly using the Graphic Location expression. At least one of the UFLs listed by Ken Hamady here provides such a function.
I'm using Jasper Report and iReport 5.5.1. I created a grid using rectangles and inserted static text fields. My problem is that the PDF output created with Java is different from the iReport preview. Below you can see the three screenshots, first from the editor, the second is the preview and the third is the pdf output. We can see the overlap of the text and furthermore the bold title is not printed bold.
It looks like a font issue.
To achieve the common behavior across all the outputs, Open the Ireport designer and apply below properties:
Font Name = "Arial Unicode MS".
PDF font name = This property is deprecated, so leave it blank.
PDF Encoding = 'Identity-H (Unicode with horizontal writing)'.
Hope this help you.
Regards,
Srikanth Kattam
Let's say I have a bunch of paragraphs coming from a Word file. These paragraphs have different styles applied to them (some are bold, some have smaller or bigger font size, some are italicized, different color, different font-family and so on). Is it possible to add all of these paragraphs into the same Text element in birt and apply the styles that correspond to each paragraph or do I really have to put each paragraph separately into its own Text element and then apply the style to each Text element in birt? Obviously the second approach is more tedious, I would love to find a solution similar to the first approach.
You can set the text element content as RTF and apply Paragraph Formatting Tags .
Take a look at this document for more information.
In Crystal Reports 2008, I need to have an accurate count of all of the lines that have been displayed in a sub report.
I'm using a shared variable and incrementing as needed when lines display. The only problem I'm having now is when a field wraps. We are not using a fixed width font, so going by field length does not solve the issue, as 'i' is not as wide as 'w' and so on.
Is there a way to find out if the data in a field will be wrapped, and if so how many lines it wraps to, or is there a way to find out what the height of the section that the field is in (or the field itself) has grown too?
Or, is there an even better way to count how many lines have actually displayed on the sub report?
No, there is no way to do what you describe.
If you used a fixed-width font, you could then do some math based based on "it wraps at X characters" do if length of string is 100, then it went 2 lines, etc.