Hi
Is it possible now in 16.2.6 to call subwebreport through webreport tablereport widget?
How?
LLWR-11002
Thanks
Uldis
Hi Uldis,
That feature was added in 16.2.5.
CheersIan
It's only available as an SDK component at the moment. There should be a markdown file in the SDK. I've attached it for info. Check out the swrLaunchCell parameter.
Actually, I just checked and it seems the SDK docs are missing most of our markdown files. I'm investigating this at the moment to find out how this happened. If you check under the /lib/src/webreports area of the SDK files you should find markdown files for our public components in the following locations.
- WebReports:
- Controls:
- NodesTableReport: webreports/controls/nodestablereport/nodestablereport.md
- RunWebReportPre: webreports/controls/run.webreport.pre/run.webreport.pre.controller.md
- StatusScreen: webreports/controls/status.screen/status.screen.view.md
- TableReport: webreports/controls/table.report/table.report.md
- Models:
- WRText: webreports/models/wrtext/wrtextmodel.md
- NodesTableReport: webreports/models/nodestablereport/nodestablereport.md
- RunWebReport: webreports/models/run.webreport/run.webreport.model.md
- RunWebReportPre: webreports/models/run.webreport.pre/run.webreport.pre.md
- TableReport: webreports/models/tablereport/tablereport.md
- Widgets:
- Widget Carousel: webreports/widgets/widget.carousel/widget.carousel.md
- Nodes List WebReport: webreports/widgets/nodeslistreport/nodeslistreport.md
- HTML WebReport: webreports/widgets/tilereport/tilereport.md
- Visual Count: webreports/widgets/visual.data.filtered.count/visual.data.filtered.count.md
- Parameter Prompt Form: webreports/widgets/parameter.prompt.form/parameter.prompt.form.md
I tried including swrLaunchCell in already working report but it did not give any effect.
Do I need to change something else?
Code below works as is for me
<<
<script> csui.require.config( { config: { 'csui/utils/contexts/factories/connector': { connection: { url: '//xxxxxx/cs162/cs.exe/api/v1/', supportPath: '[LL_REPTAG_SUPPORTDIR /]', session: { ticket: '[LL_REPTAG_&cookieData ASSOC:LLCookie /]' } } } } });
csui.onReady2(['csui/lib/marionette', 'csui/utils/contexts/page/page.context', 'webreports/controls/table.report/table.report.view', 'webreports/controls/table.report/cells/launch.subwebreport/launch.subwebreport.view' ], function (Marionette, PageContext,TableReportView,TableReportViewSub) { var contentRegion = new Marionette.Region({el: '#content'}), pageContext = new PageContext(), tableReportView, options;
options = { context: pageContext, data: { id: [LL_REPTAG_$WRDATA /], title: '[LL_REPTAG_!PAGETITLE /]', header: false, titleBarIcon: 'title-assignments', columnsWithSearch: 'name', sortBy: 'Name', sortOrder: 'desc', swrLaunchCell: { id: 399092, iconClass: 'my-icon-class', hoverText: 'Some hover text for my icon.' }, parameters: [ { name: 'AncestorID', value: [LL_REPTAG_!WID DEF:0 /] } ] } }; tableReportView = new TableReportView(options); contentRegion.show(tableReportView); pageContext.fetch();
});
</script>
>>
That looks right to me. To investigate further you can check the request to see if the subwebreport_id parameter is being sent in the /output Rest request. The response should have a column object in the columns response array called subwebreportid. Each data row should have a property set for subwebreportid.
RegardsIan
Yes, I see that in out and response. But I don't see any column in the table
Do you see nothing at all or do you see the SubWebReport ID data without an icon? You should see something like the attached screenshot.
If you don't see any column at all you can maybe check to see if the SubWebReport cell is defined on your instance. Where are you running this script from? To check the cell is defined and valid you can run this in your console or as a Chrome snippet while the page is loaded.
var cellRegistry = csui.require('csui/controls/table/cells/cell.registry'), Backbone = csui.require('csui/lib/backbone'), column = new Backbone.Model({ "column_key": "subwebreportid", "column_type_identifier": "key", "definitions_order": 13, "id": 1012, "name": "subwebreportid", "noTitleInHeader": true, "permanentColumn": true, "sort": false, "tag_format": "", "type": 12 }), subWebreportCell = cellRegistry.getCellView(column); console.log(new subWebreportCell());
This should log a cell object to the console.
If it's still not clear what's going on it might be worth logging a support ticket to see if they can reproduce your issue.
Please, use asynchronous module loading. The following statement will fail, if there is no table component on the page:
csui.require('csui/controls/table/cells/cell.registry')
I know, that bundling of Smart UI modules lost the initial scenario-based division. But it is no reason to exploit it and wait, until Smart UI loading performance gets improved and your code broken ;-)
Hi Ferda,
That code was just for debugging in the console after the table is loaded. It wasn't intended to be used in a live application.
Ian
I understand. Thanks!
I apologize for hijacking this thread. I am curious, how do you display a TableReport widget? Can you do this from the HTML Widget or NodesTable Widget on Perspective Manager? or do you have to add your own Widget type from SDK and register it?
Thanks,
Steve.
Hi Steve,
The TableReport control is a component in the Smart UI SDK. This means it can be used from your own custom widget, an external integration page, or using the HTML WebReport widget. There is an example of how to load this in the Perspective Manager help under the HTML WebReport widget section.
I still cannot get subwebreport part working. Does not work in any of the sytems I tried. I have 2 system with 16.2.7
Is this known issue?
Another issue I have with tablereport widget is that when I use different tabs in landing page (e.g. for Connected Workspace) then if the widget with tablereport is on the 2nd tab then when opening a tab it does not show (no error, nothing), but when I view source of the page then it show up.. Weird
I can't reproduce the issues you have. The SubWebReport icon shows and works and the TableReport control shows on the second tab of the tabbed perspective with no issues. Perhaps it might be worth contacting support to see if they can reproduce your issues.
Hi Ian,
I will try support, but is this feature oficial? Is it documented?
I will need to tell support what this is exactly
It's an official part of the Smart UI SDK. I would have thought the Smart UI SDK would be covered along with other SDK components but I guess support can confirm that. An example is also documented here: https://knowledge.opentext.com/knowledge/piroot/lleswebr/v160204/lleswebr-agd/en/html/jsframe.htm?webr-html-walk-bg
Hi guys
Thanks for the info, I managed to display a table reportview with an embedded SWR cell, example code here (done within a WR html widget):
csui.require( ['csui/lib/marionette', 'csui/utils/contexts/page/page.context', 'webreports/controls/table.report/table.report.view', ] , function (Marionette, PageContext, TableReportView) {
var contentRegion = new Marionette.Region({el: '#content'}), pageContext = new PageContext(), tableReportView, options;
options = { context: pageContext, data: { id: 5413110, title: 'Report', header: true, titleBarIcon: 'title-activityfeed', columnsWithSearch: 'Name', sortBy: 'CreateDate', sortOrder: 'desc', swrLaunchCell: { id: 5413771, iconClass: 'csui-icon-node-livereport', hoverText: 'View Details.' } } }; tableReportView = new TableReportView(options); contentRegion.show(tableReportView); pageContext.fetch(); });
Couple of questions though:
1. When loading the WR it looks like this, I need to resize the window or press those 3 dots before the headers and contents are actually shown:
2. When searching on the Name Column, it's pretty hard to get back to the original results. I need to search again and add a space for example.
3. Are there any plans to have this SWR to open in a dialogview instead of a new tab? Or would I be able to implement that myself?
Thanks in advance!
Hi Jasper,
1) The TableReport control is really designed to be shown as full page. It extends from the same core table control that the core node browse uses in the Smart UI. It is responsive enough to go down to a tablet screen size but won't work optimally in a single or double tile. If you want to put it in a single or double tile on a perspective you might consider launching the control in a dialog view based on user click. There is an example of this kind of approach with the Metadata view in this post: https://knowledge.opentext.com/knowledge/cs.dll?func=ll&objId=66135748&objAction=viewincontainer&ShowReplyEntry=66149799#forum_topic_66149799.
2) Name column search should work the same as the core nodes table widget at full screen.
3) The SWR cell uses the same WebReport control that launches a WebReport when you click the node it in the Smart UI browse view. This means the behaviour depends on how the WebReport destination is configured. If the WebReport has a Browser or Desktop destination then you are redirected to classic. If it is one of the other destinations then you will see the Smart UI prompt and result dialogues as per the configuration. This means we need to implement the capability to run a WebReport in the Smart UI and have the output show in the browser to get the behaviour you need. This is still not in the product yet. You could extend the core control to implement your own behaviour. There are a few different ways of doing this. One way might be just to extend from webreports/controls/table.report/table.report.view and override the initialize function to use you own collection and columns. You could replace the main collection with a custom collection extended from webreports/models/tablereport/tablereport.model. If you override the parse there you can perhaps call the prototype parse and then substitue the columns with you own custom cell view. The table should render any cells that are available in the cell view registry.
Thanks a lot Ian, I'll look into it!