Dynamically Show/Hide Columns

Hello friends
I am working on Crystal report 12.1
I have a table in SQL server with 24 fields.
Every 2nd field is bit field. kind of Visible True/False tag for previous column.
e.g.  Name, Name_SH, Fund, Fund_SH    -
  Column names
Name, Fund stores value.
Name_SH stores, True/False for Name
Fund_SH stores, True/False for Fund
So, now, when I display report in Crystal report, user will select some fields from that 12 fields.
That will be processed throug Stored proc in SQL and feeds data in same table.
Now, in Report, How can I implement this situation, of display only columns with _SH = True.
and also, user need proper format, means, there should be equal space between all columns.
Please help me to solve this.
thanks in advance.
Thanks & Regards
Utkarsh

UNION to a single column with a secondary column for Type (field name) and remove invisible ones from the UNION process.
Then, use a CrossTab to show the final result.

Similar Messages

  • Dynamically show/hide columns for DelimitedData output

    My users want to see only dynamic sets of data from the same report query.
    For example, if the query returns:
    Date, Widget1Count, Widget2Count, ..., WidgetZCount
    User1 wants to see Date and counts for widgets 1,2, 5, and 10
    User2 wants to see Date and counts for widgets 2, 3, 4, 5, 10-20.
    Uset3 wants to see Date and widget 99 count.
    I don't want to write a custom report for every single user nor do I want to create Z! number of queries to satisfy every possible request combination.
    I wonder, is there a way to change "Exclude from XML Output" property for a particular query field(s) from a report AfterPForm or BeforeReport trigger?

    Hi,
    I had the same problem, but I saw the Metalink document: 340793.1, which gave the solution I needed.
    In my case, I needed to limit the number of columns being outputted in a DELIMITEDDATA format based on a user parameter.
    I ended up with the following code in my After PForm trigger, which did the job.
    BEGIN
    SRW.ADD_DEFINITION('<report DTDVersion="1.0">');
    SRW.ADD_DEFINITION('<customize>');
    -- For those columns I want displayed, Set the XMLSuppress property to False
    FOR tmp IN 1 .. 10 LOOP
    SRW.ADD_DEFINITION('<object name="col_'||LPAD(TO_CHAR(tmp), 3, '0')||'_title" type="REP_COL_MAP">');
    SRW.ADD_DEFINITION('<properties>');
    SRW.ADD_DEFINITION('<property name="XMLSuppress">False</property>');
    SRW.ADD_DEFINITION('</properties>');
    SRW.ADD_DEFINITION('</object>');
    END LOOP;
    -- For those column I don't want displayed, Set the XMLSuppress property to True
    FOR tmp in 11 .. 100 LOOP
    SRW.ADD_DEFINITION('<object name="col_'||LPAD(TO_CHAR(tmp), 3, '0')||'_title" type="REP_COL_MAP">');
    SRW.ADD_DEFINITION('<properties>');
    SRW.ADD_DEFINITION('<property name="XMLSuppress">True</property>');
    SRW.ADD_DEFINITION('</properties>');
    SRW.ADD_DEFINITION('</object>');
    END LOOP;
    SRW.ADD_DEFINITION('</customize>');
    SRW.ADD_DEFINITION('</report>');
    SRW.APPLY_DEFINITION;
    END;
    I hope this helps with your problem.
    Paul

  • Dynamically show/hide pages in a workset for special users at runtime

    Hi all,
    I want to create a workset that contains pages for different countries. The portal users should only be able to see the countries where they do business. I also would like masterdata from R/3 to drive the display of content on the portal.
    - Is there a way how I could dynamically show/hide certain pages of the workset for the specific users?
    - Would this showing/hiding of pages affect the workset for all users or only the instance for the specific user?
    - Would there be a difference when I want to dynamically show/hide iviews in a page instead of showing/hiding pages in a workset?
    Thanks a lot in advance.

    Hi Timo,
    Check out the article located at:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/portal_content/filtering role and workset content.htm
    It talks to exactly what you're trying to do.  I'd imagine you could extend this simplistic example to have the service pull the users country from his/her master record in R/3 and set their filtering expression accordingly.
    Hope this helps,
    Marty

  • Dynamically show/hide Excel WPA

    Hello,
    I am working on a web page, where list of links will be given. On user-click on a link either it will show target web page in a iframe or it will show a excel sheet in excel wpa. On the basis of link clicked, I need to hide/show iframe and Excel WPA. I can
    control iframe using javascript but i don't know how to work with Excel WPA. At a time either iframe or Excel wpa will be shown on the screen but not both.

    Hi,
    According to your post, my understanding is that you wanted to dynamically show/hide Excel WPA.
    If the Excel WPA is Excel Web Access Web Part, you need to  get the ID of the Web part and hide the web part.
    When you click the link, you need to get the parameter form the URL and then display the web part.
    Here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/en-US/219b388e-0979-46b4-9a46-f7e6449738b8/hide-and-show-a-list-view-webpart-by-clicking-on-a-link-in-the-same-webpart-page-in-sharepoint-2010?forum=sharepointgeneralprevious
    For more information, please refer to:
    Dynamically Show/Hide Multiple Web Parts
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to make a layer from the ADF pivot table invisible , show-hide column-row-data

    Hello all ,
    I need to create a pivottable with ADF 12c for reporting purposes.
    I have a table or view with 10 items of type VARCHAR2 , C1,C2,C3,C4,C5,C6,C7,C8,C9,C10  and   10 items of type NUMBER N1,N2,N3,N4,N5,N6,N7,N8,N9,N10
    The items of type VARCHAR2 are for Column and Row areas and the items NUMBER are for Data Areas
    I want to create a jsf page with one empty pivottable and in code Show or Hide the items in the Column area , Row area , Data area
    Con you send me a small sample ?
    I test with this code that i find in oracle OTN but not work.
    <dvt:pivotTable id="pt2" value="#{bindings.WebPivotDataView1.pivotTableModel}" var="cellData"
    varStatus="cellStatus" splitMode="enabled"
    binding="#{backingBeanScope.CmfPivotBean.pivotTable}"
    >
    <dvt:headerCell>
    <af:switcher facetName="#{cellData.layerName}" defaultFacet="Default" id="s1">
    <f:facet name="DataLayer">
    <af:outputText value="#{cellData.label}" id="ot1"/>
    </f:facet>
    <f:facet name="C01">
    <af:outputText value="#{cellData.dataValue}" id="ot2"/>
    </f:facet>
    <f:facet name="Default">
    <af:outputText value="#{cellData.dataValue}" id="ot3"/>
    </f:facet>
    </af:switcher>
    </dvt:headerCell>
    <dvt:dataCell>
    <af:switcher facetName="#{cellStatus.members.DataLayer.value}" defaultFacet="Default" id="s2">
    <f:facet name="N01">
    <af:outputText value="#{cellData.dataValue}" id="ot4">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.WebPivotDataView1.hints.N01.format}"/>
    </af:outputText>
    </f:facet>
    <f:facet name="Default">
    <af:outputText value="#{cellData.dataValue}" id="ot5"/>
    </f:facet>
    </af:switcher>
    </dvt:dataCell>
    </dvt:pivotTable>
    DCBindingContainer bindingContainer = (DCBindingContainer)ADFContext.getCurrent().getRequestScope().get("bindings");
    CubicBinding cubicBinding = (CubicBinding)bindingContainer.findCtrlBinding("WebPivotDataView1");
    CubicEditor cubicEditor = cubicBinding.getCubicEditor();
    cubicEditor.removeLayer(DataDirector.ROW_EDGE, 0); //remove 1st row edge
    cubicEditor.removeLayer(DataDirector.COLUMN_EDGE, 0); // remove 1st column edge
    cubicEditor.removeDataItem(0);
    CubicDefinition def;
    def = cubicBinding.getProjection();
    LayerDefinition layerDefinition = new LayerDefinition("C3");
    cubicEditor.addLayer(DataDirector.ROW_EDGE, 0, layerDefinition);    
    LayerDefinition layerDefinition2 = new LayerDefinition("C4");
    cubicEditor.addLayer(DataDirector.COLUMN_EDGE, 0, layerDefinition2);
    DataItemDefinition def3 = new DataItemDefinition("N1");
    cubicEditor.addDataItem(def3);
    AdfFacesContext.getCurrentInstance().addPartialTarget(pivotTable);
    Can you help me if is possible to create a pivottable binding to a one ViewObject and in code show/hide or compose the layout of the pivottable ??
    I search in google and OTN oracle and not find any code.
    Only find the code of the samples that is very complex for me , the code of the samples create the PivotTableModel from one Array , and i want to binding from one ADB BC ViewObject.
    Thanks in advance

    The solution I presented for your use case an DOAG 2013 was to create a pivot table binding out of user defined attributes from the table. For the defined attributes a VO is dynamically created as well as the pivot binding. The pivot binding is then exchanged at runtime together with the activation of the dynamic VO needed to only get the data needed for the particularly pivot table.
    Your solution using the CubicEditor is hard to implement due to the missing documentation. This was the reason I did not follow this approach, However it's not impossible (done it on a very small scale).
    None of the solution are what I call simple. They are complicated, complex and in part not supported solution (exchanging the pivot table binding at runtime need to use internal classes, which is not supported).
    I can't give you a working sample as it's too complex. I can make the slides available, however they are in German.
    Timo

  • Carl - Show Hide columns and report templates

    Carl,
    I've implemented the show/hide report column techniques from your demo pages. Thanks for that, it's working well.
    I am having a slight issue. I'm using theme12, and when I implement the technique there with the alternating row color template, the functionality works fine. But when I switch to standard report template I have some issues.
    Debugging the code :
    function html_HideCellColumn(pId){
    35 var l_Cell = html_GetElement(pId);
    36 var l_Table = html_CascadeUpTill(l_Cell,'TABLE');
    37 var l_Rows = l_Table.rows;
    38 l_CellI = getCellIndex(l_Cell.parentNode,l_Cell)
    39 for (var i=0;i<l_Rows.length;i++){
    40 html_HideElement(l_Rows.cells[l_CellI]);
    41 }
    42 return;
    the pId is what expect before line 35, but after, it looks like the html_GetElement is returning null.
    Is there something in the template that would cause this change? I am able to reproduce this behavior consistently. Thanks for any input.

    Hello,
    The table headers in the standard report template of that theme are missing the id attribute so changing this.
    &lt;th class="t12header" #ALIGNMENT# >#COLUMN_HEADER#&lt;/th>
    to
    &lt;th class="t12header" #ALIGNMENT# id="#COLUMN_HEADER_NAME#">#COLUMN_HEADER#&lt;/th>
    and your good to go.
    Carl

  • Show Hide Columns

    Is there a way in which columns can be hidden from the resulting html report.
    I guess to bring them back you would have to click on show all, or something like that ?
    It would be like accessing setting a show/hide checkbox in the Report Attributes but in this case allowing the user to make the choice.
    Any ideas would be appreciated

    Mark,
    One way of doing this would be to make the columns conditionally displayed. You could then write a condition that e.g. checks the value of a page item being yes or no. The page item could be set by the user. So you could have a radio group, or button, or select list to turn off or turn on columns within your application.
    Regards,
    Marc

  • Dynamically show/hide regions out of the application workflow

    hi,
    is it possible to show/hide regions of a page dynamically with a "select list with submit" item?
    regards

    Hi,
    Do you mean "Conditionally display" items based on the value of a Select List with Submit?
    Andy

  • Show/hide column

    How to show or hide column within ADF table based on certain condition ?

    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/84-treetable-column-hide-show-404584.pdf
    https://forums.oracle.com/thread/2275114

  • Dynamically display/hide columns according to user inputs

    Hi,
    I need to display or hide columns in reports based on user input. ie. I have several prompts, if user doesn't input values, then the associated columns will not be displayed in the report. Is there a way to achieve this in BO XI R2. Greatly appreciated for your help.

    Hi Andy,
    You can't hide them totally, but you can get close using alerters.
    Build an alerter (probably a formula one) that put the value ="" in the field.
    Now the formula should test the userresponse for that column,
    based on the contents of it (filled in --> false, otherwise --> true).
    Apply the alerter to all cells of the column. It will empty completely when the prompt was not filled.
    Just set the width of the column to automatic (best use the header cell only) and the minimum width on zero. It will shrink the width when empty, making it seem as if hidden.
    Good luck,
    Marianne

  • SP2013 Is it possible to show/hide columns based on column selections?

    SharePoint 2013
    I have a lists with a school district selection choice column (refer to as column A). Then I have three other columns with schools based on district. What I would like to do is only show schools in a certain district based on what district
    is selected in column A. Can anyone tell me if this is possible and if so, how can i acheive it?

    It generally takes a little script to get the cascading right;
    http://sharepoint-works.blogspot.ch/2012/02/cascading-dropdown-or-filtered-values.html
    https://www.youtube.com/watch?v=70-hXWY6ARY
    InfoPath is another possibility. Are you using that?
    w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

  • Is it possible to show/hide dynamically columns in RDLC form?

    We need to show/hide dynamically columns in our Report RDLC form based by the user desire needs.
    We need by the predefined checkboxes to set which columns should be seen and which should be hidden.
    Is it possible in RDLC form to make it "show/hide columns dynamically" with any way?

    Depends on what you mean dynamically, you still need to press the view report button.
    What you can do is right click on the column you want to be able to hide/display in design mode,
    click "Column visibilty", choose "show or hide based on an expression" then in your expression base your true or false on a boolean parameter for each column

  • What is the best way to show/hide n number of columns ?

    Hi,
    I have a dynamic report that I have show/hide columns working using the below code. But when there are 500 or more rows it takes about a minute or more just waiting to see the columns toggle.
    What is the best way to do this?
    // Existing Javascript
    [script language="JavaScript" type="text/javascript"]
    var maxcnt= mymonths.length;
    function hideMaxEarn(){
    for(var j=0;j[maxcnt;j++){
    hideColumn('MON'+mymonths[j],'MAXCOL'+mymonths[j]);
    hideColumn('MON'+mymonths[j],'EARNCOL'+mymonths[j]);
    hideColumn('MON13','MAXCOL13');
    hideColumn('MON13','EARNCOL13');
    function showMaxEarn(){
    for(var j=0;j[maxcnt;j++){
    showColumn('MON'+mymonths[j],'MAXCOL'+mymonths[j]);
    showColumn('MON'+mymonths[j],'EARNCOL'+mymonths[j]);
    showColumn('MON13','MAXCOL13');
    showColumn('MON13','EARNCOL13');
    function getCellIndex(pRow,pCell){ 
    for(var i=0, n=pRow.cells.length;i[n;i++){ 
        if(pRow.cells[i] == pCell) return i;
    function hideColumn(pMon,pCol){
    var l_Cell = $x(pCol);
    var l_Table = html_CascadeUpTill(l_Cell,'TABLE');
    var l_Rows = l_Table.rows;
    l_CellI = getCellIndex(l_Cell.parentNode,l_Cell);
    for (var i=0, n=l_Rows.length;i[n;i++){
        if(i != 0) {
           html_HideElement(l_Rows[i].cells[l_CellI]);
    } else {
    $x(pMon).colSpan = $x(pMon).colSpan - 1;
    function showColumn(pMon,pCol){
    var l_Cell = $x(pCol);
    var l_Table = html_CascadeUpTill(l_Cell,'TABLE');
    var l_Rows = l_Table.rows;
    l_CellI = getCellIndex(l_Cell.parentNode,l_Cell);
    for (var i=0, n=l_Rows.length;i[n;i++){
        if(i != 0) {
           html_ShowElement(l_Rows[i].cells[l_CellI]);
    } else {
    $x(pMon).colSpan = 3;
    return;
    [script]

    Hi Andy,
    Yes, I replaced the code calling the same things in a loop to one loop getting the Table reference once and I build an array of column numbers at the time the report is built so I don't have to get the column number each time....
    it is a couple of seconds faster in about a 30 second response time. It will have to do it for now, no more time unless you see something in this new code...
    Thank you! Bill
    // dynamically built code
    col_nbr_array = new Array();
    col_nbr_array[0] = "1";
    col_nbr_array[1] = "2";
    col_nbr_array[2] = "4";
    col_nbr_array[3] = "5";
    col_nbr_array[4] = "7";
    col_nbr_array[5] = "8";
    col_nbr_array[6] = "10";
    col_nbr_array[7] = "11";
    col_nbr_array[8] = "13";
    col_nbr_array[9] = "14";
    col_nbr_array[10] = "16";
    col_nbr_array[11] = "17";
    col_nbr_array[12] = "19";
    col_nbr_array[13] = "20";
    col_nbr_array[14] = "22";
    col_nbr_array[15] = "23";
    col_nbr_array[16] = "25";
    col_nbr_array[17] = "26";
    col_nbr_array[18] = "28";
    col_nbr_array[19] = "29";
    col_nbr_array[20] = "31";
    col_nbr_array[21] = "32";
    col_nbr_array[22] = "34";
    col_nbr_array[23] = "35";
    col_nbr_array[24] = "37";
    col_nbr_array[25] = "38";
    col_nbr_array[26] = "40";
    col_nbr_array[27] = "41";
    // Static code
    function show_hide_column(do_show) {
    // Set Style, Show/Hide
    var stl;
    var csp;
    if (do_show){
    stl = 'block'
    csp = 3;
    }else{
    stl = 'none';     
    csp = 1;     
    // get rows object
    var l_Rows = document.getElementById('DT_RANGE').rows;
    var totCellNbr1=parseFloat(col_nbr_array[maxcnt-1])+2;
    var totCellNbr2=totCellNbr1 +1;
    var n=l_Rows.length;
    for (var i=0; i[n;i++){
        if(i != 0) { // if not the main header which spans 3 cols when expanded
          // Go through and show/hide each cell
          for(var j=0;j[maxcnt;j++){
              l_Rows[i].cells[col_nbr_array[j]].style.display = stl;
    // Totals
    l_Rows.cells[totCellNbr1].style.display=stl;
    l_Rows[i].cells[totCellNbr2].style.display=stl;
    } else { // row 1 that has Month spelled out - colspan of 3, others has max,earned and score columns for each month.
    var maxhdr = maxcnt/2;
    for(var k=1;k[=maxhdr;k=k+1){
    //alert('Header['+k+']');
    l_Rows[i].cells[k].colSpan=csp;
    // Total column
    //alert('TotHeader['+(maxhdr+1)+']');
    l_Rows[i].cells[maxhdr+1].colSpan=csp;
    [script]

  • Show/hide a column  in JTable

    I want to show/hide columns in JTable
    How is this possible
    Note that columns that are hidden may be showed later
    thanks in advance
    Renjith

    I tried out for this:TableColumn col = jTable.getColumnModel().getColumn( colnum );
    if( col != null )
      col.setPreferredWidth( 0 );
      col.setMaxWidth( 0 );
    }But the column seems to have minimum width which you can't even change with col.setMinWidth( 0 );

  • Container resizing when dynamically showing/hiding components

    I work with Swing for quite some time, but there's one thing that's bugging me all the time - when you dynamically show/hide some components, the container is not resized appropriately. That means that some components are cut off or hidden beyond the container edge. Maybe I'm just doing something wrong, can somebody help me?
    The easiest example is here. I'll create a label that is hidden by default. When I dynamically show it, the frame/panel is not enlarged and therefore the label is not visible until the user manually resizes the frame/panel. Only after that you can see it.
    (Usually I use the layout manager used when designing UIs in NetBeans, but I hope these default layout managers will demonstrate the same problem.)
    import java.awt.event.*;
    import javax.swing.*;
    public class DynamicComponentDemo {
        private static void createAndShowGUI() {
            final JFrame frame = new JFrame("Dynamic Component Demo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setLocationRelativeTo(null);
            final JPanel panel = new JPanel();
            frame.add(panel);
            final JCheckBox checkbox = new JCheckBox("Show label");
            final JLabel label = new JLabel("This is a label!");
            checkbox.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent e) {
                    label.setVisible(checkbox.isSelected());
            label.setVisible(false);
            panel.add(checkbox);
            panel.add(label);
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }What can I do to force the frame/panel to resize appropriately when some new component is shown? Moreover, can you point me to some documentation regarding these matters?
    Thanks.

    Kleopatra wrote:
    no. no. no. no. Never-never-ever call setXXSize - XX for min/pref/max - in application code.Thanks for the correction.
    Unfortunately,
    http://wiki.java.net/bin/view/Javadesktop/SwingLabsImperialRules
    is a dead link, so I'm not sure if this is better than my previous example :(
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DynamicComponentDemo3 {
      private static void createAndShowGUI() {
        final JFrame frame = new JFrame("Dynamic Component Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationRelativeTo(null);
        final JPanel panel = new JPanel(new FlowLayout() {
          @Override public Dimension preferredLayoutSize(Container target) {
            //synchronized (target.getTreeLock()) {
            Dimension ps = super.preferredLayoutSize(target);
            Dimension cs = target.getSize();
            ps.width  = Math.max(cs.width,  ps.width);
            ps.height = Math.max(cs.height, ps.height);
            return ps;
        frame.add(panel);
        final JCheckBox checkbox = new JCheckBox("Show label");
        final JLabel label = new JLabel("This is a label!");
        checkbox.addItemListener(new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
              label.setVisible(checkbox.isSelected());
              frame.pack();
        panel.add(checkbox);
        panel.add(label);
        frame.pack();
        label.setVisible(false);
        frame.setVisible(true);
      public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            createAndShowGUI();
    }

Maybe you are looking for

  • Root object is missing or invalid

    Received the following message when attempting to open a pdf file in an email.  "There was an error opening this document.  The root object is missing or invalid."   I was using MS Outlook 2007.  Unknown what program the email sender was using to cre

  • Help with using IIS as webserver

    I have two DNS that maps to two application on the same instance of weblogic. I have to use IIS as my webserver, and so I have two IIS apps that maps by path. In one of the iisproxy.ini file - WlForwardPath = / and in the other WlForwardPath = /app2

  • HT4796 I downloaded the migration assistant file, but my PC cannot open it because it says it is not a valid W32.exe file.

    I just bought my first Mac and need to transfer my PC files to it.  I downloaded WndowsMigrationAssistantSetup.exe to the PC, but I cannot execute the file because the PC (running Vista) says it is not a valid W32 file.

  • SRM/XI Scenarios

    I'm looking for someone out there that has experience configuring XI to send out cXML Purchase Orders via HTTP created in SRM to Trading Partners and also to receive cXML Invoices via HTTP for these Purchase Orders into XI. My questions are: How do y

  • Noteboard webpart in community site with publishing feature enabled

    Hi All Noteboard webpart works fine as long as publishing site/web feature is not enabled but after it is enabled people with contribute permissions can not see the noteboard comments of the people with Moderate/Full control/Site collection access an