I was wanting to know if EasyMorph can pull data from a sql query and export to an existing spreadsheet which already has the column names and logo, or can this be done with the Report tab in EasyMorph. I have not used the Report section yet, but it looks like it's almost exactly what I need. I can attach a mockup of what I wanted it to look like. BLANK New Account Report.xlsx (22.8 KB)
I was hoping to use a sql query to pull the data, then write it to the attached spreadshet starting in row 3. Also include a Client name from the data in the Title along with Start/End dates. I've done this in SSRS back in the day. I was hoping to use EM for this. Any advice?
Create an EasyMorph project that pulls the necessary data from wherever is necessary. Use the "Export to Excel file" action in the "Replace table in existing file" mode. Select the "Raw data" sheet.
Let's run it.
Let's open the spreadsheet. It worked!
In a similar fashion, it's possible to update charts and pivot tables too. They should use (as a source) queries that copy data from sheets with unformatted data that are updated with EasyMorph.
Is it possible to retain the column widths from the main data sheet? I can get the data to load into the main sheet ok, but something wants to resize the column widths in the main sheet when I run the EM model. Ex. Column A, my logo width (Same as original) is wider than Column A in the new result
I'm not aware of any better solution. Probably something can be done using VBA macros that are triggered by the "Excel command" action in EasyMorph, but this is based on outdated COM-automation that is finicky and frequently doesn't work on EasyMorph Server.
You can use formula references to the Raw Data sheet instead of queries, but they don't update automatically on workbook opening.
Thank you for your response. I was trying to avoid using a macro, but before I saw your solution I put a solution together using a macro. I basically open the template spreadsheet up, then write my raw data to a new tab. From there the macro does everything and it's really fast. Just harder for folks to understand. I also had to replace some text with data in the header kind of like parameters. It woks fine, and does everything I wanted it to. You definately have more control with the macro, I just liked the idea of your solution because it's simpler to follow. I'll attach my macro. I'm not a VBA guroo, I just GTS (Google that sh!t) what I'm looking for. I've programmed in many different languages in my time, so I know the ideas of what need to be done, I just have to understand the syntax. Macor_Test.txt (2.1 KB)
Let me know what you think of the macro. Keep in mind, I don't know VBA that well