Input text in On-Form Reports

78 views
Skip to first unread message

Bob Worley

unread,
Sep 8, 2016, 5:39:35 PM9/8/16
to designba...@googlegroups.com
We are on release 6.63 still.   

I havent tried it in a while, but it there a way to have a column of cells in an On-Form Report be an input box where the user can enter text, or to select from a dropdown/combo box?


____________________

Bob Worley

IT Applications Developer

Coburn Supply Co., Inc.

m: 214.676.9825

   

 



Jeremy Woods

unread,
Sep 8, 2016, 11:10:43 PM9/8/16
to DesignBais-Forum
Bob

Yes version 6.63 has the ability to do input boxes in On-Form reports however its not very elegant and I don't think you can do a drop down list. We have created a couple of forms with an input but dont really like how it works.

Regards
Jeremy

Bill_H

unread,
Sep 11, 2016, 8:24:50 PM9/11/16
to DesignBais-Forum
Jeremy:

Isn't there a problem with the font for this input box (it makes the box look very weird)?  If I remember correctly this has been an ongoing problem.

Bill

Bob Worley

unread,
Sep 11, 2016, 10:26:07 PM9/11/16
to designba...@googlegroups.com
Well when i've experimented with it, I've found it completely ignores any CSS you attempt to assign to that cell.


____________________

Bob Worley

IT Applications Developer

Coburn Supply Co., Inc.

m: 214.676.9825

   

 




--
You received this message because you are subscribed to the Google Groups "DesignBais-Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to designbais-forum+unsubscribe@googlegroups.com.
To post to this group, send email to designbais-forum@googlegroups.com.
Visit this group at https://groups.google.com/group/designbais-forum.
For more options, visit https://groups.google.com/d/optout.

Bill_H

unread,
Sep 14, 2016, 6:04:27 PM9/14/16
to DesignBais-Forum
I think that is the "bug" I was referring to.  I was told, years ago, that there is no way around this.

Bill

Bob Worley

unread,
Sep 26, 2016, 11:25:22 AM9/26/16
to designba...@googlegroups.com
I just wanted to let everyone know that with the help of Jon Legg at Designbais/BAIS I was able to get input boxes, combo (dropdown) boxes, and radio buttons to work inside table cells of On Form Reports.   

Thanks for the tips and help, Jon! 


Tim Ho

unread,
Sep 27, 2016, 5:00:23 AM9/27/16
to DesignBais-Forum
Hi Bob, would you mind share the tips of that here?

I'm also very interested in those advanced skills of using on-form report.

Thanks,
Tim Ho


Bobby Worley於 2016年9月26日星期一 UTC+8下午11時25分22秒寫道:

fatboy

unread,
Sep 27, 2016, 9:08:49 AM9/27/16
to DesignBais-Forum
Hi Bob and Jon,

I too would appreciate it if either one of you would share this information

Thanks
Hans

Bob Worley

unread,
Sep 27, 2016, 3:47:10 PM9/27/16
to designba...@googlegroups.com
Okay, here is my description of how I got combo boxes and radio buttons to work in OFRs.  

Disclaimer: NO warranties are expressed or implied. Use At Your Own Risk.  No running in the pool area. Don't Drink and Drive. Your mileage may vary....

I am doing this on version 6.63.  This "should" work on versions up to 6.99.   I was told things change at version 7. (more later)

And I'm still working on the final programming, so my application isn't completely finished yet. I may run into some hurdles. but so far it looks good. 

The gist is you need to trick designbais into thinking it's validating an input box.  So in order to do that you need to inject some HTML and a javascript call into the cell of the html table (OFRs are simply <table>...</table>).  

So the code you need to load into the cell for combo boxes (dropdowns) should look something like:

<select id="tdxspan11v1x1z4"
        name="tdxspan11v1x1z4"
        onchange="validateAndSubmit(event)">
   <option value="option1">option 1option>
   <option value="option2">option 2</option> 
   <option value="option3">option 3</option>
</select>


The code you need to load into the cell for radio buttons should look like:

<input type="radio" 
       onclick="validateAndSubmit(event)" 
       id="tdxspan11v1x1z4"  
       name="radio1" 
       value="1"> Option 1
<input type="radio" 
       onclick="validateAndSubmit(event)" 
       id="tdxspan11v1x1z4" 
       name="radio1
       value="2"> Option 2
<input type="radio" 
       onclick="validateAndSubmit(event)" 
       id="tdxspan11v1x1z4" 
       name="radio1
       value="3"> Option 3


Now, the key to getting this to work is the "id=" element. This is how designbais determines which form, row and column you are validating.  The breakdown of the data structure is:

