openxadmin Posted September 12, 2008 Share Posted September 12, 2008 hi everybodyneed urgent helpi have jrxml file which produces jasper file using ireport tool . the end view is like i have some 5 columns now my requirement is i want to hide certain columns based on the users control. the user is provided with a list on on whose action some columns have to hidden since for that action performed by the user the column is not needed and this jrxml file is used for all the entire list of action . how do i control this ...please help me .. ieach action is stored as say action=name&type1this would repeat for the list of actionsnow how would i pass this to jrxml and view only the necessary columns only pls respondi tried with printWhenExpression not able to properly know how to use... sample code will be appreciated . thanks in advance Link to comment Share on other sites More sharing options...
svenn Posted September 12, 2008 Share Posted September 12, 2008 The only way to do this is to dynamically build and compile your report. Link to comment Share on other sites More sharing options...
sd5008 Posted September 13, 2008 Share Posted September 13, 2008 how to dynamically build and compile the reports Link to comment Share on other sites More sharing options...
sd5008 Posted September 15, 2008 Share Posted September 15, 2008 hi svenni am not able to know hoe to pass parameters from my jsp to report. for example i have a jsp form in which i have list of labels on click of labels some columns in my report has to hidden. so how would i pass the labels id to report jrxml to make the column hidden using printWhenexpression. for example when i click on the label in the jsp ,in my url it shows as for example http://ipaddress:9080/reports/Report.jspx?reportAction=reportPlan&reportTpe=Type1 here type1 would varry for different labelssay label2 it would show Type2.so using these values can i control the hidding of the columns please let me know if so how and how shd i use if i need to hide the columns.. very urgent help Link to comment Share on other sites More sharing options...
svenn Posted September 15, 2008 Share Posted September 15, 2008 sd5008Wrote: how to dynamically build and compile the reports That I can not help you with. I've never had to do it. Try doing a search of the forums. I sure there are a few threads on this topic. Link to comment Share on other sites More sharing options...
donclary Posted September 16, 2008 Share Posted September 16, 2008 Did you think about making each column that you want to display/hide a separate subreport? You could build the parameter list of subreports based on the columns that the user selects. The Subreport example shows how to pass subreports as parameters. Good luck! Link to comment Share on other sites More sharing options...
openxadmin Posted September 16, 2008 Author Share Posted September 16, 2008 let me put my query more clearly for better understandingIs there a way to hide a column based on the action made on the report??for instance i am generating a report with say 5 columns, based on the users action say onclick of one button he would require to see only 3 columns , and again on another click u would require to see all the 5 columnsI would prefer to implement it in one template that is in one jrxml file . so how would i hide the columns based on the action.say report has totally 5 columnssay for example on action1column1 column2 column3 will be vissible say for action2column1 column2 column3 column4 column5 will be visible i tried getting the actiontype from the controller and have passed as a parameter to the jrxml fileString viewname = "view1"; String reportaction = request.getParameter("type1");i have put these viewname and action in map and used return new ModelAndView(viewname ,map) to returnlet me know whether i am going in the right flow??in the jrxml file i have created a parameter say<parameter name="reportaction " isForPrompting="true" class="java.lang.Integer"> </parameter> and using print when expression how shd i use this parameter for the columns i want to hide based on the action . hope this explains clearly abt the problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now