Notifications
Announcements
No record found.
I wrote some code in c# and it is called from Microsoft Dynamic Crm 2015 on my company server. I have a "Downlaod" button on a Crm form. When i press this button, it fires the code under the mvc project controller function which is in Crm server machine. It opena an Excel template in this server and gets info from Crm database. When it gives this form to the calling client user, it translates it to pdf and gives the pdf form to the client user. The code does not write anything to the excel file which is used as an template. My problem is when i enter to the server as crm admin using Rdp, the code executes perfectly and give the pdf to the client user. However , when i close the rdp , the code does not work. I looked to the dcomfig from the sevrer the everything is okey. How can i solve this problem. Can anyone help me please.
*This post is locked for comments
Hi,
Just to clarify. Do you have to download PDF file in the server or in the browser where user opened CRM form? and if you are not writing anything from excel template why use it? instead if you need to set some config values why can't you use a config custom entity and get the values?
Note: In case my answer helped you. Kindly mark it as verified.
Warm Regards,
Pavan Kumar Garlapati
Follow my Blog: https://pavankumargarlapati.wordpress.com
hjjjjj
How is your code initiated after the user clicks the button ? If Component Services (COM+) is used, then it may be that the user does not have launch and activate permissions on the component
After the user presses the "Download" button, the id of the form is sent to the mvc application controller function. Teh function opens the template, initalize the excel code and creates the pdf. The pdf then is given to the user who presses the "Download" button.
using Excel = Microsoft.Office.Interop.Excel;
Excel.Application MyApp = null; Excel.Workbook MyBook = null; Excel.Worksheet MySheet = null;
MyApp = new Excel.Application(); MyApp.Visible = false; MyBook = MyApp.Workbooks.Open(fileName); MySheet = ((Excel.Worksheet)MyBook.Sheets[1]);
ref MySheet, "AB:2", talep.Tarih.Date.ToString("dd/MM/yyyy")
.
MyBook.SaveAs(newTempFileName_ + ".xlsx");MyBook.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF, newTempFileName_ + ".pdf", Excel.XlFixedFormatQuality.xlQualityMinimum, true, true, Type.Missing, Type.Missing, false, Type.Missing);
. it goes like this
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2