-          “tdxspan” to identify a <td> cell in the detail of an OFR
-          “11” = position of report in form elements after header fields inserted (if any)
-          “v” = delimiter
-          “1” = DBWLEVEL (2 and higher for modal forms)
-          “x” = delimiter
-          “1” = row
-          “z” delimiter
-          “4” = column

So you have to first determine what position the OFR is in the form elements.  Read the form record in DBIFORMS and find it in attr 19 (DBIF.FIELD.NAME.LIST) My code to do this looks like this:


ONFORM.NAME='R.something'

READV FIELD.LIST FROM F.DBIFORMS, your_form,19 ELSE handle the error

LOCATE ONFORM.NAME IN FIELD.LIST<1> SETTING OFR.POS ELSE handle the error


Then as your build your OFR data you know the row and column, put that in there.    So I did this by making the HTML template, then swapping out the values for each cell.  Something like this:



*--- Combo box version

SELECT.ELEMENT.START='<select id="tdxspan{Field}v1x{Row}z4" name="tdxspan{Field}v1x{Row}z4" class="dbv6VerdanaReportDetail" onchange="validateAndSubmit(event)">'

SELECT.ELEMENT.START=CHANGE(SELECT.ELEMENT.START,'{Field}',OFR.POS)

SELECT.ELEMENT.OPTION='<option value="{Status}">{Status}</option>'

SELECT.ELEMENT.END='</select>'


*--- Radio buttons version

RADIO.HTML=''

RADIO.HTML:=' <input type="radio" class="dbv6VerdanaReportDetail" onclick="validateAndSubmit(event)"' 

RADIO.HTML:=' id="tdxspan{Field}v1x{Row}z{Column}" name="status{Row}" value="S" {SChecked}>Stock &nbsp;'

RADIO.HTML:=' <input type="radio" class="dbv6VerdanaReportDetail" onclick="validateAndSubmit(event)"' 

RADIO.HTML:=' id="tdxspan{Field}v1x{Row}z{Column}" name="status{Row}" value="N" {NChecked}>Non-Stock' 

RADIO.HTML=CHANGE(RADIO.HTML,'{Field}',OFR.POS)

RADIO.HTML=CHANGE(RADIO.HTML,'{Column}',COL.STATUS)



Then inside the loop for each row/col, I did something like this:


*--- for combo box

BEGIN CASE

   CASE STATUS='S'; CSTATUS='Stock'

   CASE STATUS='N'; CSTATUS='Non-Stock'

   CASE STATUS='' ; CSTATUS='Catalog'

   CASE 1         ; CSTATUS=''

END CASE

TD.SELECT=CHANGE(SELECT.ELEMENT.START,'{Row}',OFR.ROW)

TD.SELECT:=CHANGE(SELECT.ELEMENT.OPTION,'{Status}',CSTATUS)

IF STATUS#'S' THEN

   TD.SELECT:=CHANGE(SELECT.ELEMENT.OPTION,'{Status}','Stock')

END         

IF STATUS#'N' THEN

  TD.SELECT:=CHANGE(SELECT.ELEMENT.OPTION,'{Status}','Non-Stock')

END         

TD.SELECT:=SELECT.ELEMENT.END

.

.

.

*--- for radio button

BEGIN CASE

   CASE STATUS='S'

      TD.SELECT=CHANGE(RADIO.HTML,'{SChecked}','checked')

      TD.SELECT=CHANGE(TD.SELECT,' {NChecked}','')

   CASE STATUS='N'

      TD.SELECT=CHANGE(RADIO.HTML,'{NChecked}','checked')

      TD.SELECT=CHANGE(TD.SELECT,' {SChecked}','')

   CASE 1

      TD.SELECT=CHANGE(RADIO.HTML,' {NChecked}','')

      TD.SELECT=CHANGE(TD.SELECT,' {SChecked}','')

END CASE       

TD.SELECT=CHANGE(TD.SELECT,'{Row}',OFR.ROW)


Then you put that into your OUTPUT.REPORT(PROCESS.REPORT.NUMBER)<row,col>


You do NOT need to set OUTPUT.TYPES or OUTPUT.KEYS to anything for that col/row. 


The onclick event will trigger a call to your PROCESS AFTER subroutine of the OFR, the PROCESS.EVENT will be "REPORT" and the selected value will be DBVALUE.  You will have to code all the validation, error handling and CRUD yourself. 


I was told by Jon that for v7 the onclick event name will change from "ValidateAndSubmit(event)" to "vs(event)". 


I think thats all of it.   I hope this helps some other developers. 



Tim Ho

unread,
Sep 29, 2016, 4:00:03 AM9/29/16
to DesignBais-Forum
Thanks for your tips, Bob. I think it should be very useful for improving my on-form report of my application.

Tim Ho



Bobby Worley於 2016年9月28日星期三 UTC+8上午3時47分10秒寫道:
Reply all
Reply to author
Forward
0 new messages