Fill method with count fields


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Shameless /bump



Any opinion on this? I spent most of the day working on creating some pretty complex grids to display data using just ADO datatables, binding sources, and datagridviews. I would get what data I could from a fill() method on my BO, then create a copy of that BO's data table to which I manually added columns which were each populated by either a stored proc that crunched some numbers or other application code. These then populated my grids.



In the end I was happy with what I ended up with but wondered if there wasn't an easier way to do it with SF tools, I just didn't know how to use them correctly.



I liked the grid because all the columns were sortable in the end by clicking the headers, can you do that (and the stuff above) with SF Listview or another control or did I make the right choice with using a grid?

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
how would I then access the fields? Any attempt to use my "created" fields says that it is not a member of the BO when I try to use them with e.Values(0).DisplayValue in the RowPopulating event.



I got this done using raw ADO and a datagrid because I had to get it done and I have gotten pretty good with raw ADO from all the DB2 stuff I have been doing without SF, I just used the BO.currentdatatable and bound it to a bindingsource and grid, but I would still like to know how to accomplish this the "Strataframe way" since the current project is all SQL/SF.



What I am really getting at is I want to build a datatable either through fills with sum/count fields, manually adding columns and rows dynamically in code, or some combination of the two. Then I want to display this data all pretty Smile (just like building a cursor as a datasource in VFP when your data just will not yield to more conventional methods)



Perhaps datagrid is the answer after all, or can the SF Listview accommodate this?

Keith Chisarik
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Have you tried passing over the CurrentDataTable rather than the whole BO.  There is an overload to accept a DataTable instead of a BusinessLayerBase.  This is "ignorant" of the fields and should move all of the columns.
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I have a fill method that creates a count field, it is "filling" correctly. I need to know how to use the fill in the SF Listview please.



In the past I have used CopyDataFrom almost exclusively but that isn't working here due to the dynamic field. I tried setting the MethodToExecute to my customer Fill but I dont know how to set the fields/column values. I imagine I will set to 'PopulatedThroughEvent" but I dont know what to put in the RowPopulating method.



Also, after I get this working I will need to be able to have columns that are calculated from both other columns in the listview row and BO field values, I think i can just add blank columns with type PopulatedThroughEvent? Am I way off base here?



My fill SQL:

loCommand.CommandText = "select distinct(rent_itemcode), count(rent_itemcode) as rent_itemcount from rentitems where rent_ordnum = @param1 and rent_itemcode <> ':MISC' AND rent_usesbarcode = 1 group by rent_itemcode"

Keith Chisarik
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search