Ian Beckett

RSS feed

    Recent comments

    Authors

    How do I get row field headings to repeat in a pivot table?

    The VBA script below is really useful if you need to flatten a pivot table output into a regular table with repeating labels.  Select a column, run the macro, and the blanks are filled!

    source http://www.contextures.com/xlfaqPivot.html#Repeat 

    The row headings show once in a Pivot Table, and there's no setting you can change to force them to repeat. To create a table with a heading on each row, you could copy the pivot table, paste it as values in another location, and fill in the blanks, using the technique shown here: http://www.contextures.com/xlDataEntry02.html.

    Fill Blank Cells Programmatically

    If you frequently have to fill blank cells, you may prefer to use a macro. The following code will fill blank cells in the active column:

    Sub FillColBlanks()
    'by Dave Peterson  2004-01-06
    'fill blank cells in column with value above
    Dim wks As Worksheet
    Dim rng As Range
    Dim LastRow As Long
    Dim col As Long

    Set wks = ActiveSheet
    With wks
       col = activecell.column
       'or
       'col = .range("b1").column

       Set rng = .UsedRange  'try to reset the lastcell
       LastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
       Set rng = Nothing
       On Error Resume Next
       Set rng = .Range(.Cells(2, col), .Cells(LastRow, col)) _
                      .Cells.SpecialCells(xlCellTypeBlanks)
       On Error GoTo 0

       If rng Is Nothing Then
           MsgBox "No blanks found"
           Exit Sub
       Else
           rng.FormulaR1C1 = "=R[-1]C"
       End If

       'replace formulas with values
       With .Cells(1, col).EntireColumn
           .Value = .Value
       End With

    End With

    End Sub


    Posted by ibeckett on Monday, March 09, 2009 2:02 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    SSRS 2008 Report Builder 2.0

    With Reporting Services 2008 came a new report authoring tool geared towards business & power users.  The tool is called Report Builder 2.0, and is available as a standalone download. I have to say this tool works really well with Analysis Services 2008 cubes. You can browse the cubes just like you do in SQL Management Studio cube browser, and can even view/copy the MDX generated by the designer.  Report Builder has been a nice addition to my toolbox.

    You can download Report Builder 2.0 here: http://www.microsoft.com/downloads/details.aspx?familyid=9f783224-9871-4eea-b1d5-f3140a253db6&displaylang=en

    And here is some good but outdated background info from one of the members of the SSRS team at MS: http://blogs.msdn.com/bwelcker/archive/2007/12/11/transmissions-from-the-satellite-heart-what-s-up-with-report-builder.aspx

    Posted by ibeckett on Thursday, March 05, 2009 3:22 AM
    Permalink | Comments (0) | Post RSSRSS comment feed