Home » Archived » BIRT » Dynamic BIRT help(trouble editing/creating a BIRT table through java code)
Dynamic BIRT help [message #759048] |
Fri, 25 November 2011 15:31  |
Eclipse User |
|
|
|
Hello,
I have run into a wall and hoping someone might have a suggestion for me. I am creating a project that requires me to alter OR totally create new BIRT tables/charts on the fly from information selected by a user. I have successfully integrated BIRT into my application and was able to make the chart run using hardcoded data. I now have set it so the user selects which data they want to be passed in, and it alters the query. I know the query is working because I have ran the query "preview" in the report designer and it passed back the proper values. However, here is where it gets tricky:
what i am attempting to do is to not use the report Editor at all, and to create the chart and/or table totally through Java code or XML code, by passing in values from my action class. I am pulling in a blank rptdesign file, then attempting to fill it with my values by opening and editing it from my java file. As i said earlier, i got it to work with hardcoded data, however now whenever i run it it gives me the following error:
Table table:
+ Column binding "valuenamehere" has referred to a data set column "valuenamehere" which does not exist.
I have attached the full error report and a copy of my dynamicTables.java file. If anyone can understand why this wont allow me to pass my values in I would greatly appreciate it.
thanks a lot,
John
|
|
|
Re: Dynamic BIRT help [message #759506 is a reply to message #759048] |
Mon, 28 November 2011 15:20   |
Eclipse User |
|
|
|
John,
It looks like you are not adding the bindings to the table. You have to
create the table, create the dataset, and add bindings to the table.
Have a look at the attached examples.
Jason
On 11/25/2011 3:31 PM, jahits88 wrote:
> Hello,
>
> I have run into a wall and hoping someone might have a suggestion for me. I am creating a project that requires me to alter OR totally create new BIRT tables/charts on the fly from information selected by a user. I have successfully integrated BIRT into my application and was able to make the chart run using hardcoded data. I now have set it so the user selects which data they want to be passed in, and it alters the query. I know the query is working because I have ran the query "preview" in the report designer and it passed back the proper values. However, here is where it gets tricky:
>
> what i am attempting to do is to not use the report Editor at all, and to create the chart and/or table totally through Java code or XML code, by passing in values from my action class. I am pulling in a blank rptdesign file, then attempting to fill it with my values by opening and editing it from my java file. As i said earlier, i got it to work with hardcoded data, however now whenever i run it it gives me the following error:
>
> Table table:
> + Column binding "valuenamehere" has referred to a data set column "valuenamehere" which does not exist.
>
>
>
> I have attached the full error report and a copy of my dynamicTables.java file. If anyone can understand why this wont allow me to pass my values in I would greatly appreciate it.
>
> thanks a lot,
>
> John
|
|
| | | |
Re: Dynamic BIRT help [message #760486 is a reply to message #759978] |
Fri, 02 December 2011 09:34   |
Eclipse User |
|
|
|
Jason,
I actually was wrong about that being my last question, as it turned out that wasnt the issue at all. So i decided to go back and do some "testing" in a sense and i tried running one of the programs that you showed me (simpleChart.java... i just renamed it to chartBuild.java), just to see outcomes and figure i would be able to play with it, however when my JSP page loads it simply says "Unknown Error!" and bombs out. I attached a copy of the exact code im using (although it is basically what you sent me) and i also attached a copy of the error log. I am using Eclipse the Birt/Eclipse Galileo package which i believe is running Birt runtime 2_5_2 or 2_6_2.
I orginally thought it wouldnt run because of the version "3.2.22", because the report Editor would only open if i changed it to "3.2.21" (i could only view the 3.2.22 version in the XML editor). But the more i look into it the more i think there may be more to my problem.
I had previsouly tried working with the newer Birt/Eclipse Indigo package but my computer slowed down far too much so i went back to the Galileo version, in case that may be causing some issues.
attached below is the error log, my java file chartBuild (basically your simpleChart), the blank.rptdesign that I am opening then editing with chartBuild. I also attached the outcome outOfNowhereTwo.rptdesign file(which wont run)
thanks again for your help,
John
|
|
|
Re: Dynamic BIRT help [message #760523 is a reply to message #760486] |
Fri, 02 December 2011 11:53   |
Eclipse User |
|
|
|
This error and the previous ones look like you are mixing versions of
BIRT. It looks like you are building the app with a newer version than
the one you are running it in.
Jason
On 12/2/2011 9:34 AM, jahits88 wrote:
> Jason,
>
> I actually was wrong about that being my last question, as it turned out that wasnt the issue at all. So i decided to go back and do some "testing" in a sense and i tried running one of the programs that you showed me (simpleChart.java... i just renamed it to chartBuild.java), just to see outcomes and figure i would be able to play with it, however when my JSP page loads it simply says "Unknown Error!" and bombs out. I attached a copy of the exact code im using (although it is basically what you sent me) and i also attached a copy of the error log. I am using Eclipse the Birt/Eclipse Galileo package which i believe is running Birt runtime 2_5_2 or 2_6_2.
>
> I orginally thought it wouldnt run because of the version "3.2.22", because the report Editor would only open if i changed it to "3.2.21" (i could only view the 3.2.22 version in the XML editor). But the more i look into it the more i think there may be more to my problem.
>
> I had previsouly tried working with the newer Birt/Eclipse Indigo package but my computer slowed down far too much so i went back to the Galileo version, in case that may be causing some issues.
>
> attached below is the error log, my java file chartBuild (basically your simpleChart), the blank.rptdesign that I am opening then editing with chartBuild. I also attached the outcome outOfNowhereTwo.rptdesign file(which wont run)
>
> thanks again for your help,
> John
|
|
| | | | | | | | | | |
Re: Dynamic BIRT help [message #761668 is a reply to message #761576] |
Tue, 06 December 2011 15:56   |
Eclipse User |
|
|
|
Jason,
After you said you think it has something to do with the /frameset i went in and did some looking around and debugging. The reason that struck me as odd is that when i call the viewer i am using /run instead of /frameset.
I noticed that when i try to dynamically build my tables, they pass through the "init" method of my ViewerServlet, however, when i try to build a chart (and call it the same way from the JSP) it doesnt pass through the "init" method.
My whole program is a giant mess of 100 little test programs that i just tie together to fiddle with, but what ive done is taken the portions that BIRT is related to and attached them if you have the time to look at them.
It starts off in ChartAction. this is simply an action class that passes values and determines if I am building a Chart or just a Report.
If ChartAction determines that i want to build a Report it runs DynamicTables (which is actually connected to my server, and creates dynamic reports using my databases perfectly).
If ChartAction determines that i want to build a Chart it runs ChartBuild (which is basically your SimpleChart.java, which for some reason is giving me the red X with no errors and changing the output file from version 3.2.21 to 3.2.22) I kept it the way it was, so it is using the Classic Models database, if i get it to start working then i will start changing it so it would run with another server/database.
after either one of those two run i simply go to a JSP page which calls the viewer like so:
<birt:viewer
id="birtChart"
pattern="run"
height="500"
width="800"
reportDesign="outOfNowhereTwo.rptdesign"
isHostPage="false"
format="html">
</birt:viewer>
I also attached:
A - the blankReport.rptdesign that is used as the original designHandle for both the chart and the table builders.
B - the ViewerServlet that i am using. The "init" method in this servlet is not being called when i try to build a chart, which i think has something to do with why you noticed a /frameset issue.
hopefully with it laid out in this manner someone other than me might be able to understand this particular mess of a program a little better. If you still think that this code is all good then it is clearly something to do with mixing and matching versions from when i tried to use the Indigo package, and i will remove and reinstall everything so that the versions match.
and again, i cant thank you enough for all your help,
John
|
|
|
Re: Dynamic BIRT help [message #762235 is a reply to message #761668] |
Wed, 07 December 2011 13:42   |
Eclipse User |
|
|
|
Can you change:
<birt:viewer
id="birtChart"
pattern="run"
height="500"
width="800"
reportDesign="outOfNowhereTwo.rptdesign"
isHostPage="false"
format="html">
</birt:viewer>
to
<birt:viewer
id="birtChart"
pattern="preview"
height="500"
width="800"
reportDesign="outOfNowhereTwo.rptdesign"
isHostPage="false"
format="html">
</birt:viewer>
and then look at the html source generated and post it
If you have time for a skype session to walk over your code it would be
good.
Jason
On 12/6/2011 3:56 PM, jahits88 wrote:
> Jason,
>
> After you said you think it has something to do with the /frameset i went in and did some looking around and debugging. The reason that struck me as odd is that when i call the viewer i am using /run instead of /frameset.
>
> I noticed that when i try to dynamically build my tables, they pass through the "init" method of my ViewerServlet, however, when i try to build a chart (and call it the same way from the JSP) it doesnt pass through the "init" method.
>
> My whole program is a giant mess of 100 little test programs that i just tie together to fiddle with, but what ive done is taken the portions that BIRT is related to and attached them if you have the time to look at them.
>
> It starts off in ChartAction. this is simply an action class that passes values and determines if I am building a Chart or just a Report.
>
> If ChartAction determines that i want to build a Report it runs DynamicTables (which is actually connected to my server, and creates dynamic reports using my databases perfectly).
>
> If ChartAction determines that i want to build a Chart it runs ChartBuild (which is basically your SimpleChart.java, which for some reason is giving me the red X with no errors and changing the output file from version 3.2.21 to 3.2.22) I kept it the way it was, so it is using the Classic Models database, if i get it to start working then i will start changing it so it would run with another server/database.
>
>
> after either one of those two run i simply go to a JSP page which calls the viewer like so:
> <birt:viewer
> id="birtChart"
> pattern="run"
> height="500"
> width="800"
> reportDesign="outOfNowhereTwo.rptdesign"
> isHostPage="false"
> format="html">
> </birt:viewer>
>
>
> I also attached:
> A - the blankReport.rptdesign that is used as the original designHandle for both the chart and the table builders.
>
> B - the ViewerServlet that i am using. The "init" method in this servlet is not being called when i try to build a chart, which i think has something to do with why you noticed a /frameset issue.
>
> hopefully with it laid out in this manner someone other than me might be able to understand this particular mess of a program a little better. If you still think that this code is all good then it is clearly something to do with mixing and matching versions from when i tried to use the Indigo package, and i will remove and reinstall everything so that the versions match.
>
> and again, i cant thank you enough for all your help,
> John
|
|
| | | | | |
Re: Dynamic BIRT help [message #763315 is a reply to message #762959] |
Fri, 09 December 2011 09:54   |
Eclipse User |
|
|
|
John,
I am not certain what is happening here. I have never seen this error.
If you want I could do a skype session with you to look at it.
Jason
On 12/8/2011 4:37 PM, jahits88 wrote:
> Jason,
>
> WebViewerExample wont load, I did exactly what i did before when it did
> work and it wont even deploy now. I even tried it a different way that i
> found on the birt-exchange site and that also wouldnt deploy. I have
> been having issues deploying projects ever since i tried working with
> the Indigo package and at this point it seems like my program is
> behaving differently every time i run it. Sometimes it will give me the
> red Xs, sometimes it wont even load the viewer at all, sometimes it just
> gives a session timeout error. Im extremely confused as to how it keeps
> acting differently even as im not changing anything. Every time i think
> ive found what seems like the problem it will give a different error, or
> no error at all the very next time i run it. Unless you noticed an issue
> in the code i sent you then I dont really know what to say except that i
> think something was altered when i started using Indigo and it is still
> lingering within my workspace or buildpath, or maybe even in the eclipse
> settings somehow.
>
> thanks,
> John
|
|
| | | |
Re: Dynamic BIRT help [message #765745 is a reply to message #765319] |
Wed, 14 December 2011 10:49   |
Eclipse User |
|
|
|
John,
What is on line 59 of your modified version of
ViewingSessionManager.java class.
Jason
On 12/13/2011 3:35 PM, jahits88 wrote:
> Jason,
>
> thanks for all your help thus far. After you listed all the changes and
> looked over the code i realized i needed a blank canvas. So i went ahead
> and simply just started over, as i clearly made a change that i was
> unable to fix in my original attempt. So now that i have started over i
> had to re-integrate birt into my application, but the viewservlets.jar
> is giving me some issues. I simply copied it over from the
> WebViewerExample and at first it gave me issues because the
> viewerServlet points to /webcontent/birt, however, my project is
> /WebContent/birt. So i exploded the JAR and edited it then recompiled
> it. Now it started to run perfectly, then bombed out and gave me the
> following error, which i looked into and I am not 100% sure how i would
> be able to fix this so i was wondering if you had any suggestions.
>
> 5:12:23,937 ERROR [[ViewerServlet]] Servlet.service() for servlet
> ViewerServlet threw exception
> java.lang.Error: Unresolved compilation problems: The type of the
> expression must be an array type but it resolved to double
> Syntax error on token
> "$SwitchMap$org$eclipse$birt$report$session$ViewingSessionConfig$ViewingSessionPolicy",
> delete this token
>
> at
> org.eclipse.birt.report.session.ViewingSessionManager.createSession(ViewingSessionManager.java:59)
>
> at
> org.eclipse.birt.report.session.ViewingSessionUtil.createSession(ViewingSessionUtil.java:126)
>
> at
> org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:233)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
> at
> org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
> org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> at
> org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>
> at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
>
> at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
>
> at
> org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
>
> at
> org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>
> at
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
>
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
>
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:662)
>
>
> thanks again,
> John
|
|
| | | | | |
Goto Forum:
Current Time: Wed Jul 23 07:45:34 EDT 2025
Powered by FUDForum. Page generated in 0.57715 seconds
|