I have been stuck on this problem on and off for several weeks now. When trying to view a report using the perspective report viewer component, sometimes I get the error message “Enter a valid report in the "source" property in the Property Editor to display the report.” The report normally runs just fine the first time it is loaded on the page, but any subsequent requests tend to fail. My source property is bound to a report path, but I can get the same issue when using a static source.
For a bit more context, this report has some pretty nasty and complex data. I believed I had the problem fixed by using a custom cached query function. This has since not fixed the problem. The data in particular that is nasty is downtime reasons for each shift over a date range. I am pulling in my data to the report using a script data source because there is quite a lot of massaging of data that needs to happen to get the data from the database to the report.
I have also added extensive logging and don’t see any errors in my logs when the report viewer breaks. I did notice that under the reports section, the reports can get stuck “Generating Report” and “Fetching Report.”
Have you tested with the report viewer configured to display some other, light weight report? If the problem seems to follow your one complex report then I would lean towards the specific report being the problem.
How many rows of data are you working with? I wouldn't expect the system to bog down unless you are doing a lot of inefficient work on a lot of rows.
Are you able to post samples of the code and/or queries you are using? Someone might be able to point out some improvements/better approaches to your data processing. General db table layouts may also be helpful, if you are allowed to share.
This is what the report looks like once it has run correctly. I have another report that I use with the same component that can take even longer to run but hasn’t failed for me once. I’m not sure the exact amount of data that is being used. The three charts use a few different queries to get down time events over a range. Those queries have to run three times, one for each shift. Unfortunately, we are unable to do any changes to the database tables.
One other thing that may be causing an issue is that we have scripting on the charts to add dynamic pens. Here is an example of one of the scripts.
def configureChart(data, chart):
from java.awt import Color
from Company.Reporting import PenTemplate
colors = [
Color.BLUE,
Color.RED,
Color.GREEN,
Color.BLACK,
Color.YELLOW
]
shiftDict = data["shiftPercentUptime"]
Company.Reporting.clearXYChartPens(chart)
shiftIndex = 0
for shiftName in sorted(shiftDict.keys()):
shiftRows = shiftDict[shiftName]
if not shiftRows:
continue
xyData = []
for row in shiftRows:
ts = row["ShiftHour"]
if hasattr(ts, "getTime"):
x = float(ts.getTime())
else:
x = float(ts)
y = float(row["PercentUptime"])
xyData.append((x, y))
pen = PenTemplate(
colors[shiftIndex % len(colors)],
2.0,
True,
False,
"Uptime"
)
Company.Reporting.addXYChartPen(
chart,
shiftName,
"Uptime",
xyData,
pen
)
shiftIndex += 1
plot = chart.getPlot()
yAxis = plot.getRangeAxis()
yAxis.setAutoRange(False) # important
yAxis.setLowerBound(0)
yAxis.setUpperBound(110)
I have attached the scripts that I call in my reports data source.