Report View Recordset Column Names as Report Header

Started by stanl, January 26, 2020, 05:55:48 AM

Previous topic - Next topic

stanl

I'm sure this is doable, but I am just getting into ReportView in WB.  I changed an Itemlist for a simple (no callback) dialog to Reportview. Simple ADO query => Getrows() creates the array and I want the first row to be a header and non-selectable. How do I have it display recordset column names instead of the first row of data?


[EDIT]:  ArrayInsert looks promising. Maybe I can answer my own question.


[EDIT 2]: My RFM for the day
Code (WINBATCH) Select


arrData = oRS.GetRows()
row = 0
rowflag = 1
ArrayInsert( arrData, row, rowflag, "" )
fcount=oRS.Fields.Count
flds=""
For i=0 To fcount-1
   flds=flds:oRS.Fields(i).Name:","
Next
flds=StrSub(flds,1,strlen(flds)-1)
arrB = Arrayize( flds, ',' )
For element = 0 To ArrInfo( arrB, 1 )-1
    arrData[row,element] = arrB[element]
Next

JTaylor

Did you solve your problem?   Sorry if I am being dense.

Jim

stanl


JTaylor


stanl

One more question though. Is there a way to make a reportview (no callback involved) select the first array element in the list - much like the pre-selected item you can set in the dropdown control?

JTaylor

Hmmmmmm...Don't think I have ever done anything with a reportview outside a Callback.  I gather setting focus on the control doesn't do it?   Not sure if it defaults to a specific selection on population or not.  SendKeyTo is the only think I can think of at the moment but not sure that is a good solution.

Hopefully someone else will have an answer.

Jim

td

You can use the Control Manager list view function cSetLVItem to set the selected item.  However, a dialog callback using (DialogControlSet with @dcSelect) is a simpler approach.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl

I guess I will need help with 4th parameter. Nothing I have tried selects the first row. Basically I'm using reportview as a lookup, single select where each column value becomes a variable for SQL statements and eventual Excel template creation.


Code (WINBATCH) Select


#DefineFunction MyDialogCallbackProc(MyDialog_Handle,MyDialog_Message,MyDialog_Name,MyDialog_EventInfo,rsvd)
   Switch MyDialog_Message                                   
      Case @deInit                                           
         DialogControlSet( MyDialog_Handle, "ReportView_1",@dcSelect,1) ;thought 1 would select 1rst row
         break
    endswitch
    return @retDefault
#EndFunction

JTaylor

Sorry.  You said you didn't want to use a callback so didn't offer this suggestion...

The fourth parameter needs to be the value of the 1st column that you want selected.   So, if the 1st column of the first row is "Bugs", that is what you would use.

Jim

stanl

I didn't want to, but I didn't want to didn't want to go the control manager route either :-\ Thanks.

JTaylor