Lotus notes view to display first 10 documents from another view - view

I have a view (say A) with 50 documents, now I want another view (say B) to show only first 10 documents from view A. Is it possible through view selection formula?

It's not possible to do this with only the selection formula. All solutions require running an agent, because view selection formulas can't do any lookups that refer to other views. The agent can run nightly, hourly, or whenever a document is added or modified in the database.
The most direct way would be to make B a folder instead of a view, and write an agent that walks view A to find the first ten documents and adds them to folder B, keeping track as it goes along. Then it walks the documents in folder B and removes any that are no longer currently in the top ten.
If you need to stick with a view for some reason, then you will need your agent to mark the first 10 documents in view A with a field value - e.g., Top10inA = 1. It will also have to clear that value from any other documents that used to have it. Then you can set up your view B with the formula SELECT Top10inA = l.

No. Views don't allow you to select just the top N documents to be displayed.
What you can do is write a scheduled agent to either:
a) Loop through all the documents in view A and set an item named "SortOrder". Then set the selection formula on view B to show only documents with SortOrder <= 10
b) Loop through the documents in view A and move the first 10 documents to another folder B (instead of a view)

Related

Oracle Apex - Display Item as a Percentage

I'm trying to show a text field item as a percentage, issue is that there are several queries depending on this item (it refreshes reports based on the value).
Right now I have decimal values in there (1 = 100% , 0.5 = 50% and so on).
But the customer is asking to show this item as a percentage (50% when I have 0.5).
Does anyone know how to achieve this?
PS: The #col_name#% approach doesn't work well for this case.
Thanks
One way to solve this is to have the a 2nd item.
Suppose the base item is P1_COMMISSION and that is the value stored in the database - I suppose that would be a value between 0 and 1. Create another item called P1_COMMISSION_PCT which is displays the percent value. If this is a form item, this item would not have a database columns as source.
Make P1_COMMISSION hidden
Add a computation after the form initialisation to calculate the P1_COMMISSION_PCT based on P1_COMMISSION
Add a dynamic action on change of P1_COMMISSION_PCT to recalculate the value of P1_COMMISSION
One option is to
set current item to be hidden (so that you wouldn't see 1 or 0.5 as its values, but other objects would still be able to use it) and
create a new, display only item, whose source would be current item, but properly formatted, e.g.
TO_CHAR(TO_NUMBER(:P1_COL_NAME) * 100) || '%'

(Lotus Notes)Can the view set conditions (example: formula) to be shared?

There are many outline items (menus) and many views and forms in the current running system.
The view is actually the same content, but the conditions are different.
Is there a way to have only one view and set conditions in the outer frame to display the content of the view?
for example:
There are 3 outer frame items (menu), click any outer frame item, a view will be displayed.
Menu 1 will open the view sorted by name
Menu 2 will open the view sorted by serial number
Menu 3 will open the view sorted by date
The views are all the same content, but different sorting methods are set to display.
As in the example, because there are 3 sorting methods, there are 3 views.
Is there a way to become only one view?
You can't control sorting. If you look at the NotesUIView class, you'll see there are no methods available for that. There's not much available there at all.
The only way you can control a view from code outside the view is by embedding it in a form, subform, or page, and using the Show Single Category feature.

Telerik Reporting: Repeat a page containing 2 graphs and a table

I need to build a report (in Visual Studio) that takes an ObjectDataSource, and groups the data into separate pages. Each page needs to contain 2 graphs and a table that deal with that particular group of data.
How can I approach this? There is some documentation on page breaks on groups in a table, but my pages need to contain charts as well. Is there a demo that shows how to build what I need?
Eventually I will also need to add this report into a ReportBook, but first things first.
If I understand your question correctly this should be straightforward:
Create a new report
Add a group definition to group the data into the two distinct groups that you want to display. [Careful here because if you don't define your groups correctly, you could end up with more than 2 pages] Use a Boolean or "greater than" and "less than or equal" (or vice versa) are your best bets.
Size the Group Details section to be the size of the page you want (8.5"x11" or whatever fits on "one page")
Insert a Panel into the Group Details section and expand it to be the same size as the Group Details section
Anchor the panel to all sides, and set the CanGrow and CanShrink properties to "false"
Inside the Panel add your Graphs and Table and bind to the grouped data
Set the Page Break property of the Group Footer to: "After" to separate the data into two pages

Hide some charts and show other in one report

I have a report with 24 charts, one for each hour of the day. The user can choose to show one, a couple, or all the charts, based on a drop down. The drop down is tied to a parameter that allows multiple values. See below:
The problem is that if the user chooses one or a few hours from the drop down, all the charts show, and the one(s) chosen give data while the others say "no data available".
Currently for each chart I've added the following to show data if the value was chosen in the drop down:
=Switch(Parameters!HOURINPUT.Value(0) = "0", false)
Is there a way to hide the charts that the user did not choose from the drop down?
It would look nicer to hide the chart and see only the ones chose than have a blank box that says "no data available" in them.
UPDATE:
More than one parameter.
Assuming that the only differences between the charts are the hour of the day specified, then I suggest:
Add a new dataset to the report with values 0 to 23 as selected in the entered HOURINPUT parameter - something like: with cte as (select 0 n union all select n+1 n from cte where n < 23) select n report_hour from cte where n in (#HOURINPUT)
Add a new tablix to the report, with a single detail cell only, bound to your new dataset.
Move one of the existing graphs into the new table's detail cell so that it becomes a subreport, replacing all hard-coded time references in the graph with references to the report_hour value from the new dataset.
You can then remove the other 23 graphs.
In addition to ensuring that graphs are only displayed for the times selected, this should also simplify future maintenance of the report, since any changes required to a graph will only have to be entered onto the one graph (instead of all 24).

Drupal View - load more with ajax

I have a View (block display) listing node titles of a certain content type displaying the latest 12 published items. It displays underneath all nodes of a specific type.
What I'd like to do is be able to load the next 12 items with AJAX (I know the pager does this but I was hoping to avoid it) and also control the offset based on the node title.
I think the second request can be achieved with the row number in the query but so far I'm having trouble achieving a working script.
you always can call view results from Drupal API:
$results = views_get_view_result('my_view',$display, $args)
and in arguments you can pass start/end number of items, or something else, depends how you sorting your results
Well, instead of that work, how about selecting the mini pager? I'm pretty sure it only shows previous and next links. If it's not the exact display you want to use, you can override theme_views_mini_pager (from views/theme/theme.inc, line 636) to only show what you need.

Resources