This topic is locked
[SOLVED]

 How to use variable in snippet

12/30/2009 6:21:12 AM
ASPRunnerPro General questions
D
danivale author

Hi everybody,

I'm new in Asprunner and I don't find the solution in the topics.

aspRunner generated a list of project like this
ID 1 Name Description

ID 2 Name Description

ID 3 Name Description

etc...
Now I'm writing a snippet to add a 4th column "Costs"

In the snippet there is a query

"select sum(budget) from BudgetProject where idPrj = "& WHAT
I don't know how to write the final string? where I can see the name of the IDPrj variable????

If I see the code of the page, in the ID column there is something like {$IDPrj_value} but I don't know how to write it in my query.
Thanks

Sergey Kornilov admin 12/30/2009

Snippet won't work for this purpose. You need to set 'View as' type of one of fields to 'Custom' to access field values via rs("fieldname")
You might need to modify SQL query in order to add a new field:

select ID, Name, Description, 0 as Cost

from ...
Then set 'View as' type of 'Cost' field to 'Custom' and put your code there.
More info:

http://www.xlinesoft.com/asprunnerpro/docs/_view_as__settings_custom.htm

D
danivale author 1/6/2010

Wow!! Thank you very much



Snippet won't work for this purpose. You need to set 'View as' type of one of fields to 'Custom' to access field values via rs("fieldname")
You might need to modify SQL query in order to add a new field:

select ID, Name, Description, 0 as Cost

from ...
Then set 'View as' type of 'Cost' field to 'Custom' and put your code there.
More info:

http://www.xlinesoft.com/asprunnerpro/docs/_view_as__settings_custom.htm