Start a new topic

Excel Export - One Click

I'm using DbVisualizer 9.5.1


I used to use Aqua Data Studio.  That program had a feature called "View as Spreadsheet".  I so miss that feature.  Here's an example of what it did.


First, user writes a query and returns a recordset into the grid.


Second, user clicks an icon on the grid toolbar "View as Spreadsheet".


Third, user is brought to a new Excel workbook with the grid (columns and rows) provided.


That's it!  It's oh so simple but oh so nice.  I realize users can export to a file but this is so handy when you want to do a little bit of analytics on some ad-hoc analysis.  Often I don't need to save my results.  I just want to check something out and Excel is a very powerful tool for that type of work.  What Aqua did to marry their tool up with Excel was genius.  I might urge you all to consider this functionality.


If you want the DbVisualizer's implementation to be even better than Aqua's I would urge the process makes two worksheets in the workbook.  The first worksheet would be the grid results.  The second worksheet would be the code used to generate the results.  THAT WOULD BE AWESOME!!!!


http://www.aquafold.com/d10/docs/10.html




I want to share an Excel macro that does just what I suggested -- moves the query to a new tab named "Query", moves the other columns up, and autofits them, all ready to email.

 

Sub DbVis_reformat()
'
' DbVis_reformat Macro
' Gets a spreadsheet exported from DbVisualizer ready to email.
' Moves the query to its own tab and autofits the columns.
'
' Keyboard Shortcut: Ctrl+d
'
    Sheets.Add After:=Sheets(Sheets.Count)
    Sheets("Sheet2").Select
    Sheets("Sheet2").Name = "Query"
    Sheets("Sheet1").Select
    Sheets("Sheet1").Name = "Data"
    Range("A2").Select
    Selection.Cut
    Sheets("Query").Select
    ActiveSheet.Paste
    Selection.Columns.AutoFit
    Range("A1").Select
    Range("A1").WrapText = True
    Selection.Columns.AutoFit
    Sheets("Data").Select
    Rows("1:3").Select
    Selection.Delete Shift:=xlUp
    Cells.Select
    Selection.Columns.AutoFit
    Range("A1").Select
    
End Sub

 Hope others find this useful.

Hi,


Just to inform you that we have just released a new beta version of the upcoming DbVisualizer 11.0 with the SQL by default being in its own sheet. We do have an open ticket that this should be configurable.


https://www.dbvis.com/beta/


Regards

Roger

Ya'll are the best. Thank you.

I have since moved to a company that just has PgAdmin and I am biding my time to when I can make a pitch for DbVisualizer! One of my favorite pieces of software I have ever used. I even used your command line tool to run SQL for migrating our bank customer data around, and parsed the dbvis.xml for connection info. In retrospect not the smartest way to do an ETL, but DbVis gave me a lot of power and Fifth Third was happy with it. Thanks for all the improvements that you do, and the great forum communication too!

Love those follow-ups! Thanks Fireslinger! :-) 

Login or Signup to post a comment