Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Birt Report Viewer Customization- Yet another question
Birt Report Viewer Customization- Yet another question [message #959355] Fri, 26 October 2012 16:58 Go to next message
birt 2010Friend
Messages: 11
Registered: October 2012
Junior Member
I am developing report application for two different companies. So ideally on the report viewer I would like to have different look and feeling. So if I am modifying framefragment.jsp( as suggested on the forum), how to maintain different look and feel? One idea is to keep two copies of framefragment.jsp, but I am not sure how to call specific one. Any ideas?
Please let me know
Re: Birt Report Viewer Customization- Yet another question [message #962876 is a reply to message #959355] Mon, 29 October 2012 11:52 Go to previous messageGo to next message
birt 2010Friend
Messages: 11
Registered: October 2012
Junior Member
Still waiting Confused
Re: Birt Report Viewer Customization- Yet another question [message #963081 is a reply to message #962876] Mon, 29 October 2012 15:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

The issue is that the Viewer uses code behind pages with JSP Fragments to construct the viewer. When you call the /frameset servlet mapping it in turn calls the class FramesetFragment.java which uses classname+.jsp. So creating two framesetfragment.jsp pages will be difficult unless you make major changes to the viewer. What is different with your two jsp pages?

Jason
Re: Birt Report Viewer Customization- Yet another question [message #963105 is a reply to message #963081] Mon, 29 October 2012 15:28 Go to previous messageGo to next message
birt 2010Friend
Messages: 11
Registered: October 2012
Junior Member
Thanks Jason. The difference is, since it belongs to two different companies, I am trying to put different logos on each viewer page.
If having two different framesefragment.jsp is difficult then, I could use single page.


Say I have HTML landing page for each company. When user clicks on a link specific to the compnay, I would like to pass custom tag saying "_company:xyz" "-company:ABC" and check for the company in the framesetfragment.jsp. So the alternate question is, can I pass my custom parameters when calling "/birt-viewer/frameset?__report=myreport.rptdesign&"

The idea is to access these custom parameters in framesetfragment.jsp. However I am not able to retrieve any attributes passed. Tried to use the following code logic to see the parameters passed.

<%=
Enumeration attrs =  request.getAttributeNames();
while(attrs.hasMoreElements()) {
    System.out.println(attrs.nextElement());
}
%>	


Getting errors on framesetfragment.jsp saying that the Enumeration is not recognized.

I wish there is a document that explains this configuration, however experience folks like you are helping a lot. Please let me know if you have any way to handle my requirement. I really do not want to run a different viewer application for each company.
Re: Birt Report Viewer Customization- Yet another question [message #963137 is a reply to message #963105] Mon, 29 October 2012 15:51 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

A couple of things. Did you import the Enumeration class? Also you do not use <%= with a println. Try something like this:


<%
if (request.getParameter("yourparameter") == null) {
out.println("no parameter value");
} else {
out.println(request.getParameter("yourparameter"));
}
%>

Jason
Re: Birt Report Viewer Customization- Yet another question [message #963159 is a reply to message #963137] Mon, 29 October 2012 16:05 Go to previous messageGo to next message
birt 2010Friend
Messages: 11
Registered: October 2012
Junior Member
hmm. I added
 <%@ page import = "java.util.*" %>
, still it is giving me errors. Am I missing anything?
Re: Birt Report Viewer Customization- Yet another question [message #963169 is a reply to message #963159] Mon, 29 October 2012 16:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I put this in the body section of the framesetfragment:

<% Enumeration attrs = request.getAttributeNames();
while(attrs.hasMoreElements()) {
%>
<%=attrs.nextElement() + " -- "%>
<%}
%>

I modified the page import at the top like:

<%@ page import="org.eclipse.birt.report.presentation.aggregation.IFragment,
org.eclipse.birt.report.context.BaseAttributeBean,
org.eclipse.birt.report.resource.ResourceConstants,
org.eclipse.birt.report.resource.BirtResources,
org.eclipse.birt.report.utility.ParameterAccessor, java.util.Enumeration" %>
And it worked for me.

Jason
Re: Birt Report Viewer Customization- Yet another question [message #963220 is a reply to message #963169] Mon, 29 October 2012 16:56 Go to previous messageGo to next message
birt 2010Friend
Messages: 11
Registered: October 2012
Junior Member
Hmm. I know what I did wrong "<%=" in my code was messing up. It should have been "<%". Embarrassed

I tried your snippet, I do see the attributes. Now I am getting the following error.
SEVERE: Servlet.service() for servlet [ViewerServlet] in context with path [/birt-viewer] threw exception [org.apache.jasper.JasperException: org.apache.jasper.JasperException: org.apache.jasper.JasperException: org.apache.jasper.JasperException: javax.servlet.ServletException: File &quot;/webcontent/birt/pages/parameter/HiddenParameterFragment.jsp&quot; not found] with root cause
javax.servlet.ServletException: File &quot;/webcontent/birt/pages/parameter/HiddenParameterFragment.jsp&quot; not found


I am using Tomcat 7.0. I do not see the folder ../pages/parameter in my install.

[Updated on: Mon, 29 October 2012 17:48]

Report message to a moderator

Re: Birt Report Viewer Customization- Yet another question [message #963231 is a reply to message #963220] Mon, 29 October 2012 17:09 Go to previous messageGo to next message
birt 2010Friend
Messages: 11
Registered: October 2012
Junior Member
Shocked ; I have replaced the FrameSetFragment.jsp with the original file. Still getting the same error. Not sure what went wrong. Nothing changed except the FrameSetFragment.jsp. I made sure to remove all my changes with the JSP out of the folder just in case if there is a reference issue.
Re: Birt Report Viewer Customization- Yet another question [message #963276 is a reply to message #963231] Mon, 29 October 2012 17:47 Go to previous messageGo to next message
birt 2010Friend
Messages: 11
Registered: October 2012
Junior Member
I ran a report that does not have charts and it displayed properly. So could it be charts related. Not sure why all of a sudden this issue is happening. It was working last time I checked ( one day back). Any suggestions are appreciated.
Re: Birt Report Viewer Customization- Yet another question [message #963326 is a reply to message #963276] Mon, 29 October 2012 18:39 Go to previous message
birt 2010Friend
Messages: 11
Registered: October 2012
Junior Member
Reinstalled the viewer and it appears to be working again. Apparently something got messed up over the weekend.
Previous Topic:Babel Language Packs R0.10.0 for Juno - BIRT 4.2.1
Next Topic:Showing aggregated data in table 1 in table 2
Goto Forum:
  


Current Time: Tue Apr 16 09:35:45 GMT 2024

Powered by FUDForum. Page generated in 0.35511 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top