Generate SSRS Report and save as PDF in SharePoint

Hi,
I am working on a SharePoint 2010 Visual WebPart that lets a user click a button to generata a SSRS report and save the report in a SharePoint Library as a PDF file.  Code is mentioned below:
try
string siteContext = SPContext.Current.Web.Url;
string strReport = siteContext + "/Reports/Quote/Quote.rdl";
WR_SSRS.ReportExecutionService rs = new WR_SSRS.ReportExecutionService();
rs.Url = siteContext + "/_vti_bin/ReportServer/ReportExecution2005.asmx";
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
byte[] result;
string format = "PDF";
string historyID = null;
string devInfo = "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
WR_SSRS.ParameterValue[] parameters = new WR_SSRS.ParameterValue[3];
parameters[0] = new WR_SSRS.ParameterValue();
parameters[0].Name = "EnqID";
parameters[0].Value = enqID.ToString();
parameters[1] = new WR_SSRS.ParameterValue();
parameters[1].Name = "QuotationID";
parameters[1].Value = quoteID;
WR_SSRS.DataSourceCredentials[] credentials = null;
string showHideToggle;
string encoding;
string mimeType;
WR_SSRS.Warning[] warnings;
WR_SSRS.ParameterValue[] reportHistoryParameters;
string[] streamIDs;
WR_SSRS.ExecutionInfo execInfo = new WR_SSRS.ExecutionInfo();
WR_SSRS.ExecutionHeader execHeader = new WR_SSRS.ExecutionHeader();
string SessionId = null;
string extension;
rs.ExecutionHeaderValue = execHeader;
execInfo = rs.LoadReport(strReport, historyID);
rs.SetExecutionParameters(parameters, "en-gb");
SessionId = rs.ExecutionHeaderValue.ExecutionID;
result = rs.Render(format, devInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
execInfo = rs.GetExecutionInfo();
using (SPSite site = new SPSite(SPContext.Current.Site.ID))
using (SPWeb web = site.OpenWeb())
web.AllowUnsafeUpdates = true;
SPFolder folder = web.Folders[siteContext + "/Quotes"];
string filename = string.Concat(quoteID, ".pdf");
//remove old copies
SPList lib = web.Lists["Quotes"];
foreach (SPListItem i in lib.GetItems())
if (i.Name == filename)
i.Delete();
break;
SPFile file = folder.Files.Add(filename, result);
SPListItem item = file.Item;
item["EnquiryID"] = enqID.ToString();
item["FinalQuote"] = "No";
item.Update();
web.AllowUnsafeUpdates = false;
catch (Exception ex)
LogError(ex.Message);
The WebPart works fine in my local server and even on another development testing server.  However, once deployed to the live server that has claims authentication it stops working and throws an error that says:
"Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. 
The request failed with the error message: 
<RSError xmlns="http://www.microsoft.com/sql/reportingservices"><MoreInformation><Message>An unknown error occurred with the Reporting Services endpoint on this SharePoint site. Contact the SharePoint site administrator for help.</Message></MoreInformation></RSError> 
If I open the report manually in SharePoint Site, it works fines it even works fine when try to view in a WebPart. 
Can someone help me with this ?
Regards, Vikram

Hi Vicky,
Based on the error message, it is related to the service account for reporting service.
If the Report Server service runs under a built-in account such as NetworkService, the Grant database access option in SharePoint Central Administration will not work correctly.
Configure the service account to run under a domain user account as follows:
1. Start the Reporting Services Configuration tool and connect to the report server.
2. On the Service Account page, click Use another account, enter a domain user account, and click Apply.
3. Click Web Service Identity, for Report Server, click New, type an application Restart the Report Server service.
Here is a detailed MSDN article for your reference:
http://msdn.microsoft.com/en-us/library/ms159704.aspx
Best Regards
Zhengyu Guo
TechNet Community Support

Similar Messages

  • Auto-Iterating a cell to generate multiple reports to save to PDF

    I'm using Numbers '09 to calculate interest and track payments for a personal loan.
    On one sheet, I have a table with the monthly starting balance, interest for the month, payments, etc. in columns. Each row then shows the values for each month.
    On another sheet, I have a statement report set up for me to send to the lender each month along with my payment so they can see the current status of the loan. This sheet has a table where I enter the month being reported into a key cell, and then the other cells use the VLOOKUP function to find that month's row on the first sheet's table and then pull specific monthly values into this table.
    This all works fine so far, but I would like to be able to automatically generate the statement reports for January through December for a particular year and save those as PDF (either separate files per month or as pages within one PDF files). Right now, to do this, I have to manually: 1) type in month and year into the key cell (the statement then updates with the date from that date.) 2) Print 3) save as PDF 4) change name 5) click save 6) repeat as many times as I have months
    is there some way to get Numbers to iterate a cell through specific range of months and either create a multi-page output that can then be printed to PDF or even better just save it directly to PDF?
    Thanks in advance.

    petersas07 wrote:
    Hello.
    Sorry to intrude,
    Hi Ashley,
    Welcome to Apple Discussions and the Numbers '09 forum.
    I'm sure that Jerry (and others) can (and will) help with your task. But as your task is not well described by the subject of this thread, it should not be posted in this thread.
    Rather than apologize for intruding, please re post your question as a New Topic. This link will take you to the Numbers '09 forum topic list. At the top left of that page, directly below the name of the forum, you'll find the New Topic link.
    Looking forward to seeing your question in a thread of its own.
    Regards,
    Barry

  • Create and save a .pdf file

    Afternoon!  I am creating a pdf utilizing the cfdocument tag and it works great.  It opens and displays well.  My question is, is there a way to automatically save that generated pdf on the server without opening it?  My end goal is to run a scheduled task every week that creates and saves a pdf automatically.

    <cfdocument format="pdf" orientation="landscape" filename="YourPDFName.pdf" overwrite="yes">
    it will save a copy of the pdf in the same folder as the <cfdocument> is run from, the problem I got is it wond display the pdf at creation time, all that is returned to my screen is the letter "z"
    so may be best to fun the code in a loop and one time add in the filename and overwrite paramaters, if you dont need it displayed, then your gold.
    Craig Wiseman

  • How to get custom file name in manually generated SSRS report

    Hi,
    I am creating a SSRS report which would be executed by User manually through ReportServer URL.User would be generating the SSRS report for different Customer ID based on ad-hoc basis.
    I am passing CustomerID as input parameter to the report. Is there any way to get the manually generated SSRS report name as 'Report_CustomerID_TodayDate.xls'. Please let me know.
    E.g.If User is generating report for Customer ID 123 today then report name should be 'Report_123_07092013.xls'
    Thanks for your help in advance.
    Thanks,
    Abhiyanta

    Hi Amar,
    If possible Can you please provide the custom code to rename the exported file in SSRS.
    Thanks in advance,
    Regards,
    Jagan

  • Is possible in acrobat reader fill in and save interactive PDF created with LiveCycle Designer?

    is possible in acrobat reader fill in and save interactive PDF created with LiveCycle Designer?

    Hi,
    Only if the form has been Reader Enabled before it is sent out to the user with Reader.
    There are two ways of Reader Enabling the form. One using Acrobat Standard v9 or Acrobat Professional v8 (both have license restrictions). The other is to use LC Reader Extensions ES2, which is a server product (additional costs).
    Some info here:
    http://www.assuredynamics.com/index.php/2010/11/using-livecycle-forms-in-acrobat-and-reade r/
    A search of the forums for "Reader Extensions" or "Reader Enable" will give more information.
    Hope that helps,
    Niall
    Assure Dynamics

  • Unable to digitally sign and save a PDF document

    I am currently using ADOBE ACROBAT 8.0 Professional (Ver 8.1.0).  I provide proofreading service for a client.  The client provides me with a PDF which I use the comment and mark up tool to indicate required changes.  Once all of the comments are complete, I mark the document approved or disapproved and attach a digital signature.
    Recently, many files that I have recieved from the client will not allow me to sign and save the PDF.  I can save the PDF without the signature but not when it is digitally signed.  The error reads:
    "The document could not be saved.   A number is out of range"
    I queried my client to find out if they have made any changes.  They have recently upgraded to Illustrator 4 and they create the PDF's for me from the Illustrator files they work from.  There are four teams using the same Illustrator program but not all of them are producing files that I cannot sign and save.
    Can anyone tell me what the error indicates?  Is there a property assigned to the document that I can not recognize that refers to this problem.
    Since the files I work on contain proprietary information, I prefer not to attach them to this forum.  If anyone is interested in helping, I will share a file to fully explain my problem.

    I will try that, thank you.
    Jim Dodge
    English Proofreading Coordinator
    ASIST Translation Services
    4891 Sawmill Road, Suite 200
    Columbus, OH 43235-7266
    www.ASISTtranslations.com
    Tel:  937-596-6649
    NOTICE: This electronic mail transmission is for the use of the named
    individual or entity to which it is directed and may contain information
    that is privileged or confidential. It is not to be transmitted to or
    received by anyone other than the named addressee (or a person authorized
    to deliver it to the named addressee). It is not to be copied or forwarded
    to any unauthorized persons. If you have received this electronic mail
    transmission in error, delete it from your system without copying or
    forwarding it, and notify the sender of the error by replying via email or
    by calling ASIST Translation Services, Inc. at (614) 451-6744, so that our
    address record can be corrected.

  • Is it possible to create and save a .PDF without any compression to the resulting .PDF?

    I need an uncompressed file so I can use the resulting PDF to do a find/replace. Can't do it with compression.
    Thanks
    JDRHC1115

    Dave,
    Thanks for the reply. Of all the suggestions I've received this seemed to
    be most promising. I gave it a try and the problem is that when I attempt
    to save as optimized a message box pops up and says I have to save my
    document first. Low and behold when I save it, compression occurs. Even
    when I select the options you suggest I'm left with a compressed document.
    I'm using Acrobat Pro X
    Jeff
    From:   Dave Merchant <[email protected]>
    To:     Jeff Ross <[email protected]>
    Date:   01/06/2011 09:35 AM
    Subject:        Is it possible to create and save a .PDF
    without any compression to the resulting .PDF?
    You don't want the UncompressPDF plugin - that's designed to split out the
    COS objects but doesn't remove the Flate encoding (plus if you've never
    compiled a plugin before, it's not really the time to learn).
    Instead, simply save your PDF file using the PDF (Optimized) file type,
    click the Settings button and under "Clean Up" - "Object compression
    options", choose "Remove compression". Turn everything else off if you
    want to retain the PDF content exactly as it was before.
    Your document-level scripts will then be in the file as plain text.

  • Will the 8600 scan and save as PDF legal size documents?

    Will the 8600 scan and save as PDF legal size documents?

    Hey there @jadoue , welcome to the forums!
    Yes, you can scan a PDF as legal size and save it. Check out the screen shot I posted below as an example of what you are looking for in the printer software that is installed on your computer.
    Let me know if you have any other questions!
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • I can't print an email and "save as pdf"

    Since the last system upgrade, which I believe is Yosemite 10.10.1, I have not been able to print emails and save them as a pdf file. I cannot save an attachment as a pdf file.  The problem is somewhat recent and has just happened after the last upgrade or possibly the one prior. The problem is only applicable to emails; I am able to save other documents as a pdf file; just not an email or an attachment.  This is on a MacBook Pro. Any suggestions?

    For some unknown reason, it is working this morning.  I shut down my computer overnight and this morning it is working. I re-booted 3 times yesterday with not result. Now I can save the attachment and print the email and save as pdf.  Gremlins I guess.  However, thank you for your concern and help on the issue.

  • Can we edit webi and deski reports and save the changes?

    Can we edit webi and deski reports and save the changed values for a particular column?
    If yes what rights should be granted to particular user?
    Will the report changes reflect at database end also?

    Both Web Intelligence and Desktop Intelligence comes with designers, where you have a GUI to design reports. 
    Web Intelligence you'd design in InfoView using the DHTML Report Panel or the applet-based Java Reporting Panel.
    Desktop Intelligence you'd use the Desktop Intelligence client.
    ReportEngine Java SDK (REBean) is what you'd use to programmatically create/modify Web Intelligence Documents.
    Desktop Intelligence Reporter COM SDK is what you'd use to programmatically create/modify Desktop Intelligence Documents.
    Sincerely,
    Ted Ueda

  • SSRS report does not rendering properly in sharePoint 2013

    Hi everyone,
    I'm a newbie with the MSBI development tool, I've tried to create a testing SSRS reports and its layout showed correct when preview them in Visual Studio (2010 and 2012). Then I migrated the report in SharePoint 2013, but the layout do not rendering as I
    expected, some data mix-up on the matrix table
    The Ident on detail data (drill down) does not render properly compare the layout in when preview in Chrome or Visual Studio (SSRS)
    The summation on second matrix table went wide on both browsers compare when preview thereport in Visual Studio
    The export PDF (using the "action" button on the report in the browsers) showed the second matrix table is overlaps the first matrix table.
    This report has 3 main queries (2 for the matrix tables and 1 for the chart) on a Dev environment:
    Window server 2008 R2 with service pack 2
    SQL server 2012 enteprise with service pack 2
    SharePoint 2013 (no service pack) with integrated mode on the report service 
    Visual Studio 2010 development tools
    I'm very appreciate for anyone can provide any solution to solve this issue.
    Thank you so much,
    Dac.
    P.S.: I attached the preview of the report in both browsers (IE & Chrome) and its preview in Visual Studio.
    An update: ... due to the setting space on"snap to grid" default to 20 and I've made the 2nd matrix table overlaps the 1st one, therefore the it showed overlaps when export to PDF file ... it's solved.
    But the Indent on IE and summation still persist in both browsers.

    Hi everyone,
    The PDF's export has been solved due to the 2nd matrix table overlaps on the 1st table. 
    Also, I don't know why the summation (aka Row Total) went wide when data represented on the 2nd matrix table (see previous post on the row named as "Premium over 5000$" on both browser. So I've redesigned the 2nd table as normal table instead of
    matrix table ... and the summation showed correct (it's so weird)
    For the "Indent" issue showed in IE on both drill down of the 1st table and 2nd table which cannot be fixed, and the end user used only IE.
    Could someone can enlighten me please?
    Many thanks.

  • Reporting and exporting to Excel in SharePoint Online

    Hi
    I've developed a SharePoint site to replace a legacy Access database that dealt with consumer complaints and queries. In the Access database I'd developed a feature that allowed users to filter the complaints by a number of criteria and export them to Excel
    and I'm trying to do the same in SharePoint.
    If it were on-premises SharePoint I'd just create a parameterised SSRS report which would solve all my problems. However being SharePoint online, this is not an option. I'd like the users to be able to select complaints from any date range, for any category
    of complaint and for any product supplier (plus a few other criteria). The idea is that they want to be able to then send the filtered data to individual suppliers. Doing this out of the box with views throws up several problems. The main one is that any export
    to Excel of a view exports the entire set of data, meaning that users themselves would need to create a new view for every export they wished to perform, which is not practical.
    My question is: what is the best way in SharePoint online to export a filtered subset of a list to Excel?
    I can use SharePoint designer, but not C# in order to achieve the goal. We also have SharePoint Online Plan 2 if that makes it easier.
    Thanks in advance,
    Duncan

    Hi Duncan,
    Well its easy to Reporting and exporting to Excel in SharePoint Online,
    See the Youtube link below and other links for more descriptions.
    Office 365: Synchronize Excel with SharePoint Online
    Reporting and exporting to Excel in SharePoint Online
    Thanks
    Indul Hassan (www.indulhassan.com)

  • In SharePoint 2013, some of the userswith contribute or full control rights are not able to edit and save office doucuments to SharePoint library.

    In SharePoint 2013, Office 2010 and IE 8. Office web apps is not configured.
    Some users with Contribute or full control are not able to edit and save documents back to SharePoint library.
    When they try to save they are getting following error:
    1. https://.....pptx is read-only. Do you want to save changes to a different file name?
    2. Project canot access "https://...." 
       Try one of the following
    The file may be temporarily open by another program. wait a momoment and try again.
    A file with the same name may already exists. Save it with a different file name.
    You may be trying to save to a read only folder. Save to a different folder instead.
    Please help me with this issue.
    will be waiting for any suggestions or solutions.
    Thanks
    Krish
    99

    Thanks again for quick response.
    I have requested users who are having this issue to try check in/ check out, and share the results.
    Result with CheckIn/CheckOut:
    User was able to check out but no edit option.
    'Edit Document' option under 'Files' tab was greyed out. I did check permissions every thing seems fine he has full control over the site and document library.
    Please advise.
    Thanks
    Krish
    99

  • Generate pdf file from 9i reports and save it in C:\oracle_reports\

    i want to generate a file from oracle reports in PDF format and want to save it on already defined path.
    c:\oracle_reports\
    right now pdf generation of report is working fine but before generation of pdf report system prompt me or open a dialogue box to save my pdf file on drive. i dont want to see these dialogue box or prompt me to explicitly save it.
    i want all the work done automatically.
    regards
    ------------ source code--------------
    PROCEDURE PRINT_PROC IS
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    pl_id ParamList;
    report_path varchar2(100);
    aud_sno varchar2(1000);
    aud_type varchar2(500);
    BEGIN
         pl_id := Get_Parameter_List('report_data');
         IF NOT Id_Null(pl_id) THEN
              Destroy_Parameter_List( pl_id );
         END IF;
         pl_id := Create_Parameter_List('report_data');
         User parameters : Customize these to fit your report
         report_path := :GLOBAL.Web_BASE_PATH||:GLOBAL.PATH_SCM||'REPORT\scm_rfq.rep';
    -- Initialize your report parameters here
         Add_Parameter(pl_id, 'p_cmp_code'                     , TEXT_PARAMETER, :global.company_code);
         Add_Parameter(pl_id, 'p_rfq_sno'                     , TEXT_PARAMETER, :document_sno);
         Add_Parameter(pl_id, 'P_PATH'                               , TEXT_PARAMETER, REPORT_PATH);
    Standard parameters: Don't change
         Add_Parameter(pl_id, 'PARAMFORM' , TEXT_PARAMETER, 'NO');
         Add_Parameter(pl_id, 'PAGESTREAM' , TEXT_PARAMETER, 'NO');
         Add_Parameter(pl_id, 'MAXIMIZE' , TEXT_PARAMETER, 'YES');
         -- end standard parameters
         repid := find_report_object('REPORT_OBJ');
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_oas');
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_FILENAME,report_path);
    -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'htmlcss');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'pdf');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESNAME,'\\ORCLSRV\UTL_MAIL\'||:doc_type||:receiver_sno||'.pdf');
         v_rep := RUN_REPORT_OBJECT(repid,pl_id);
         rep_status := REPORT_OBJECT_STATUS(v_rep);
         WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
         LOOP
         rep_status := report_object_status(v_rep);
         END LOOP;
    END;

    If you use rwclient you could that easily, from a Form, it requires additional steps.
    Look at this thread Re: save report

  • User Generated Reports and Save.

    Hi,
    I have the following queries (using ApEx 3.0.1):
    1) Is it possible to create a page by where the user can dynamically create there own reports based on a selection of tables they can choose from, together with columns and where conditions, similar to "Query Builder" ?
    - are there any how-tos or sample apps that could assist with this?
    2) Based on the above, would it be possible to actually save this query to be used again in the future within the application?
    Basically want the user to be able to create there own queries/reports and allow them to save the reports for future runs.
    Thanks.
    Tony.

    <quote>If you want to create something yourself like the query builder, you can look how the APEX development team did the query builder and copy that ;-)
    Hope that helps,
    Dimitri
    </quote>
    Dimitri or anyone else,
    I am looking for a query builder that an Ap-Ex user (not developer) can utilize. How can I look at what you are describing above?
    Thanks!
    Bryan
    Message was edited by:
    BryanG
    Message was edited by: BryanG
    BryanG

