Workbook is not getting saved in PDF format on website directory

I have an Excel workbook, which I am trying to save in Pdf file format on website directory at azure, and after creating pdf uploading it on azure blob storage. The code is working fine on local but on web server it is not uploading pdf on storage,
Code Ex:
//Save the document in html format
                workbook.Save(excelFile);
                string fileName = System.IO.Path.GetRandomFileName();
                string realPath = Server.MapPath("~/Content/");
                string pdfFile = realPath + fileName + ".Pdf";
                workbook.Save(pdfFile, SaveFormat.Pdf);
Below code I am using to upload PDf file on Storage:
private string UploadPdfFileToStorage(string filePath, string fileName)
            //Console.WriteLine("Second:=>" + filePath);
            // Retrieve storage account from connection string.
            var storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
            // Create the blob client.
            CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
            // Retrieve a reference to a container. 
            CloudBlobContainer container = blobClient.GetContainerReference("reporthtmlfiles");
            // Create the container if it doesn't already exist.
            container.CreateIfNotExists();
            //Permit container for public acces
            container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Container });
            fileName = fileName + ".pdf";
            CloudBlockBlob blockBlob = container.GetBlockBlobReference(fileName);
            blockBlob.Properties.ContentType = "application/pdf";
            byte[] file = System.IO.File.ReadAllBytes(filePath);
            MemoryStream objMemoryStream = new MemoryStream(file);
            objMemoryStream.Seek(0, SeekOrigin.Begin);
            blockBlob.UploadFromStream(objMemoryStream);
            objMemoryStream.Close();
            return blockBlob.Uri.AbsoluteUri;
Please help, thanks in advance

