The generated report in DOCX format has invalid margins - jasper-reports

I'm using JasperReports to generate a word (docx) document but I have a problem when I want to try to print the doc. The exporter messes up the margins of the page. Does anyone know how to prevent that from happening.
I know how to set the margin in iReport, but it just makes the data generate further from the page borders, but the margins in word which can be adjusted at the top of the page is laying right at the edge.
Has anyone had this problem?

Are you able to specify the page size? Its possible that using this in combination with the margin settings will help the export problem.
If you are not too heavily invested in your Jasper solution, Docmosis and JODReports let you layout the document visually using Word or Writer then render the report in various formats. This may save you time in the long run, but all reporting systems have quirks. Hope you find a solution, especially when your output is not PDF.

Related

JasperReports page size scaling

Does anyone know if there is a tool out there for scaling a JasperReports report up or down to fit different page sizes? The scenario is say I create & layout all my reports in the LETTER size. I want to be able to change to say size A4 on the fly and have all the elements adjust accordingly in width & X position.
Right now I'm writing my own code to do the scaling but I wanted to put this out there in case somebody knows of a tool or something in the JasperReports framework that I can use.
UPDATE
I created an open source project for JasperReport scaling: https://github.com/flex-rental-solutions/jasper-reports-scaler
It's still fairly primitive but we use it in our app successfully. I'd be delighted to see it grow from community support.
open the report with xml or text editor and add these two lines:
<Page width> 210mm </Page width>
<Page Hieght> 297mm </Page Hieght>
after this line:
`<Page>`

ssrs 2008 column width changes on run and pdf

I have designed a report in SSRS 2008 with three tablix that display data from different SP. When I designed the report and then previewed it, the report looked perfect. I deployed the report to our report server and viewed it. The report displays the last table with several columns that are either too large or too small. When I then export the report to PDF after I run it on the report server then the report appears the way that I designed it.
Does anyone have an idea what could cause the report to display wrong when it is run but correctly when it is exported to a PDF?
This is pretty common. I struggle with this same issue.
Edit: double check CanGrow and CanShrink on both the cells and tablix. Maybe your is interpreted differently and therefore is larger in web view?
Firstly, you're just going to have to play with your settings until it looks like in all output formats. However, here are a few tips to help:
Don't use rectangles, ever. Everything should be in a tablix cell. You have much finer control and it is less likely to blow up in PDF and web viewer.
Stay away from your margins. I try to keep at least .25"
Watch your padding. If you have top and bottom padding of 4, and your text is 10, but your cell only allows 16, then you're going to have a bad time
Use Ctrl + Mouse Scroll to zoom in and check formatting. This won't show a lot of errors, but it's something to check.
Even though your top cell and top line of the tablix should be identical, they aren't always. I can't tell you why. However, don't put a BorderStyle on both. Sometimes the border doubles up and looks wider in some of the output formats.
Always check all output formats prior to handing your project to QA. If is very common for report formatting to blow up once deployed. I have to double check Portrait vs. Landscape formatting and my borders. I miss that sometimes.
Sometimes font sizes can be interpreted differently. There can be very slight differences that can change the sizes of your cells.
I hope this helps.

RDLC Export to Word Showing a blank extra page

Im using RDLC for VS 2010 and exporting the graph to a word document gives one extra blank page (its not showing in PDF though). All of the dimensions in Report, Chart and Body are set 11x8.5 with no margins. I just wonder what could be causing the blank page in Word.
I was having the exact same problem and managed to solve it by adjusting the layout of my report.
Basically I moved all of my rectangles/tables etc to sit tightly next to each other, eliminating any white space where possible and also resized the report to be as small as possible, i.e. sit tightly against its contents.
It might also be worth enabling the report option to 'ConsumeContainerWhitespace'.
I suspect Word uses its own pagination logic, which is why you see a difference between pdf and doc. So it may just be the case that your report is over-running very slightly into the next page and saving a little space on the report may prevent this.
I realise this is not a precise answer, but I hope it helps nonetheless.

SSRS output to Word formatting issue

I have a 2008 SSRS Report that is being export to as MS Word doc using the standard Export functionality provided by the SSRS tool. Even though the data on the report is textual in nature and resides in text boxes, the Export is rendering the text using tables. This formatting is too cumbersome for the users. Is ther a way to adjust how an MS Word is rendered using the SSRS Export functionality
The regular export can be pretty ugly. OfficeWriter has export functionality that can be a bit prettier. If you need a ton of control over the style of the resulting word documents you should take a look at it.
DISCLAIMER: I'm one of the engineers who built the latest version.
Is ther a way to adjust how an MS Word is rendered using the SSRS Export functionality?
No
MS word and SSRS are like the long lost friends still trying to figure out things on rendering. One way I dealt with this problem is to make sure there is a master tablix and the rows are filled with the tablix calls the information to be displayed and aligned. If there is any sort of information to be displayed together place a different tablix and try to avoid using the row visibility which have heavy chance to leave empty space when rendered to word.
And there are chances of the header and footer to be truncated. To solve this place a text box above the entire header and below the footer make sure the textbox font color is white to hide the textbox.

Crystal report (or SSRS) flowing text around image

I want to have this layout in Crystal Reports:
How can I do this? If it cant be done in CR or SSRS, is there any other alternatives?
I don't believe this can be done with Crystal Reports. I'm not as familiar with SSRS, but after looking through the field options I don't believe it can be done with it either. In general field locations are set static in reporting solutions.
I think this would be best done with html/css or even XSL. I don't know the scope of the issue, but I'd assume that you should be able to output an html or xml file from your application which could be opened with a web browser. For html you should be able to use the align or even float attributes or text-align in css to accomplish this.
I hope this helps.
If you want to have multiple columns of static text in Crystal Reports, then you'd just have to get creative with multiple text boxes, i.e. create 2 text boxes side-by-side and add text to each one until it looks right.
If you want to have 2 columns of data, here's how:
Keep it simple and start with a blank report.
Add your fields of interest to the details section. Resize them so that they only use the first 4 inches of space.
Go into your Section Expert->Details and turn on the Format with Multiple Columns option.
A new tab will appear called Layout. For this example, let's set the Width to 4 inches and leave the Gaps at 0.
Preview your report. If you have enough data in your dataset, it will automatically flood over to the right side of your screen.
It'll take a few minutes of fidgeting with the measurements to get everything looking the way you want. You can even have more than 2 columns if you set the Detail Width small enough.
Also, there is also an option in the Layout menu called "Format Groups with multiple column". It's hard to describe in text, but play with this if you have any grouping levels.