Export datagrid to Excel template, transpose ?

S

sweeney_jones

Hi,

I am really struggling to figure out how to do this.

I have a SQL view that contains 3 columns and upto 4000 rows. This is a
series of question numbers and answers for a questionnaire. There are
40 questions in the questionnaire, answers of 1 - 8, 100 participants.
The 3 columns are . .

QlineID - Indicates the line item id, this will repeat 40 times and
relates to the questionnaire title and user.
Question - Gives the question number (1 - 40)
Answer - Gives the answer for this question from this user for this
questionnaire ! (1 - 8)

So, I can load this into a dataset/grid/table and show it at runtime to
the users, but it is no good for analysis. What I need to do is give a
button, so that this data can be exported to a predefined XL template
that performs analysis and charts results.

Thats my first problem, getting it into Excel. Ideally I would like to
launch XL client side and prompt for a filename to save. Or could I
save it as HTML then load it back into the browser ?

My next issue is that the Excel template expects the data in a
different layout, almost transposed. The columns titles range from 1 -
40 and relate to the question numbers, there is then a row for each
QLineID with the answer recorded against it. So I would have 100 rows,
each with 40 answers in order. I now have data that can be easily
reported.

Thats my 2nd problem, transposing the data.

I've read lots about this subject, but can't see a way forward. Hold
the data in a multidimensional array then dump that to XL, create CSV /
XML data.

Can anybody give some advice on this please ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top