Maybe you are looking for

  • How do I remove an obsolete e-mail address of a friend (not a whole account)

    People change their provider and get a new e-mail address. From some people I have 3 addresses but 2 are obsolete. I can't remember which ones. So I want to remove the old addresses, not a whole e-mail account. If I send a new e-mail to a friend and

  • How to extract data from .xltm file in a (dataset, datatable or a list) using wpf c#

    Hi all, As we can get data from .xls, .xlsx file in a dataset. Now i want to read all the entire data from .xltm file. I also want to get all sheets name from .xltm file. I am using .Net framework 4.5, Visual studio 2012. Please help me. I am unable

  • Messages in Scheduled Status

    Hi all, We have many messages in Sceduled category on the production system. The Status symbol is not as it is for a scheduled message. It reads as "Log version". Please let me know how to clear these kind of messages from SXMB_MONI. Thank you

  • Usb 2 connection to laserjet 1100 possible?

    want to use hp laserjet 1100 with laptop but can't find usb cable with connector that will fit laserjet's line in connector.

  • [Guide] How To Clear the Play Queue

    QuestionHow do I clear the play queue? AnswerPlease note this is an unofficial workaround and not an official solution.  1 - Click New Playlist. 2 - Add only one song to the Playlist. 3 - Whenever you want to clear the Play Queue double click it. Onc