This report is generated with jasper reporting tool with REST API. Report data is showing in an HTML page with an iframe. After loading data to the iframe, report HTML view showing a lot of white spaces in the right and left side. I have tried with increasing the iframe width in CSS. But this is not affecting the report. Is it possible to adjust white spaces from jasper report itself? I am using page size as A4 landscape.
I have attached the image:
Hi,
I have attached the image once again, You can see the Blank spaces on left and right side. How to remove this?. i have attached the jrxml link also. please help.
https://files.fm/u/56nnrd9z
Hi,
I have attached the Jrxml code link once again, please check it.
https://drive.google.com/file/d/1P9aeNW7YTIndNDyv8jkCwO_RQGf32iZu/view?usp=sharing
Various settings affect the output width of HTML reports, including:
Size unit (POINT vs PIXEL)
Zoom ratio
Page margins
For example:
final SimpleHtmlReportConfiguration configuration = new SimpleHtmlReportConfiguration();
configuration.setIgnorePageMargins(true);
configuration.setSizeUnit(POINT);
// Or try this instead of setSizeUnit(POINT)...
//configuration.setZoomRatio(2.0f);
final HtmlExporter exporter = new HtmlExporter();
exporter.setConfiguration(configuration);
If there are images in the report, consider using SVG format to avoid pixelation.
Additional information about these settings is at:
https://community.jaspersoft.com/jasperreports-library/issues/4483
https://community.jaspersoft.com/jasperreports-server/issues/6577
From the JasperSoft community site, you can set the zoom ratio in a JRXML file, described as follows:
You should be able to set a default zoom value by setting this property at report level:
<property name="net.sf.jasperreports.viewer.zoom" value="FitWidth" />
Other possible values:
ActualSize
FitHeight
FitPage
integers (e.g., 2 for 200%)
decimals (e.g., 0.5 for 50%)
Related
I'm making a Crystal Reports template. The template has some text in the header and then it has an image. If the text has a few lines, the image is normal and allowed in the first page, but if the text has many lines the image will be cut off in the first page and second page. Could it have ways to prevent the image from being cut off to the second page, such as auto-rescaling the image size?
I tried can grow and other settings in Crystal Reports 10, but it didn't work.
Report Design Picture
Make sure Keep Object Together in the properties of the image is checked. This will prevent CR to split your image across pages.
Best option in this case would be Create another section and place the image in that section instead of text and image in same section, This will force the image to go to another page if it doens't fit in first page.
For E.g, if data in report header, create one more section Report Header a and place text in that section and Report Header b and place image in this section
Scenario - We are developing a report using crystal reports. The report has to be printed on pre-printed template. The report is designed as follows - (the colors used are just for helping identifying the problem when report is printed on paper). We are using Visual Studio version 2010 with Crystal Reports for Visual Studio 2010
Problem - When I am exporting the report to .pdf, or viewing it on screen the report looks perfectly alright, but when I print the report on paper, the page footer is not printing at the bottom of the page, it is printing about one and a half inches above the bottom of the page.
Fix attempts -
In CR designer page setup, the size of the page is given same as that of the pre-printed template (12 inches height)
Used page footer as it automatically prints at the bottom of the page
Also tried using "GroupFooter" and set the option "Print at the bottom of the page" to true
Page size set correctly in the printer preferences
Anticipating problem with the printer, used another printer, but for no help.
Extensive googling for the solution :)
Any help on fixing this up would be really invaluable. Thanks
It is the custom size paper that was causing the issue.
To reduce the gap, just decrease the top margin and shift the fields of page header and report header accordingly.
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>`
I have a bar chart with horizontal bars. I used this article to setup the dynamic height property:
http://blogs.msdn.com/b/robertbruckner/archive/2008/10/27/charts-with-dynamic-size-based-on-categories-or-data.aspx
Everything looks fine in the viewer, but as soon as you go to print layout, pdf, et.al there is about 50% more blank space below the chart.
I've created a sample report (using AdventureWorks DB) to show what is happening. I placed 3 charts with blue backgrounds, each inside its own rectangle with gray backgrounds. The first chart has an expression in the DynamicHeight property, the second chart has a hard coded value in the DynamicHeight property of 8.5in, and the third chart has a blank DynamicHeight and a 8.5in in the normal Height property. I have it return 15 items to place in the chart.
They all look fine in the viewer like I said before, but go to Print Layout and the first and second charts take up twice the space with half of it being blank below the report.
I tried to post the .rdl code, but its too much for the size limit.
I have an open ticket to Microsoft that has been escalated.
We've filed the necessary request to get collaboration from our development team so we should be getting a response regarding this functionality sometime in the next couple days. I'll let you know what they say.
Development has later confirmed it was definitely a bug, now are trying to decide if it is worth it to add to the next cumulative update or wait until SSRS 2010.
The work around until this is fixed, is to place the chart control into a table/tablix.
I added an empty table, deleted the details row and the two extra columns, and added my chart that was giving me problems. Everything appears to re-size correctly now.
try setting up the interactive size, margin and page size. im not sure if it will work but you can try. page size - margin = interactive size. do not exceed from your page size when giving value to your interactive size and margin, this also can cause white spaces in print layout.
hope it helps.
best regards,
cathy
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.