The click event simply happens before the button's normal action, so you get your js running and then the form submits as normal so the page does a postback. If you want to stop the post back your js needs to return false;
btnLicenseReport.Attributes.Add("OnClick", "javascript:LicenseReport('" + sPath2 + "');return false;")