4
Answers

Azure App Service Plan and Resource Group Planning

We are migrating all our 25 portals to Azure. All these portals point to a single database. These websites are associated with 25 different companies who are customers of our client.

We have planning to have the structure something like this. (1) Create 25 Resource Groups (2) Create 25 App Service Plans (3) Create 25 App service - Web apps

My Questions:

  1. Is it suggested to have both the web apps and the database (SQL Database) in the Same Resource Group?
  2. We would like to leverage the auto-Scale-Out feature separately for each of our portals and so we planned to have a separate App Service Plan. Is that good?

Thanks,

Prawin
Answers (4)
0
SriHari VP

SriHari VP

NA 163 3.1k 7y
You will need to get reference to the active sheet and set a name to it.
 
Microsoft.Office.Interop.Excel.Workbook workBook;
Microsoft.Office.Interop.Excel.Worksheet workSheet;
 
workBook = XcelApp.Application.Workbooks.Add(Type.Missing);
workSheet = (Microsoft.Office.Interop.Excel.Worksheet) workBook.ActiveSheet;
workSheet.Name = "Sams Report";
0
Leon D

Leon D

NA 479 51 7y
I'd suggest you use a free third party library free Spire.XLS to export data to excel, it's easy and doesn't rely on Excel. You can get free Spire.XLS dll from NuGet Package Manager and refer to the following code:
  1. DataTable dt = dataGridView1.DataSource as DataTable;  
  2. Workbook workbook = new Workbook();  
  3. Worksheet sheet = workbook.Worksheets[0];  
  4. sheet.Name = "Sams Report";  
  5. sheet.InsertDataTable(dt, true, 1, 1);  
  6. workbook.SaveToFile("Report.xlsx", ExcelVersion.Version2013);  
0
Amit Gupta

Amit Gupta

NA 16.5k 25.7k 7y
Then you have to set the title of the excel application, this will gives you the expected filename when saving
0
james james

james james

NA 175 2.9k 7y
I spoke wrong this is what i need to do without having to save the file.
 
The below code when exporting to excel gives the Book name Book1. How can i edit it to export the Book name as "Sams Report"?
0
Amit Gupta

Amit Gupta

NA 16.5k 25.7k 7y
You can write above the for loop
0
james james

james james

NA 175 2.9k 7y
Amit
 
where do I place that in my code or what do I replace?
getting build error.
 
Thanks 
0
Amit Gupta

Amit Gupta

NA 16.5k 25.7k 7y
  1. Microsoft.Office.Interop.Excel.Worksheet worksheet = (Worksheet)xlApp.Worksheets["Sheet1"];  
  2.   worksheet.Name = “NewTabName”