Failed to print the multi-row dataset in XReports

That would be the XReports (PDF) renderer.

I don’t think so becuasuse the URL for XReprt renderer is

while for another renderer the URL is different based on my local http://localhost:9999/openmrs/xreports/

therefore, following URL will render the report as i need, but dont know which renderer is this. I tried many

Oh, do you mean just displaying the report without exporting it to PDF?

Want to display the report as PDF without downloading it.

For what purpose?

The users want to see the report before it automatically get downloaded to in their local machine. If they want they can directly print or just save the PDF locally.

I checked and found that previous behavious of default XReport render is changed in this commit which is made in Mar 24 2017

return new ModelAndView(“redirect:/xreports/” + id + group);

is replaced with

return new ModelAndView(new RedirectView(“…/reporting/reports/reportHistoryOpen.form?uuid=” + rr.getUuid()));

that is the reason the report is displayed in legacy UI.

Should i give you a global property to set in order to revert to old behaviour?

//return new ModelAndView(“redirect:/xreports/” + id + group);

above line is commented in new release. I would prefer to have this type in drop-down to be to able select it. So i will have option either see the report in PDF window or Legacy UI or auto download the PDF.

I mean the renderer type should be passed as parameter.

Can you create a ticket for this?

here I have created the ticket :

Can you test the module that i have attached on the ticket? For the default behaviour, you will need to select the “XReport” renderer. For direct PDF download, you need to select the “XReport (PDF)” renderer.

I have tested the attached module and Now I can render the report as I used to do when I select the XReport renderer.

here is the renderer dropdown from two different reports,

<select name="selectedRenderer">
    <option value="org.openmrs.module.reporting.web.renderers.DefaultWebRenderer">Web Preview </option>
    <option value="org.openmrs.module.xreports.web.XReportRenderer!8cdc700e-e9a0-4eca-b93f-7ad7629aa3b2">XReport </option>

<select name="selectedRenderer">
<option value="org.openmrs.module.reporting.web.renderers.DefaultWebRenderer">Web Preview </option>
<option value="org.openmrs.module.xreports.web.XReportRenderer!6573a637-eaf6-4877-8f44-47c6342bc932">XReport PDF (Download) </option>
<option value="org.openmrs.module.xreports.web.XReportRenderer!0abe77ab-309f-4884-981f-379f0223dd83">XReport </option>

Why do we have UUID at end of the renderer type? That UUID is also not similar based on renderer type and neither it is report UUID.

org.openmrs.module.xreports.web.XReportRenderer !0abe77ab-309f-4884-981f-379f0223dd83

Can we over ride the UIID at end of the renderer? I would suggest to have a unique static renderer path without any random UUID.

Or can I set the default renderer as XReport renderer? It will also help me.

Since the end user does not see the uuid, could you explain a bit why you would want to override it?

I have created report templates for each encounter. then i have customized the coreapp module to add the print button for each encounter i have report template like following,

Then when a user click on print button, i create a hidden form and submit it to get the report in XReport renderer. but if this renderer have dynamic UUID then I won’t have access to that UUID in my js file while creating hidden form.

Therefore, if each renderer has a static specific path then i will only send that path as parameter.

Wouldn’t the numeric reportId work?

Here was the parameters i was sending in previous version of XReport and I get report in XReport renderer.

POST Paramenters

userEnteredParams[patientId] = 7
userEnteredParams[encounterId] = 3
selectedRenderer = org.openmrs.module.reporting.web.renderers.DefaultWebRenderer
reportId = 6bc489c6-c1ad-4c89-acb2-fde40edcfe66

GET Parameters

formId = 3
reportId = 6bc489c6-c1ad-4c89-acb2-fde40edcfe66

I was sending above parameters to /openmrs/module/xreports/fillParameter.form URL

Oh! I got it. You are taking this UUID form reporting_report_design table. it will remain static for each report. I thought it is dynamically generated somewhere.

@dkayiwa: I tried to add XReport renderer to a report on latest version of tomcat but it fails again although it was fixed by @mseaton in REPORT-800 task.

I am using xreports-1.10.1-SNAPSHOT and the URL I get is here which has again a PIPE character, http://localhost:9999/openmrs/module/reporting/reports/renderers/defaultReportDesignEditor.htm?parameters=type=org.openmrs.module.xreports.web.XReportRenderer|reportDefinitionUuid=ea9d2324-55ac-4076-a39b-0c8e38628270|returnUrl=/openmrs/module/reporting/reports/reportEditor.form?uuid=ea9d2324-55ac-4076-a39b-0c8e38628270