none
Importing data into Project Server from Excel in C# RRS feed

  • Question

  • Hello,

    I have an input spreadsheet that contains data for custom fields for projects on the project server (2010). I would like to import that data project by project into the proper custom field instead of manually typing it in the project information window. The spreadsheet roughly stores the data in each row like:

    <project name>  |  <custom field>  |  ... |   <other info>

    Since I have some other features I want run before hand, I have an Excel macro run a c# script in order to store the data. I found where the custom field appears on the Reporting database, so I am directly inputting the data there when I run my program. However, the information does not get updated in the Published database, and thus does not show up in MS Project.

    My question is: is there any way to make this happen, preferably in c#? For example, should I be calling some stored procedure to "publish" my changes?

    Thanks in advance.


    • Edited by Kryptyque Thursday, July 21, 2016 3:37 PM
    Thursday, July 21, 2016 3:36 PM

Answers

  • Hi,

    Is this a once off process or likely to be regular? If it's a once off or rare process, then I would develop a Project VBA macro to read the data from Excel, open each project in turn, update the custom fields then save, publish and close the project.

    This would only take a day or two at most to produce a test version.

    If the process is weekly and you don't want to use VBA then you will have to use C# and CSOM to write to Project Server. This solution is likely to take a lot longer to get working as it requires many times more lines of code etc.

    The reporting db is read only so any and all changes are overwritten next time the project is published. There is no supported solution that writes directly to the database so you have to use CSOM, PSI, JSOM etc.


    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

    • Marked as answer by Kryptyque Friday, July 22, 2016 11:12 AM
    Friday, July 22, 2016 12:00 AM
    Moderator

All replies

  • Hi,

    Is this a once off process or likely to be regular? If it's a once off or rare process, then I would develop a Project VBA macro to read the data from Excel, open each project in turn, update the custom fields then save, publish and close the project.

    This would only take a day or two at most to produce a test version.

    If the process is weekly and you don't want to use VBA then you will have to use C# and CSOM to write to Project Server. This solution is likely to take a lot longer to get working as it requires many times more lines of code etc.

    The reporting db is read only so any and all changes are overwritten next time the project is published. There is no supported solution that writes directly to the database so you have to use CSOM, PSI, JSOM etc.


    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

    • Marked as answer by Kryptyque Friday, July 22, 2016 11:12 AM
    Friday, July 22, 2016 12:00 AM
    Moderator
  • Rod Gill,

    This is most likely not a one-time procedure, so I guess I will have to go with the latter option.. Ideally I would like this all to happen from Excel with a single button, but I suppose if need be it can be done in a Project macro.

    Thanks for the quick reply.

    Friday, July 22, 2016 11:12 AM