I have 2 subreports, each report contains information for one column of what is going to be the result table. As some entries are quite lengthy I gave the rows of both subreports a same generic height size that worked fine enough for the hurry, but now it looks quite ugly so they want me to change it. So I was wondering if is there a way to coordinate both subreports, so that the one with the tallest cell of a given entry dictates the width of all the row and it sends that information to the other subreport to adjust the size of that same entry, just like it would happen on a regular table in just one subreport. If this is possible or do I have to use iText to make it happen?
Thanks in advance.
I've worked a lot with jasper reports and I've given this a lot of thought, but I can't come up with an answer for how to make the subreports communicate a section height. I had composed an answer about using a Java class to define a static height that you could set and get, but then realized that you can't specify anything other than a simple numeric value for the height, i.e. there would be nowhere to call the method to get the height.
So, I have two possible recommendations which may or may not work depending on the implementation details for your reports.
The first recommendation would be to use a single report if at all possible, or at least a single "bottom row" below the two subreports.
If that won't work, then you could try using a minimal height value for both subreport sections, but with a Stretch Type of "Relative to Tallest Object". Then, although they may not be the same height, at least they wouldn't be too big. Depending again on the details, this might accomplish what you need.
Let me know if this works or not, maybe I can think of something else.
Related
I am trying to create a table in a PDF document with itext7. But, if the content before the table is too big, the table gets split up between current page and next page. I want to insert a -
document.Add(new AreaBreak())
if there is not enough space left in the current page for the table to be inserted completely. However, I have no idea on how to calculate the available space.
Any help or pointers will be highly appreciated.
From your requirement to avoid page-break inside the table, I assume Table#setKeepTogether(boolean) is exactly what you need.
This property ensures that, if it's possible, elements with this property are pushed to the next area if they are split between areas.
This is not exactly what you have asked, however it seems it's what you want to achieve. Manually checking for this use case might be tricky. You would need to have a look at renderers mechanism and inner processing of iText layout in order to get available space left and space needed for the table. You would also need to take care of the cases like if table is to big to be fit on single page. Also #setKeepTogether(boolean) works when elements are nested inside each other.
How can I make my Crystal Report look like the attached image? I have had no success creating it with a crosstab.
The short answer is that Crystal Reports isn't really equipped to handle the format you're dealing with. And here's why:
Let's assume for a moment you've already figured out how to interpret your query into something usable. Since we aren't using a Cross Table, the best you could hope for would be setting a Details section for each individual time slot and arranging a large number of formulas into a grid shape:
The problem is that every Formula would need to be unique; interpreting whether there is a Class at that Time and Date, and which Class it is. There would be up to 168 of those formulas and you'd have to manually go in and modify each one to check for their own unique combination of Date and Time. Which defeats the whole purpose of using a computer - to make repeated tasks easier.
Plus you'll have difficulty with the formatting: You'd need to program every "cell" to use a unique set of colors based on the displayed Class. That part is technically doable, but there's no way to "merge the cells" when classes last longer than a half hour. You'd end up with something like this:
So don't torture yourself trying to make this happen in Crystal. Even with all the time and effort it would take to formulate the grid, there's no good way to make it look like your screenshot.
That said, it looks as though you managed to put a schedule together in Excel. Is there any reason you can't use Excel instead? It's a much more powerful tool, and a cursory Google search suggests it can handle queries as well.
It seems like a bug in icefaces. Most of the forums(in 2008/9, I could not find any recent answers in forums) says some solutions to over come this, but none of them give a solution which we can add columns widths as percentages. So what I like to know is, is there a way that we can over come this.
Description of the problem
When we add a scroll to a datatable, the headers widths become mess. And there's a solution that we can add fixed widths in pixel (columnWidths attribute). But it is not supported in percentage. So I am asking is there a better solution for this. Because I want the datatable widths to be changed from screens to screen(different sizes)
please help
You could create a profile of column widths to match the entities that you want to display in your backing bean.
As icefaces does not support the column widths yet.
http://www.icefaces.org/docs/v1_8_1/tld/index.html
Normally to use UITableView, the number of sections and rows per section are known. But what if they aren't? I want to implement a lazy search, so that I actually search for the next match when new data needs to be displayed. Something on the lines of: db.prepareSearch(query) and then call something like db.nextSearchResult() when it is time to display a new cell. The search result determines if a new section is required or not (search results are inherently sorted).
Not sure why it wasn't done this way to begin with, so that it asks for a section until no more are available or needed, and for cells in the section until no more are available or needed, instead of having to specify the totals, which implies having to finish the whole search before starting to display the first few results.
To get the number of sections and rows, it's easy -- ask your data source. If your data source has no way of telling you this, make a way.
For instance, if you have to query a table and ask how many rows there are for your sections, do that. Then, for each section, ask how many rows there are which match that section.
What it also sounds like is you want to paginate your data. Meaning when you get to a certain point, have a "load more data" cell or some-such. This is fine too, just add a sentinel node to your data source, and whenever that particular item comes up, display your alternate cell while you load your data, then remove it after your next data is fetched. I do this in a few of my apps.
If I'm understanding this correctly, at the point of drawing/populating, you will know how many rows/sections you have.
If your changing the underlying data using db.nextSearchResult() then you must be calling [tableView reloadData] to trigger a UI update, at this point you should know how many sections and rows you have.
I have to admit I'm a little confused to the exact issue here.
I would like know the limit of maximum number of rows that can be shown in the UItableView. Thanks in advance.
This Cocoa with Love blog post is very informative - it looks at the performance of a table view with thousands of cells.
The question is whether it has some internal hard limit - it's seemingly enough for most needs - the above post concludes:
The iPhone can handle tables with 100,000 rows — and it continues to scroll as smoothly as though it were only 100 rows.
There seems to be no maximum. You don't insert actively anyway, you just implement the delegate methods to serve the cells - they are not loaded all at once if done properly.
Just having tried it with one thousand custom cells, it worked without a problem. But with 3k even with index it is a lot to scroll, I'd consider putting them into a navigation hierarchy (but this heavily depends on your use).
One more thing: Make sure to be efficient when drawing the cells, i.e. implement drawRect: instead of cluttering the cells with labels, views etc., this will make scrolling much faster.
You will ultimately be limited by the fact that all the methods such as numberOfRowsInSectiin take integer arguments but hopefully you won't need to approach those limits :)
In numberofRawInSection delegate method we are generally return count of array which is Int type, so maximum number of rows that can be shown on tableview's section = Int.max
So let say capacity "C"
C = (maximum number of section) X (maximum number of item in section)