Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm a db guy making my first foray into formatted Excel documents and am being asked to populate a sheet similar to the image below. I'm looking for general guidance to understanding the Excel-specific terminologies I'll need to understand. I'll be using VS2013 and VSOTs and already see generally how to connect the db to the sheet (data will be driven from a SQL db). But populating the rows where merged and formatted cells are involved is a little less clear (pointers to relevant tutes would be a big help).

I think I'll want a better understanding of the ins and outs of template documents [note how the overall document is a collection of 3 sub documents with a header and footer - it didn't fit but grand totals are down there] or should I expect a loop within the app to simply paint each row according to the relevant formatting?

The relevant bit here is plugging db-based data into the formatted regions according to the sample - not merely linking SQL-based rows to Excel-based rows as is shown in most (all) samples i've come across so far.

[FOLLOWUP per questions]: Number of line items will vary. Subtotal calculations should be sheet-based given the possibility of post production, hand editing. The page shown is for one of several dozen different 'regions' so the banner itself is also dynamic. Basically you are looking at one week's worth of 'productions' - one titled 'Analyzing Decisions', another titled 'Public', the 3rd titled 'Seven Habits'. Then details of orders nested respectively. The number and titles of productions of any given week will vary.

enter image description here

share|improve this question
    
Just a quick initial thought, Excel may not be your best tool here. Excel works great with SQL, but shoehorning the results into a specific template style may prove challenging. I would consider a DB reporting tool (e.g. Crystal Reports) as an alternative. –  dav Jun 10 '13 at 14:00
    
Thanks for the thought - if these were read-only reports that makes sense, but there's going to be some additional post-production operations and a couple other considerations that dictate Excel. - appreciated though –  justSteve Jun 10 '13 at 15:00
    
Ok, that makes sense. In your example are the numbers of rows in each section (i.e. the name/email/company...) going to change each time? Other than that are the gray cells (i.e. due on billed...) always two rows beneath the last name row? Also are those fields calced by Excel or values returned from SQL? –  dav Jun 10 '13 at 16:08
1  
Thanks - edited original question for clarity in this regard. –  justSteve Jun 10 '13 at 16:35
    
Why not create the form template and then with either the Worksheet_OnLoad event or a dropdown box get the data you want from the database and copy it over to the sheet. The only answer here is to use VBA. If you try using Excel only, you will have formulas that will get deleted when the end user changes the value of one of the cells. –  wbeard52 Jul 26 '13 at 18:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.