none
[Event Handler] Connect Database Reporting RRS feed

  • Question

  • Hi everyone,

    I am a new developer on SharePoint server 2010 (Project Server 2010).

    I want to deploy the event handler and compile the assembly.

    I want to connect Database Reporting to update something when I publishing the Project.

    Now, I set hard code Connection string.

    Dose SharePoint support get connection string of Reporting database (Project Server)?

    My code:

    publicoverridevoid OnPublishing(PSContextInfo contextInfo, ProjectPrePublishEventArgs e) { base.OnPublishing(contextInfo, e); // [HERE]. I want to connect Database Reporting to update something when I publishing the Project.

    }

    I hope to see your help soon.

    Thanks and Regards,

    An Pham

    Monday, September 10, 2012 11:11 AM

All replies

  • Hi An--

    Direct access to content database using SQL/ODBC is not supported. You will need to use the SP object model to for CRUD operations. Could you please let us know what exactly you are trying to do in the content database, We can convert this using SP obejct model.

    Thanks,


    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”. Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82

    Monday, September 10, 2012 11:16 AM
  • Hello An, there is a sync job that automatically updates the reporting database for project server whenever a project is published/saved. The projects custom fields, assignments etc. are updated. Certain tables like the assignment by day and other 'by day' tables are done once a day as this is a big chunk of work the system does not want to update every publish (see additional server settings for when to specify to run. usually in the AM).

    You can see the reporting publish sync update if you publish a project and go to the queue quickly (if it completed add the state of success to the queue view options to see jobs successfully completed.)

    If this is not enough for you, if you have a custom table in this database, then to get a connection string generated for you launch report builder or some such tool, and get the data connection wizard going for you to create a data connection. Then in report builder look at the data connection string and copy/build on it.

    Hope this helps but please give a check and I'll think you find all the core information for a project is already being updated.

    cheers


    Ray Letts Arbutus Solutions


    • Edited by Ray Letts Monday, September 10, 2012 4:23 PM
    Monday, September 10, 2012 4:23 PM
  • Amit,

    Actually it is not true - exactly RDB is the only database which can be officially changed

    Report Data Service optimizations for custom fields



    Sergey Vdovin

    Monday, September 10, 2012 10:24 PM
  • Hi all,

    Thanks your quick reply.

    I want to use code get Connection String (Database name, Server name,...)

    Dose SharePoint support that?

    Tuesday, September 11, 2012 4:51 AM
  • Hi Sergey--

    I misunderstood the connect Database Reporting to Contnet database. Sorry about that.
    Yes, We can create objects in reporting database & update based on the logic.

    Hi An-- You can use the connection string in your sharepoint project.

    Thanks,


    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”. Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82

    Tuesday, September 11, 2012 5:14 AM
  • Hi Amit,

    ^^

    Would you mind to show me example...

    Tuesday, September 11, 2012 6:48 AM
  • Hi An--

    here is a sample:

    SqlConnection conn = new SqlConnection(
            "Data Source=Dataabaseserver\SQlserverInstance;Initial Catalog=ProjectServer_Reporting;Integrated Security=True");

    You can replace the dataabaseserver\SQlserverInstance & projectserver_reporting as per your project server  Configuration.

    Hope that helps.


    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”. Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82

    Tuesday, September 11, 2012 7:17 AM
  • Hi Amit,

    That is great.

    But I want to set the dataabaseserver\SQlserverInstance & projectserver_reporting as dynamic. so I wish SharePoint support to do that?

    Is it possible?

    Tuesday, September 11, 2012 8:03 AM
  • Hi,

    It usually happens in the Server, why not save the connection string in notepad and read the notepad and use the connection string and save the notepad with password protection.


    Thanks, Parth

    Tuesday, September 11, 2012 8:07 AM
  • Hi Amit,

    That is great.

    But I want to set the dataabaseserver\SQlserverInstance & projectserver_reporting as dynamic. so I wish SharePoint support to do that?

    Is it possible?

    Thanks, Definitely, You can get this in many ways. Like you can create a List on PWA as COnfigStore & store the database name & connection string while using the SQL connection, read it from sharepoint list. You can aslo use powershell to get the SPProjectWebInstance.
    http://technet.microsoft.com/en-us/library/ff607531.aspx

    Hope that helps.


    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”. Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82

    Tuesday, September 11, 2012 9:26 AM
  • Hi Amit,

    but is it not risky to store connection string on the sharepoint site , instead storing in notepad on the server is a good idea i guess.


    Thanks, Parth

    Tuesday, September 11, 2012 11:02 AM
  • Hi Amit,

    I try do...

    If any problem, I wish you will help me ^^

    Tuesday, September 11, 2012 11:29 AM
  • Hi Parth,

    We always create a secured config store & have the permission only to administrators to the list. Yes, You can always store it in notepad on filesystem of server. If I use it on Sharepoint list, I get advantage of versioning/auditing. I prefer in that way , also it reduces the effort from Server admins to update the notepad if required. Admin can change the values if necessary.

    Hope that helps.


    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”. Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82

    Tuesday, September 11, 2012 11:34 AM