web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Code runs when admin user logged on the Server with Rdp

(0) ShareShare
ReportReport
Posted on by 262

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

I have the same question (0)
  • PavanKumarGarlapati Profile Picture
    100 on at

    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

  • altun8tr Profile Picture
    262 on at

    hjjjjj

  • David Jennaway Profile Picture
    14,065 on at

    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

  • altun8tr Profile Picture
    262 on at

    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

  • altun8tr Profile Picture
    262 on at
    Is there a way to make the interactive user always on on rdp to the server? Can we do a trick to deceive the server that someone is connected with rdp. I think this solves my problem 

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans