Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1017193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:39:58+00:00 2026-05-16T10:39:58+00:00

I have a report that shows all errors (if there are any) from a

  • 0

I have a report that shows all errors (if there are any) from a process that runs every day.
At the end of the process, I want to write some code to execute the report and email it. I am seeing how to email a report from code, but I can’t seem to find anywhere that shows how to run the report from code.
I am using C# in vs 08, and the report is from ssrs 08. Any assistance would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:39:59+00:00Added an answer on May 16, 2026 at 10:39 am

    I ended up creating a new subscription to the report which creates a job.
    I ran the job from code that executes the job(Taken from Microsoft)

    Like this:

    SqlConnection jobConnection;
            SqlCommand jobCommand;
            SqlParameter jobReturnValue;
            SqlParameter jobParameter;
            int jobResult;
    
            jobConnection = new SqlConnection("myconnectionstring");
            jobCommand = new SqlCommand("sp_start_job", jobConnection);
            jobCommand.CommandType = System.Data.CommandType.StoredProcedure;
    
            jobReturnValue = new SqlParameter("@RETURN_VALUE", SqlDbType.Int);
            jobReturnValue.Direction = ParameterDirection.ReturnValue;
            jobCommand.Parameters.Add(jobReturnValue);
    
            jobParameter = new SqlParameter("@job_name", SqlDbType.VarChar);
            jobParameter.Direction = ParameterDirection.Input;
            jobCommand.Parameters.Add(jobParameter);
            jobParameter.Value = "name of the subscription job";
            jobConnection.Open();
            jobCommand.ExecuteNonQuery();
            jobResult = (Int32)jobCommand.Parameters["@RETURN_VALUE"].Value;
            jobConnection.Close();
    
            switch (jobResult)
            {
                case 0:
                    Console.WriteLine("SQL Server Agent job, RunSISSPackage, started successfully.");
                    break;
                default:
                    Console.WriteLine("SQL Server Agent job, RunSISSPackage, failed to start.");
                    break;
            }
            Console.Read();
    

    By calling the job- which is a subscription – the report was rendered and emailed to the subscription recipients.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a report that is getting info from bsis, bsas, bsid, bsad, vbrk,
I have a report that I run from a system once a week, and
The Particulars: I have a report that displays information about invoices. There is a
At work, we have a report that is generated with IP's in it. There
I have a report that is basically a form with multiple empty fields and
I have a report that I'm exporting to PDF using the VS2008 version of
I have a report that is returning a one data field to a tablix
I have a report that I created in SQL Server Reporting Services 2008. I
i have a report that i have been sending a parameter to which worked
I'm trying to trap any and all exceptions in a C++/CLI app so that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.