Hi,
Based on your description, your pdf file is saved to server side, so if you try above code on your local, you could read the file, but, if host your application to azure, you need to get the file stream first, then upload from the stream. Please set
the breakpoint at: "byte[] file = System.IO.File.ReadAllBytes(filePath);" check this file variable.
Best Regards,
Jambor
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Inbound Idoc - Date fields not getting saved

    Hello,
    I have created inbound idoc scenario in SAP. I receive Idoc from non SAP system to SAP system.
    then data from IDoc is saved into different tables, for that I have written one function module (attached to process code)
    One of the segments in IDoc type has date as a field. It is of type sy-datum.
    When I receive Idoc in SAP only date fields are not getting saved in tables.
    Is anything specific need to be done for date fields? please advice.

    check which format you are getting into sap and make sure you are coverting in into required format.

  • Workbook broadcast ouput should be in PDF format

    Hi,
    Workbook broadcast output should be in PDF format ,I could not find any option in broadcast setting in BI 7.0.the users requested that they want the report in PDF format.
    Please let me know how can I achieve this.
    thanks
    Pallavi

    Hi,
      I am not sure whether this is possible? Can you check in RSRD_OUTFORM_OT table whether PDF option is available for workbook(WB)? Anyway if there is only one sheet in workbook you can broadcast the query itself.
    Regards,
    Raghavendra.

  • While Creation Of SaleOrder Char Values are not getting saved.(V C)

    Hi SAP gurus,
    One of my client can able to create a saleorder but when we go and see in VA03 Display mode,we found Charactrestic values getting miised out.What could be the probale reasons.
    Note: I Have stimulate the required combination as per my client requirement in CU50,here i can able to indentify the Green Sign,but While Creation Of SaleOrder Char Values are not getting saved.
    Awaiting for your valuable reply.
    Cheers,
    Kumar.S

    Kumar ,
    If you assign values in classification view or configuration profile  they will become default for the product, and it willnot be changed in sales order.
    another thing if the item category is incorrect you will not get the configuration pop up at all .
    problem what i understand from your thred is at the time of sales ordeer creation there is some inconsistances in the configuration , may be some condition is not fullfilling.
    If in CU50 the result shown are error free, same configuration should owrk properly in sales configuration process, please again try to create it in sales order with same value assignment also check all the messages.
    see the result of configuration before saving the sales order , i hoep it will work for you.
    I am assuming all the things from SD are properly configured ie item catageory, varient pricing etc.
    Check and revert back.
    Regards
    Ritesh

  • MessageRadioButton Value is not getting saved

    Hi All,
    I am facing an issue with Radio Button data.
    When the page loads all the "No" buttons will be selected by default.When I select "Yes" radio buttton and click on "Save", all the radio buttons will get reset to "No" and same value will get passed further. Value of "Yes" button will not get saved.
    Please help me in resolving this issue.
    Thanks,
    Akshata

    Give it a shot by trying this. Hope this helps you.
    OAMessageRadioButtonBean personButton =(OAMessageRadioButtonBean)webBean.findChildRecursive("Person");
    personButton.setName("partyTypeGroup");
    personButton.setValue("PERSON");
    personButton.setSelected(true);
    OAMessageRadioButtonBean orgButton = (OAMessageRadioButtonBean)webBean.findChildRecursive("Org");
    orgButton.setName("partyTypeGroup");
    orgButton.setValue("ORGANIZATION");
    To retrieve the value of the Radio button, which is selected use the below
    System.out.println("Radio Button Value : "+ pageContext.getParameter("partyTypeGroup"));
    Also, if on click of button, you should once again set the radio button by calling setSelected() to retain the same look n feel, else, the selection wud jump to the other radio button.
    Basically, developer guide says, that you cannot assign the group name or checked/unchecked value to the Radio button declaratively). For more information read
    Radio Group / Buttons in Developer guide.
    Thanks
    Saurabh
    Edited by: SaurabhAg on Mar 22, 2012 12:58 AM

  • Output type not getting saved in the PO

    Hello Team
    we are facing one issue where output type is not getting saved in the PO.
    we give one output type and than save it , after going back to the PO we see that it is not there.and no output issued
    the PO is released properly and there is no issue , any idea what could be the reason for it

    Hi,
    Check in SU3 t.code, did check box selected u201CDelete After Outputu201D in Spool Control segment in Default TAB
    Also check Partner Function VN maintained in Default values TAB in NACR--- > EF Application for your output type
    Cross check partners {VN, PI, GS) are assigned to your PO output type in Partner Roles per Message Type
    Regards,
    Biju K

  • Added new fields in vendor master in xk01 but data is not getting saved

    Hi experts,
    To add new fields in vendor master i have followed the following steps :
    1.) Appended a structure ZRTGS in LFA1 table with required fields and activated
    2.) Added new button in xk01( vendor master ) using spro -> logistics-general -> business partner -> vendors ->
    control ->adoption of customer's owaster data fields -> prepare modification free-enhancement of vendor master record
    Created a screen group ZR and defined label tab pages with function code ZRTGS and saved entries
    3.) Created a implementation for BADIs VENDOR_ADD_DATA and VENDOR_ADD_DATA_CS.
    4.) Created a program with my own subscreen for the required fields
    The button is getting displayed in XK01, XK02 and XK03 respectively. Whenever the button is clicked the subscreen with
    the fields is also displayed. But whenever i try to save the data in either XK01 or XK02 it is not getting saved in to the
    database table LFA1.
    Request your help in this regard.
    Thanks in Advance.

    Hi,
    You may need to check this include .
    EXIT_SAPMM06E_008  -->Import Data from Customer Subscreen for Purchasing Document
    Thanks,
    vamshi

  • File not getting Saved on Application Server

    Hello All,
    We created a file in "Automatic Payment Transactions (F110 Transaction)" and are able to save the text file on Local drive. But for our e-banking requirement we need to store this file on our application server. The configuration settings in OBPM4 are already done and now system is picking the default application server path while saving file in "Payment Medium - > DME Administration" transaction. The problem is - although the system is picking the required path of application server but file is not getting saved. The error coming is: File <path> could not be opened (Message Number: FZ231).
    We have checked for 777 authorisations (OS authorisations) for the folder.
    Please suggest that what can be done to resolve th issue.
    Regards,

    What exactly we need to check in Payment program? We are not able to save the file on application server. There is no problem while saving the same in local drive.
    Regards,

  • Billing document not getting saved

    Hi Gurus,
            I am facing a problem with th billing doument. When I try to save the Billing through VF01, it is going to the screen and showing the line items in it. And when we save, it is generating a billing document number.But it is not getting saved.And when go and see in VF02
    it is showing a message <b>Express document "Update was terminated" received from Author----
    "</b>.
    How to resolve this.PLS help me out in this.
    Thanks in Advance
    Regards
    VASU

    Hi Vasu
    Check whether number range assignment has done.  Most probably, you would not have done that.
    Incidentally, I had also faced similar problem sometime back and after lot of study, I could come to a conclusion that it is because of non assignment of number range.
    Thanks and dont forget to reward if this helps you.
    G. Lakshmipathi

  • Workflow message modifications not getting saved into database

    Hello Friends,
    I am working on iProcurement module (11i) and have a requirement to remove the 'View' & 'Edit' links which appear in notification/Emails in Requisition Approval Workflow.
    I found a metalink note "How to Remove Related Application Links From Approval Notifications for AME [ID 1100805.1]" for the same.
    We have to delete some attributes from the workflow message to remove the links but the same is not getting saved in database.
    I am uploading the wft file through Workflow Definition Loader program with the 'force' option. And to check the changes , i am again downloading the file but i could not see the changes.
    Can't attributes be deleted from the message?
    Any suggestions ?
    Thanks...
    Regards,
    Amit

    Hi Hussein,
    Thanks.
    Here are the details :
    RDBMS : 11.2.0.2.0
    Oracle Applications : 11.5.10.2
    OS : Windows XP
    Log :
    Concurrent request completed successfully
    Current system time is 01-DEC-2011 08:29:12
    Oracle Workflow Definition Loader 2.6.4.0.
    Access level: 20, Mode: FORCE
    Uploaded 3 ITEM_TYPE record(s) to database.
    Uploaded 55 LOOKUP_TYPE record(s) to database.
    Uploaded 32 MESSAGE record(s) to database.
    Uploaded 182 ACTIVITY record(s) to database.
    Uploaded 0 ROLE record(s) to database.
    Regards,
    Amit

  • Document type created not getting saved

    Hi all,
    In DC10 I created document type and saved but its not getting saved?
    I gave document type as CD and description as COREL DRAW and tried to save it, but its not getting saved and asking to fill the required fields so I filled
    Version no. Inc as   1
    class Type  as      017
    and class  as     cl0001
    and in Field selection:
    Class data as display
    document status as *Display and then tried to save but the save option is in hide mode.
    what is a characteristic and why do we require and how to give the naming convention or numbering to it?
    Because I cant see the previously created chars?
    Please answer
    Thx

    Thanks Aby for answering
    how to name the class and class type ?
    I can see the class types but not class, is it a number or any other name ?
    How to create character and what is the naming convention?
    if I created a class and class type and character for a document type in DC10 then will they be shown in display screen CV03N?
    Thx

  • Load remote images in html mail setting does not get saved. I have to turn it off every time I log in. Is this a bug?

    Load remote images in html mail setting does not get saved. I have to turn it off every time I log in. Is this a bug?

    Plug your phone into the wall charger for at least 30 minutes...make sure you have a sim card in the phone...then:
    Leave the USB cable connected to your computer, but NOT your phone, iTunes running, press & hold the home button while connecting the USB cable to your dock connector, continue holding the home button until you see “Connect to iTunes” on the screen. You may now release the home button. iTunes should now display that it has detected your phone in recovery mode, if not quit and reopen iTunes. If you still don’t see the recovery message repeat these steps again. iTunes will give you the option to restore from a backup or set up as new.
    Make sure you have no anti-virus software running or any firewalls...turn all of that stuff off.

  • Adobe form - Text field not getting saved.

    Hi All,
    We created an application in which user will enter the data and submit it . The details entered in the screen will be saved in the Ztable.
    Our problem is when the user enters the data in the TextField UI of the adobe form it is not getting saved in the table. In development its working fine.
    In production for few users it is getting saved and for few users it is not getting saved.
    We are not able to find out the root cause of the problem.
    Any help will be appreciated
    Best Wishes
    Idhaya R

    Hi Idhaya,
    As you said it is working for few users,
    Then you need to check Adobe reader installed for users who are having problem.
    Hope it helps.
    Regards,
    Arun

  • Bom item data - Document assignment not getting saved in table STPO

    Dear All,
                  As per out customer requirement, they want to display assigned drawing documents of Bom items in CS11. But it is not reflecting in cs11 eventhough we have assigned documents in Bom item detail overview Document assignment tab page. Moreover this is not getting saved in table STPO.
                   Waiting for solutions
    Thanks & Regards
    Dhananjay Kulkarni

    Please understand my customers requirement,
                               Presently they are assigning drawing document of each mat in material master. And if they want to see the drawing of each component of bom through Bom maintenance then they double click on component in bom, goes to mat master then additional data then document data and then drawing. In this way they need to open minimim 5 windows, which they want to make minimum 2 windows.
              In bom they are having more than 300 components. This is not possible to define document as component with item category D of so many components. One more idea I given to them is to club all drawings in one document and define that document as component with item category D, but in this way they can't identify  the individual drawing with part name.
              One more idea I given to them is to assign drawing document of individual component in item overview - Document assignment tab page from where they can open the drawing but it needs to open minimum 3 windows. So they are ready to assign drawing document in item overview - Document assignment tab page but they want, it should reflect in CS11 document column, from where they can easily open the drawing document.
              One more thing I observed that, assigned document to item overview - Document assignment tab page is not getting saved in Table STPO. I can't see this field content in STPO, which may be the reason that it is not reflecting in CS11.
             Is anything missing from Document management system?
    Please think and reply friends it's Urgent.
    Thanks & Warm Regards
    Dhananjay Kulkarni

  • Changes in Texts in custom editor not getting saved in QM02 tcode

    Hi Expert,
    I am working on a screen exit in QM01. I have created a editor box(like the description box under Description tab in QM01) using class cl_gui_custom_container and cl_gui_textedit. I am able to create and display the text I type in the box alongwith other standard changes but if I try to change and save the text only in the custom text box, it is not getting saved. I debugged and found out that the standard does not recognize any change in the custom controller box.
    Please suggest.
    Thanks in advance,
    Sangeeta.

    Hi Sangeeta,
    After doing changes which method are you using to capture the text in the text editor ?
    There is a method GET_TEXT_AS_R3TABLE in class CL_GUI_TEXTEDIT . in that pass 'X' to ONLY_WHEN_MODIFIED parameter,
    Hope these may resolve your issue.
    Regards,
    Kumar M.

Maybe you are looking for