I have placed two crosstabs one below another. But They are not getting aligned. How to align the two cross tabs such that corresponding columns align perfectly.
The quick and dirty way is to use fixed widths on all cells.
This will work fine for PDF, but will not work for HTML if:
You're using a modern browser (IE9+, FF/Chrome from last 5 years)
The total width exceeds screen size
There is no total width set on the crosstab itself
It will then ignore the cell widths and try to force everything to the screen width, thus the crosstabs will not align again.
I wrote some JavaScript awhile back which will combine two tables into one so fixed width is not needed. The full blog post is here. This will only affect HTML outputs, so for PDF I created a second page and just conditionally rendered one depending on user selection.
Fixed width is the only viable solution )
But you can use Report Classes to have a single “width” definition and apply it everywhere. It actually makes your reports look way neater.
Use Blocks in the cross tab cells, you will need to unlock the report first to do this
Set the block size to be the same on both cross tabs and then select content is clipped (Size and overflow property of the block)
This will work for both html and pdf output
I was able to do this by doing the following:
Set the Size & Overflow > Width of BOTH crosstabs to the same width in pixels.
Unlock the report, select the crosstab Text items in BOTH crosstabs and set them all to the same width (or individual columns to the same width if needed).
With the report still unlocked, select the text items in the crosstab 'Rows' and set those to the same width.
It's not pretty, but nothing in Cognos ever is.
Related
I know how tricky it is to align things in a way that allows a clean export to excel, however, on this one I am stumped and have never seen it before.
Anyone know why the excel rendering extension insists on inserting a column like in the attached image?
Things that I have tried.
Set the table's position to 0,0.
Removed all borders and padding.
Set the report margins to 0,0,0,0
NOTE : I am using the EXCELOPENXML rendering format as opposed to EXCEL in order to support *.xlxs.
Groupings:
First Column in the Designer:
The report was being rendered as a sub report and was placed in a rectangle and aligned right in the main report, however, the rectangle was one twip off from left align. Once I aligned the rectangle in the main report, the phantom column disappeared.
I am trying to determine the visible worksheet area in points. So far, I have tried the Application.Width, but that gives me the entire area including the scroll bars, and likewise Application.Height includes the ribbon and horizontal scroll bar. What I need specifically is the size of only this viewable worksheet area.
Something I have tried so far is looking at the visible range. For example, if I can see A1 thru AA40, then I can use the code
Debug.Print ws.Range("A1:AA40").Width
Debug.Print ws.Range("A1:AA40").Height
The only problem with this is if I can see half of column AB and half of row 41, then I don't have the full size. Also, it is not adjustable if I decide to change the application window size to half the screen.
I have no need for converting into the number of pixels, I just need the point sizes. Does anyone know a way to get the visible area size, or at the very least how to resize a range to fit only this visible area?
You can access the Windows collection of Application and use the Width and Height properties of items of that collection. E.g.
Debug.Print Application.Windows(1).Width
Debug.Print Application.Windows(1).Height
You can also refer to ActiveWindow and get the properties from that as well.
Example:
Grid's dimensions:
?Activewindow.activepane.VisibleRange.Height, Activewindow.activepane.VisibleRange.Width
The above worked for me, returning the dimensions of only Excel's grid which could be seen on my screen- no scrollbars, no Ribbon, no formula bar - just cells displayed.
I have an Excel file generated by JasperReports. What you can see here is the Excel's column will be display ### if the number is too long. I don't want to resize the width of column, i just want to display the number without seen as ### and stretch the height. I have tried set the column to Stretch with overflow and Stretch type = Relative to band height
This is the screenshot:
You will need to set the appropriate Jasper Reports excel property on your report element, or on the whole report iself. Documentation: http://jasperreports.sourceforge.net/sample.reference/xlsfeatures/
Specifically
net.sf.jasperreports.export.xls.column.width.ratio
If these properties are not available in your JasperReports version, you may have to simply fiddle around with the sizing to get something decent.
I am getting started with Android, trying to write a "concentration" game for kids where a screen full of text is separated into buttons, filling the screen (one word per button)
The buttons should wrap to the contained text, so longer words will have longer button widths.
Once a row fills up, the next button should flow to the next row, and so on, until the whole screen is filled with evenly spaced variable width buttons.
The number of rows and number of buttons per row varies based on screen size (and as mentioned, button width)
I could use a vertical linear layout, then insert horizontal linear layouts to contain the row text. However I don't see how to make those widths and number of rows vary based on the screen size and text size.
I presume I need to create my own custom layout, something like FlowLayout in Spring - if so, can you recommend a tutorial for how to do so?
Check android's API Demos
Animation->DefaultLayoutAnimation (for example)
LayoutAnimationsByDefault.java & layout_animations_by_default.xml (for source)
It uses GridLayout and with a bit of modifications of mentioned example, it will be useful for your case..It's flexible, it's available since API Level 14, but it's available trought support/compatibility library or 3rd party library .
Hope this will help.. Cheers ;)
I have report with dynamic-width list which when exported to pdf has every second page blank. I followed instructions given here, squeezed everything as hard as I could - and it worked. However I also have footer inside which I have horizontal line that should continue through whole page width. If I make it long I have every second page blank, if I make it short - it stays that short. Also suppose I need to have textbox at the far right corner of a page, which again would make blank pages in pdf to appear. Is there any solution to this?
One thing I have found useful to diagnose exactly why SSRS is generating blank pages, is to set the background of the report (or report elements) to a non-white color. Generate the report again, then you can usually see what is being spilt over into another page. You can usually figure out what SSRS is doing, and tweak your report accordingly.
Set the report property ConsumeContainerWhitespace to True. I believe the default is false, so if you didn't think to ltrim(rtrim()) in your dataset, something I often forget to do, then the whitespace could be causing it.
For the line, if it is simply to separate the footer from the body of the report, try selecting the entire footer row and set the BorderStyle-Top property to Solid instead of having a line.
For the text box, it has to be entirely within the page dimensions or you will get a second mostly blank page. Left margin + right margin + report width <= page width. On one of our printers this still isn't enough so we have to reduce the right margin by another 0.05cm more (so 0.45cm instead of 0.5cm which it should be) to stop getting blank pages every second page.