Can SSRS automatically send a file to a sharepoint site on a daily basis?

Sadowski, Craig 1 Reputation point
2021-06-10T14:35:24.49+00:00

Currently, I can get SSRS to generate a file with data to a fileshare but cannot figure out how to put it in sharepoint instead.

Can SSRS automatically send a file to a sharepoint site on a daily basis?

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,061 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 41,491 Reputation points
    2021-06-11T02:58:08.513+00:00

    Hi @Sadowski, Craig ,

    As I know there is no feature available to upload the file directly to sharepoint site.

    One possible methods is to subscription SSRS report and save to shared folder. file-share-delivery-in-reporting-services .

    You may save the file to a new created local file. Then sync it to one drive folder or upload it along with some powershell script to do the automation.

    Check this blog which shows how to do the file upload automatically : SharePoint Online Automation - O365 - Upload Your Files Remotely Using PowerShell To SPO Document Library

    Regards,

    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues October


  2. Richard 1 Reputation point
    2021-06-22T21:02:48.967+00:00

    We wrote and scheduled a console app to create a csv file and then upload it to SharePoint using the following code:

    //Set up variables
    string[] destinationUrl = { "https://myclouldurl.sharepoint.com/sites/po/services/LKP/Enviro/Weekly/" + fileName };
    CopyWebService.CopyResult cResult1 = new CopyWebService.CopyResult();
    CopyWebService.CopyResult cResult2 = new CopyWebService.CopyResult();
    CopyWebService.CopyResult[] cResultArray = { cResult1, cResult2 };
    CopyWebService.FieldInformation fFiledInfo = new CopyWebService.FieldInformation();
    CopyWebService.FieldInformation[] fFiledInfoArray = { fFiledInfo };
    //Reading the document contents in to stream
    FileStream strm = new FileStream(sourceUrl, FileMode.Open, FileAccess.Read);
    byte[] fileContents = new Byte[strm.Length];
    byte[] r = new Byte[strm.Length];
    int ia = strm.Read(fileContents, 0, Convert.ToInt32(strm.Length));
    strm.Close();

    //Copy the document from SourceUrl to destinationUrl with metadatas
    uint copyresult = copyService.CopyIntoItems(sourceUrl, destinationUrl, fFiledInfoArray, fileContents, out cResultArray);

    if (copyresult == 0)
    Console.WriteLine("Document uploaded successfully from " + sourceUrl + " to " + destinationUrl[0]);
    else
    Console.WriteLine("Document gets failed on uploading..");

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.