Thanks again. The ASP.NET Core app I'm working on uses jquery heavily.
I'm finding out during simple test that jquery do NOT get executed.
Script at the end of my view:
<script type="text/javascript">
loadFormBuilder()
.then(setTimeout(function () {
window.JSREPORT_READY_TO_START = true; //this will start the pdf printing
}, 9000));
async function loadFormBuilder() {
document.write('start doc ready..');
// var test = "hello";
var test = $("#testjsreport").val();
document.write('gets printed when var test is not populated by jquery:' + test);
}
</script>
I have this on my controller:
[MiddlewareFilter(typeof(JsReportPipeline))]
public IActionResult ExportToPdf(int? id)
{
var existingResponse = _sourcingEventService.GetFormResponseById(id.Value);
HttpContext.JsReportFeature()
.Recipe(jsreport.Types.Recipe.ChromePdf)
// .DebugLogsToResponse()
.Configure((r) => r.Options = new jsreport.Types.RenderOptions
{
// Preview = true,
Timeout = 90000
})
.Configure((c) => c.Template.Chrome = new jsreport.Types.Chrome
{
WaitForJS = true
});
return View(new FormResponseViewModel(existingResponse));
}
Are there any tricks to allow executing jquery?