error when printing a report loaded from template
In my app certain users can use the report explorer to design and view/print
reports as usual. I also have a button with a drop-down menu accessible to
all users that displays the reports available. Selecting one of the reports
in the menu prints the report directly. This works fine for simple reports
such as lists. However, more complicated reports with calculations (e.g.
variables in the footer) print from the report explorer but throw a "compile
error" - typically "footer before print" when launched the other way. I am
using the LoadFromTemplate property and, as I say, this works great for
non-complicated reports. Do you have any suggestions as to why this could be
happening?
Regards
Mike Combellack
Software Experts S.L.
reports as usual. I also have a button with a drop-down menu accessible to
all users that displays the reports available. Selecting one of the reports
in the menu prints the report directly. This works fine for simple reports
such as lists. However, more complicated reports with calculations (e.g.
variables in the footer) print from the report explorer but throw a "compile
error" - typically "footer before print" when launched the other way. I am
using the LoadFromTemplate property and, as I say, this works great for
non-complicated reports. Do you have any suggestions as to why this could be
happening?
Regards
Mike Combellack
Software Experts S.L.
This discussion has been closed.
Comments
machine? Perhaps your deployment exe doesn't include some RAP pass through
functions that you are using in your development app? Where are you calling
LoadFromTemplate? Do you mean the SaveAsTemplate property? When you load
from the report explorer visually, as an end user, the report template is
loaded automatically from the database. When the report runs with RAP code
and SaveAsTemplate is true, then it streams the template to file instead of
to the form at runtime so that your RAP code won't overwrite the layout
settings when you return to the design workspace (Design tab) after
previewing.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Perhaps I'm not using LoadFromTemplate correctly.... When the user selects a
report from a menu to print, the ID for that report is noted - I use the
ITEMID from the table used for the report definition (the same as the one
used by the Report Explorer). I then locate that record and call
LoadFromTemplate, which I thought loaded the TEMPLATE field contents from
the ITEMS table into the report variable.... which I then try and print. As
I said before, this seems to work for reports with no variables, so I
assumed I was doing it correctly! Please correct me.....
Mike Combellack
Report.Template.Datasettings property configuration to find the report from
the data pipeline. The pipeline should be the rbItems pipeline which is the
same one used to return items for the report explorer component. That should
work for you as you can examine the Report.Template.Datasettings at runtime
by code to be sure that it is set correctly to give you the report you want.
This property is listed in the help file too under the TppReportTemplate
class properties.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com