Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsRead report design
https://www.eclipse.org/forums/index.php/mv/msg/172753/549733/#msg_549733
Thank you,
]]>Kris Chappell2010-07-27T18:33:12-00:00Re: Read report design
https://www.eclipse.org/forums/index.php/mv/msg/172753/550050/#msg_550050
Haven't done this specificallly, but I know of quite a few people that have.
The .rptdesign is just a text file, so if you store as text and then pull
it out and feed that into your ReportEngine it should work.
What specific problems are you running into?
Scott Rosenbaum
Innovent Solutions, BIRT PMC
> I need to store my report designs in a database table rather than
> storing them in a folder on the server, is there a way to store these
> in the database and read the design from that table and send the
> design to the run and render task when a report request is made? I
> could store these in a column either as xml or as a file. Has anybody
> done this? I'm having problems implementing this.
>
> Thank you,
>]]>Scott Rosenbaum2010-07-28T21:38:44-00:00Re: Read report design
https://www.eclipse.org/forums/index.php/mv/msg/172753/550175/#msg_550175
Thank you so much for replying to my question.
I have tried pulling the information from the database into a String and then just passing the string to the openReportDesign method. I have also tried passing it in using a ByteArrayInputStream getBytes method. Both result in an invalid xml parsing error. I have validated the xml and it is well formed.
I fixed the above problem, but now I am getting
j
avax.servlet.ServletException: org.eclipse.birt.report.engine.api.EngineException: The design file can not be found.
I'm pretty new to java, so it takes me quite a while to whittle away at these issues.
//create task to run and render report
IRunAndRenderTask lTask = aBirtEngine.createRunAndRenderTask( lDesign );
Thanks again for your reply.
]]>Kris Chappell2010-07-29T13:03:35-00:00Re: Read report design
https://www.eclipse.org/forums/index.php/mv/msg/172753/550195/#msg_550195
Kris Chappell2010-07-29T13:54:01-00:00Re: Read report design
https://www.eclipse.org/forums/index.php/mv/msg/172753/550221/#msg_550221
Can you post what you did to help others?
Jason
On 7/29/2010 9:54 AM, Kris Chappell wrote:
> Whoo hooo!!!! I got it to work. Thanks again Scott for your reply.]]>Jason Weathersby2010-07-29T14:44:48-00:00Re: Read report design
https://www.eclipse.org/forums/index.php/mv/msg/172753/550236/#msg_550236
public class RptDbUtil
implements RptDbSql
{
public static String
retrieveDesign(String pReportName, String pVersion)
throws Exception
{
Log.debug("Entered RptDbUtil.retrieveDesign");
CHGSQLService lService = CHGSQLService.getInstance();
SQLResult lResult = lService.executeQuery(RptDbSql.SQL_SELECT_DESIGN, new Object [] {pReportName, pVersion}, 0L);
if (lResult.getRowCount() == 0)
{
throw new RuntimeException("Report not found " + pReportName + " for version " + pVersion);
I was returning lResult.getRow(0).toString(); which was returning an object instead of a string. The string is passed into the openReportDesign using this:
There may be a more efficient or more elegant way, but this worked for me.
]]>Kris Chappell2010-07-29T15:08:31-00:00Re: Read report design
https://www.eclipse.org/forums/index.php/mv/msg/172753/550241/#msg_550241
On 7/29/2010 11:08 AM, Kris Chappell wrote:
> Well, I'm not really the best person to ask, I'm not a java programmer.
> But the problem that I had was in my return from fetching the design.
> This is the working method.
>
> public class RptDbUtil implements RptDbSql
> {
> public static String
> retrieveDesign(String pReportName, String pVersion)
> throws Exception
> {
> Log.debug("Entered RptDbUtil.retrieveDesign");
> CHGSQLService lService = CHGSQLService.getInstance();
> SQLResult lResult = lService.executeQuery(RptDbSql.SQL_SELECT_DESIGN,
> new Object [] {pReportName, pVersion}, 0L); if (lResult.getRowCount() == 0)
> {
> throw new RuntimeException("Report not found " + pReportName + " for
> version " + pVersion);
>
> }
> return lResult.getRow(0).getValue(0).toString();
>
> }
> }
>
>
> I was returning lResult.getRow(0).toString(); which was returning an
> object instead of a string. The string is passed into the
> openReportDesign using this:
>
> lDesign = aBirtEngine.openReportDesign(new
> ByteArrayInputStream(RptDbUtil.retrieveDesign("inactiveUsers ",
> "1").getBytes()));
>
> There may be a more efficient or more elegant way, but this worked for
> me. :)
>
>
>]]>Jason Weathersby2010-07-29T15:11:21-00:00