C
Coleen
Hi all
We are using a DB2 database connection through a class module to get the
data into a datagrid in an aspx web page using VB.Net. I can get the data
into the first datagrid with no problem, however, since I need to do a bunch
of calculations with these values AND pull values for two session variable
within the web application, I need to create another datagrid to display the
calculations. Here is what I'm doing:
dtg_stat_report_1.DataSource =
lo_AZRM010A.get_dt_stat_report_1
dtg_stat_report_1.DataBind()
For i = 0 To dtg_stat_report_1.Items.Count - 1
dgi = dtg_stat_report_1.Items(i)
ls_bus_name = dgi.Cells(0).Text
ls_gas_gal = dgi.Cells(1).Text.Trim.Replace(",",
"").Replace(" ", "").Replace(" ", "")
ls_gasohol_gal = dgi.Cells(2).Text.Trim.Replace(",",
"").Replace(" ", "").Replace(" ", "")
If ls_gas_gal = "" Then ls_gas_gal = "0"
If ls_gasohol_gal = "" Then ls_gasohol_gal = "0"
li_gas_gal = CInt(ls_gas_gal)
li_gasohol_gal = CInt(ls_gasohol_gal)
li_st_1265_tax = (li_gas_gal + li_gasohol_gal) *
0.12397
li_st_5_tax = (li_gas_gal + li_gasohol_gal) * 0.049
li_cty_535_tax = (li_gas_gal + li_gasohol_gal) *
0.05243
li_cty_opt_tax = Session("tot_cty_opt_tax")
li_cty_1_tax = (li_gas_gal + li_gasohol_gal) *
0.0098
li_CPI_tax = Session("wa_tot_gal")
dtg_display.DataSource = of_ref_table()
dtg_display.DataBind()
'Fill the variables in dtg_display with the values
from above
For j = 0 To dtg_display.Items.Count - 1
dtg_display.Items(1).Cells(0).Text = ls_bus_name
dtg_display.Items(1).Cells(1).Text = ls_gas_gal
dtg_display.Items(1).Cells(2).Text =
ls_gasohol_gal
dtg_display.Items(1).Cells(3).Text =
li_st_1265_tax
dtg_display.Items(1).Cells(4).Text = li_st_5_tax
dtg_display.Items(1).Cells(5).Text =
li_cty_535_tax
dtg_display.Items(1).Cells(6).Text =
li_cty_opt_tax
dtg_display.Items(1).Cells(7).Text =
li_cty_1_tax
dtg_display.Items(1).Cells(8).Text = li_CPI_tax
Next
The of_ref_table() creates the columns for the new datagrid, but I cannot
get the values to populate. I know I need to do something like
dtg_display.row(i).add, but this is not available to me. Any suggestions?
TIA,
Coleen
We are using a DB2 database connection through a class module to get the
data into a datagrid in an aspx web page using VB.Net. I can get the data
into the first datagrid with no problem, however, since I need to do a bunch
of calculations with these values AND pull values for two session variable
within the web application, I need to create another datagrid to display the
calculations. Here is what I'm doing:
dtg_stat_report_1.DataSource =
lo_AZRM010A.get_dt_stat_report_1
dtg_stat_report_1.DataBind()
For i = 0 To dtg_stat_report_1.Items.Count - 1
dgi = dtg_stat_report_1.Items(i)
ls_bus_name = dgi.Cells(0).Text
ls_gas_gal = dgi.Cells(1).Text.Trim.Replace(",",
"").Replace(" ", "").Replace(" ", "")
ls_gasohol_gal = dgi.Cells(2).Text.Trim.Replace(",",
"").Replace(" ", "").Replace(" ", "")
If ls_gas_gal = "" Then ls_gas_gal = "0"
If ls_gasohol_gal = "" Then ls_gasohol_gal = "0"
li_gas_gal = CInt(ls_gas_gal)
li_gasohol_gal = CInt(ls_gasohol_gal)
li_st_1265_tax = (li_gas_gal + li_gasohol_gal) *
0.12397
li_st_5_tax = (li_gas_gal + li_gasohol_gal) * 0.049
li_cty_535_tax = (li_gas_gal + li_gasohol_gal) *
0.05243
li_cty_opt_tax = Session("tot_cty_opt_tax")
li_cty_1_tax = (li_gas_gal + li_gasohol_gal) *
0.0098
li_CPI_tax = Session("wa_tot_gal")
dtg_display.DataSource = of_ref_table()
dtg_display.DataBind()
'Fill the variables in dtg_display with the values
from above
For j = 0 To dtg_display.Items.Count - 1
dtg_display.Items(1).Cells(0).Text = ls_bus_name
dtg_display.Items(1).Cells(1).Text = ls_gas_gal
dtg_display.Items(1).Cells(2).Text =
ls_gasohol_gal
dtg_display.Items(1).Cells(3).Text =
li_st_1265_tax
dtg_display.Items(1).Cells(4).Text = li_st_5_tax
dtg_display.Items(1).Cells(5).Text =
li_cty_535_tax
dtg_display.Items(1).Cells(6).Text =
li_cty_opt_tax
dtg_display.Items(1).Cells(7).Text =
li_cty_1_tax
dtg_display.Items(1).Cells(8).Text = li_CPI_tax
Next
The of_ref_table() creates the columns for the new datagrid, but I cannot
get the values to populate. I know I need to do something like
dtg_display.row(i).add, but this is not available to me. Any suggestions?
TIA,
Coleen