Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Adding actionable checkboxes to the rows of an exisiting HTML report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Adding actionable checkboxes to the rows of an exisiting HTML report
 Login/Join
 
Silver Member
posted
Here is the original sales report using the CAR database:

  
TABLE FILE CAR
PRINT
     'CAR.BODY.BODYTYPE'
BY 'CAR.ORIGIN.COUNTRY'
BY 'CAR.COMP.CAR'
BY 'CAR.CARREC.MODEL'
HEADING
"Current Cars Available for Sale"
" "
FOOTING
"As of <+0>&DATEtrMDYY <+0> "
ON TABLE SET PAGE-NUM OFF
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
$
TYPE=HEADING,
     SIZE=14,
     STYLE=BOLD,
$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,
$
ENDSTYLE
END


The Sales and Warranty departments have had some discussions regarding potential changes to the current auto warranties being offered. They would like to keep this report 'as is' with the single addition of a checkbox in front of the front the first column (Country) and on each row. Additionally a 'Send to email' hyperlink would be added to the footing and when it is clicked, only the data on the rows where the checkbox has been selected will be emailed to the user. Each model will already be a drill-down to send the information for individual vehicles by email, but they would also like the option to send a group of rows at once.

Is this possible?

This message has been edited. Last edited by: MarciaDrummond,


WebFOCUS 7.73
Windows, Unix, AS/400 (iSeries)
HTML, PDF, MS Excel (including templates), HTML Active Reports
 
Posts: 32 | Registered: October 01, 2010Report This Post
<FreSte>
posted
Yes, that's possible (see below) and you need also some javascript to collect all the checked lines/id's for further action
(the id in this example is now hardcoded to XXX)

-Fred-

DEFINE FILE CAR
  CB/A100 = '<input type="CHECKBOX" id="XXX" />';
END
TABLE FILE CAR
PRINT 
     'CAR.BODY.BODYTYPE'
BY CB
BY 'CAR.ORIGIN.COUNTRY'
BY 'CAR.COMP.CAR'
BY 'CAR.CARREC.MODEL'
HEADING
"Current Cars Available for Sale"
" "
FOOTING
"As of <+0>&DATEtrMDYY <+0> "
ON TABLE SET BYDISPLAY ON
ON TABLE SET PAGE-NUM OFF
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
$
TYPE=HEADING,
     SIZE=14,
     STYLE=BOLD,
$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,
$
ENDSTYLE
END
 
Report This Post
Silver Member
posted Hide Post
Thanks, Fred!

If you have the JavaScript already, I'd appreciate it. Wink If not, I'll search it out.

This request is just one of many that I am working on and I am thankful for your response.

Marcia

This message has been edited. Last edited by: MarciaDrummond,


WebFOCUS 7.73
Windows, Unix, AS/400 (iSeries)
HTML, PDF, MS Excel (including templates), HTML Active Reports
 
Posts: 32 | Registered: October 01, 2010Report This Post
<FreSte>
posted
Marcia,

I didn't have it already, but as the weather here in the Netherlands is terrible and there's nothing on the television so, here you go Smiler

It's just a basic example. All you need to add is the URL that will start your fex that needs
the clicked ID's and add these ID's (see var _params in javaScript)

DEFINE FILE CAR
  ID1/I5 WITH MODEL = LAST ID1 + 1;
  AID1/A5   = FPRINT(ID1, 'I5' , 'A5');
  AID2/A5   = TRIM('L', AID1, 5, ' ', 1, 'A5');
  CB/A100   = '<input type="CHECKBOX" id="' || AID2 || '" />';
END
TABLE FILE CAR
PRINT
     'CAR.BODY.BODYTYPE'
BY CB AS ''
BY 'CAR.ORIGIN.COUNTRY'
BY 'CAR.COMP.CAR'
BY 'CAR.CARREC.MODEL'
HEADING
"Current Cars Available for Sale"
" "
FOOTING
"As of <+0>&DATEtrMDYY <+0> "
ON TABLE SET BYDISPLAY ON
ON TABLE SET PAGE-NUM OFF
ON TABLE HOLD AS RPRT FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
$
TYPE=HEADING,
     SIZE=14,
     STYLE=BOLD,
$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,
$
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<html>
<script>
function showCheckedItems() {
    var _allCbxs = document.getElementsByTagName("input");
    var _length  = _allCbxs.length;
    var _params  = "";

    for (var i=0; i < _length; i++) {
        if (_allCbxs[i].type == "checkbox" && _allCbxs[i].checked) {
            _params += "&" + "ID=" + _allCbxs[i].id;
        }
    }

    alert("The following IDs are checked:\n\n" + _params);
}

</script>
<body>
!IBI.FIL.RPRT;
<br>
<input type="button" value="Show checked items" onclick="showCheckedItems();">
</body>
</html>
-HTMLFORM END

This message has been edited. Last edited by: <FreSte>,
 
Report This Post
Silver Member
posted Hide Post
Ahhhh!!!!! Big Grin

Fred, you are the best!

I appreciate you putting this together for me.

I will test it and let you know how it works for me - I needed this opportunity to "come up for air" from this other application that I am working on.

Cheers!!! Smiler

Marcia

P.S. Not only does is work, you have introduced me to the FPRINT function. Another one of those "secrets" that comes available in a release, but not documented until later.

This message has been edited. Last edited by: MarciaDrummond,


WebFOCUS 7.73
Windows, Unix, AS/400 (iSeries)
HTML, PDF, MS Excel (including templates), HTML Active Reports
 
Posts: 32 | Registered: October 01, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Adding actionable checkboxes to the rows of an exisiting HTML report

Copyright © 1996-2020 Information Builders