User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » SQL export fix or SQL import to excel/access? Page [1]  
Novicane
All American
15413 Posts
user info
edit post

I have a database/php backend that has several "registrations" that go into it. We have a guy that approve/denies these registrations. Currently on the php end, we can export these registrations as CSV files but when you bring it into excel its unformatted data pretty much.

How can i take this data and populate a template in excel? or manybe MS access automatically?

I'd either like to do this one registration at a time like it is now, or figure out how i can get MSaccess to import in the data and them populate a form in MSaccess. not sure how i can do this without creating too much work for me and the other guy that has to retype all of these registrations in excel because the CSV doesn't contain any formatting.

[Edited on September 2, 2009 at 2:02 PM. Reason : s]

9/2/2009 2:02:28 PM

synapse
play so hard
60929 Posts
user info
edit post

i tried to follow along

but you lost me

9/2/2009 2:08:12 PM

BigMan157
no u
103352 Posts
user info
edit post

you're gonna have to make some macro to read in the CSV and put your data where you want it and format it how you want it

alternately look into exporting through php into SpreadsheetML, where you can actually specify formatting, spacing, etc.

[Edited on September 2, 2009 at 2:19 PM. Reason : it's a bitch though ]

9/2/2009 2:18:21 PM

qntmfred
retired
40551 Posts
user info
edit post

you don't have to do a macro. excel can be configured to automatically read from a "datasource" which can be sql, csv, access, etc

[Edited on September 2, 2009 at 2:22 PM. Reason : see http://ken.kaisia.com/Example.xlsx for a very simple example of an excel template]

9/2/2009 2:21:44 PM

Novicane
All American
15413 Posts
user info
edit post

yes, this is what I'm looking for, thanks.

[Edited on September 2, 2009 at 2:28 PM. Reason : s]

9/2/2009 2:28:22 PM

synapse
play so hard
60929 Posts
user info
edit post

I've only tried to do that with MSSQL before, but I assume it works well with other db too. just google for "link excel ? datasource" where ? = your database type...if you need more information

9/2/2009 2:52:17 PM

Novicane
All American
15413 Posts
user info
edit post

well it's sort of weird because the data is left aligned and some are right aligned.


field data
field data
field data
field data
field field field field
data data data data
field data


Also the data grows and shrinks. The example above has 4 data items, some maybe none or more than 10.


I can transpose with a paste special in excel but the other data is now left aligned.

I'm going to need to rewrite this CVS export and make my fields on top and data below the fields. So i can setup a template for all situations.



[Edited on September 2, 2009 at 4:43 PM. Reason : dd]

9/2/2009 4:42:21 PM

 Message Boards » Tech Talk » SQL export fix or SQL import to excel/access? Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.