As a way to get acquanited with the processes behind the starter kit, I gave myself the challenge of updating the tabular report so that all rows whose UnitsInStock is less than ReorderLevel would appear in a different color, much the same way all items whose
UnitsInStock is zero appear in red. To do this, I updated the SQL scripts to include ReorderLevel, I created a CSS class, I added ReorderLevel to the TabularReportFields enumerations in TabularReportCollection.vb, and I mirrored the code for the other data
fields in TabularReport.vb. I am now working with Tabular.aspx.vb, but I cannot figure out the proper way to refer each individual value for ReorderLevel. In other words, the code in tabular.aspx.vb is this: If unitsInStock < reorderLevel And unitsInStock
<> 0 Then e.Item.CssClass = "UnderStock" ElseIf unitsInStock = 0 Then e.Item.CssClass = "OutOfStock" End If unitsInStock is initialized a little bit above as Dim unitsInStock As Double = Convert.ToDouble(e.Item.Cells(1).Text) But I don't know what corresponding
initialization to write for reorderLevel. How do I declare/assign my variable reorderLevel? Have I done everything correct thus far? Have I forgotten anything? Also, what does the Cells(1) refer to in the unitsInStock assignment? It doesn't seem to be the
first column.
I think I figured out a good deal of the solution, for those interested. You have to update the stored procedures, you do have to create a CSS class, update the TabularReport class in TabularReport.vb for reorderLevel mirroring the others fields except they
have to be shared, and add the ReorderLevel row to the GetProducts function. In Tabular.aspx.vb, I can now refer to ASPNET.StarterKit.Reports.Components.TabularReport.ReorderLevel and use it in my comparison against unitsInStock. However, there is a problem.
I am getting the proper response (different color) for some of the entries. Louisiana Hot Spiced Okra, Gnocchi di nonna Alice, Singaporean Hokkien Fried Mee, Wimmers gute Semmelkndel and Longlife Tofu are changing color (again, indicating that their units
in stock is under their reorder level -- at least that was my hope). However, Outback Lager, Chang, Aniseed Syrup, Queso Cabrales, Nord-Ost Matjeshering, Mascarpone Fabiole, Gravad Lax, Ipoh coffee, Roged sild . . .and others are not changing color. Does anyone
have any ideas or suggestion why this would be? I couldn't find any relationships between the few that worked that could suggest an explanation. I'll post some of the code if that would help. This shouldn't be this hard . . . Also, I still don't know what
the e.Item.Cells(1).Text refers to. Thanks in advance for your help, Evan
dhsrodian
Member
20 Points
4 Posts
Helpl with Tracking an Additional Data Field on the Tabular Report
Sep 19, 2003 07:10 AM|LINK
dhsrodian
Member
20 Points
4 Posts
Re: Help with Tracking an Additional Data Field on the Tabular Report
Sep 29, 2003 03:34 AM|LINK