Jump to content

dynamically hide&show colms based n i/p control


openxadmin

Recommended Posts

hi  everybody

need urgent help

i 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 .. i

each action is stored as say action=name&type1

this would repeat for the list of actions

now how would i pass this to jrxml and view only the necessary columns only pls respond

i 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

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

hi svenn

i 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 labels

say 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

let me put my query more clearly for better understanding

Is 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 columns

I 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 columns

say for example on action1

column1   column2 column3 will be vissible

 

say for action2

column1   column2 column3 column4 column5 will be visible

 

i tried getting the actiontype from the controller and have passed as a parameter to the jrxml file

String viewname = "view1";   
            String reportaction = request.getParameter("type1");

i have put these viewname and action in map and used

return new ModelAndView(viewname ,map) to return

let 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...