I need to have one master page header on the first page and another master page header on the next pages of BIRT report.
I am using 3.7.1 version.
I inserted a grid with two rows to the master page header.
I put one new grid into each of the rows.
First nested grid for the first page header, second nested grid for the next pages header.
I set an onRender scripts:
//first nested grid
if( pageNumber > 1 ){
this.getStyle().display = "none";
}
//second nested grid
if( pageNumber == 1 ){
this.getStyle().display = "none";
}else{
this.getStyle().display = "block";
}
This works ok with the sample database, from JDBC Data Source.
But I need XML Data Source and with that it does not work at all.
It seems as if with the sample database table, the onRender event gets called on every page, but with my XML Data Source it only gets called once.
Please, If you could help me solve this mysterious problem I would appreciated it very much.
erisa
It shouldn't matter what the dataSource is. I did test it, just in case, though, and it worked for me when using an XML source. The only thing I could think of would be that you're using auto layout and have a page break interval of 0 on your table. Outputting to PDF would then just show the page 1 header, each time. It wouldn't matter what dataSource you have. You might take a look at this.
If you want to do this:
P1: Header Grid1
P2...: Header Grid2
(in your special case Grid1 is R1,R2 and Grid2 is R2 if I understand correctly)
There's a trick:
In your master page properties, tell BIRT to not display the page header on the first page and put Grid2 into the page header.
However, BIRT still reserves the space for the header.
Add Grid1 as the very first object to your report layout and use a negative margin for Grid1 to move it up accordingly.
Note: This works with the PDF emitter, but not with the Word Emitter.
Related
Can dynamic text be entered into a header or footer of a master page?
I have placed dynamic text into a grid which then sits in the master page footer, this doesn't work and gives error:
ReportDesign (id = 1):
+ Invalid javascript expression: ReferenceError: "row" is not defined. (<inline>#1)
When I test the expression in the footer of the report layout itself this works.
Please see the expression below:
if( BirtComp.lessOrEqual( row["Aggregation"], "1,500.00" )){"user1.jpg"}
else if (BirtComp.greaterThan(row["Aggregation"], "1,500.00")){ "user2.jpg"}
The easiest way to use dynamic text in the master page is as follows:
Optional, but recommended: Create a dataset "MasterPage" which selects the dynamic data that you need.
Create a grid in the page footer (and/or header) of the master page.
Bind the grid to the dataset "MasterPage".
Use dynamic text items and data items inside the grid as you like.
Important:
The grid uses only the first row returned by your dataset.
Thus, it is best practice to create the dataset in such a way that it will return exactly one row.
This means that BIRT aggregation functions won't work here.
If your "MasterPage" dataset is JDBC based, you can of course use SQL aggregation functions like SUM, COUNT etc.
It is not possible to access "the current first record for the current page" this way: The "MasterPage" dataset returns one record for the whole report.
I have long list of rows in interactive grid. As I scroll down, the grid loads more rows. The select all checkbox on top only selects the rows that have been rendered in the view. Is there a way to select rows that have not been rendered yet? or Is there an event that gets fired when loading is complete?
There is no event that occurs when the last page of results is loaded.
You can detect if the last page has been loaded using this undocumented / unsupported method:
var g = apex.region("emp").call("getViews","grid");
if (g.model._haveAllData) {
// all the rows are now shown
}
To load an additional page of results:
g.view$.grid("lastPage");
Note: don't do what I did and try to put these in a simple Javascript loop - this fails because the loop wouldn't wait until each page is loaded before trying to load another.
An approach I might take if the number of records is expected to be <1000, is to change the pagination to Page, and the number of records per page to 1000. That way you know they'll all be loaded initially.
I have a dynamic Kendo grid, for which I get the data every time from the server with the column configuration. The grids renders the data as expected, but sometimes the grid does not render the data at all and only renders the column headers. The grid does not even recognize the column configuration, which mentions whether the column is hidden or not, column title etc.
When I refresh(ctrl+f5) the browser page the grids starts displaying normally.
When I checked the html generated in both cases I saw following difference
1- The Grid which displays correctly
Has a thead and tbody inside a single table
2- The Grid which does not display the data
Has two different divs for header and content
Please see the following image for Good Grid
And following image for Bad Grid
I am not sure why the same grid has two different htmls? Can anyone please help?
EDIT
One more thing that might be helpful.
The kendo grid definition is in a content.html file. And this file is used as a content URL for kendo tabstrip control. There are around 7 tabs and all the tabs are refering to the same content file.
I'm trying to find a way to get the page number of a specific record.
This is my problem, after I add a new line I reload the grid, with sorting on, the new line can end up on any page. I need to be able to find the page number of that specific record, so I can navigate to its page and select it.
How can I do that, without having to load every page until I find it.
As I see to to accomplish where you would add a new record, reload the grid and then have that displayed page be the page where the new record would be found in a sorted grid. As a solution I think you would need to set the reloadAfterSubmit: false, and then generate your own reload where you would pass in (via postData) a value that would tell your controller to change the page of data to return to the jqGrid.
When the controller would receive a value in this field you would have to write some code to find which page of data the record would belong to and then pass that page to the jqGrid.
As the grid would be sorted, you could find where where that record would be in the sorted dataset and then grab that page. If you didn't have a very large dataset you could just iterate through every page till you found the page that would contain your result, but the method would depend on how large of dataset you would have. (Ex 5 pages of records, probably acceptable to just iterate through them all, as the dataset becomes larger you will have to look into fetching the proper page of data.)
I have 2 grids. in both of them i use loadonce:true .
In the first grid i have a cell with an onblur event which
opens a dialog with the second grid.
after i edit the second grid i want to save as xml it's content and
ascribe it to the row of the first grid (the row witch opened the dialog).
In the end i want to generate an xml from the first grid that will
include the xml I generated before in the second grid.
so what is the best way to implement this?
Thank's In Advance.
Depend on how exactly you implement the scenario which you describe you could has any data in the internal data parameter of jqGrid existing always if one use local datatype or loadonce:true in your case.
Direct accessing to the data parameter per jQuery("#grid_id").getGridParam('data') get your reference to the data array. The data array contain all data of the grid (not only the current displayed page) and the data are not yet placed in the <td> element. So the data are unmodified and could contain for example any XML fragments.
UPDATED: To make you easier to understand what I mean I made the small demo. If you double-click on a row you will see the XML data associated with the row.
The "note" column can be hidden. Because all hidden columns exist in grid as HTML markup I made it visible. You can see the difference what can be saved as grid internal data and what can be displayed (also as hidden data).
UPDATED 2: You can consider to use autoencode:true option in your grids.