This topic is locked

Custom Calculations in Report Footer

9/6/2020 7:47:37 PM
ASPRunner.NET General questions
C
cboucher author

I need to do some custom calculations in a report footer. Any pointers on where to begin? I'm still new to ASPRunner.Net.
Thanks

Craig

H
heilmanmd 9/10/2020

I'm no expert, but can give some hints...
You could use a snippet... i.e. in the what you see what you get editor add code snippet... into the footer...
Within the snippet you can then create field(s) to be displayed
i.e. something like
string htmlstr = "<span id="footerfld">" + XSession.Session["somevalue"].ToString() + "</span>"
where the Session variable is calcd value
or you can do the calculation in C# or VB script within the snippet if you wish...
then at the end of the snippet you MVC ( i.e. echo it out )
below example may help, or least give you an idea...
// Put your code here.

string userid = String.Format("{0}",XSession.Session["userid"]);

string iiswrkdir = XSession.Session["iiswrkdir"].ToString() ;

string dsn= XSession.Session["db_region"].ToString();
string imgref = "<span id='exprtstuff'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A id='excelicon' href='" + XSession.Session["urlval"].ToString() ;

imgref += "/dataexport/export_data.asp?forwho=";

imgref += userid.ToString() ;

imgref += "&expwhat=headings&iiswrkdir=" + iiswrkdir + "&dsn=" + dsn + "'><IMG alt='Export' src='" + XSession.Session["urlval"].ToString() + "/images/smallexcel.png' border='0'>Excel " ;

imgref += " </A>&nbsp;&nbsp;&nbsp;&nbsp;<span id='excelspinner' ><IMG src='" + XSession.Session["urlval"].ToString() + "/images/excelspinner.gif' border='0'></span></span>" ;
MVCFunctions.Echo(imgref.ToString());
Best

Mark