This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Set-WebPart($fileName, $webPart, $ZoneId, $ZoneIndex, $listName, $isRootWeb) { | |
| $web = Get-PnPWeb -Includes "ParentWeb" | |
| #Destination page where the web part will be added | |
| $serverRelativePageUrl = $web.ServerRelativeUrl + "/SitePages/" + $fileName | |
| #Location for all web part XML-files | |
| $directory = Get-Location | |
| #web part file path | |
| $file = $directory.Path + "\" + $webPart | |
| #create new web part file path for updating information | |
| $newFile = $file.Replace(".xml", "_new.xml") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Apply-PnPProvisioningTemplate -Path $rootsiteTemplateFileName -ClearNavigation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Connect-PnPOnline -Url $siteUrl -CurrentCredentials | |
| Apply-PnPProvisioningTemplate -Path $rootsiteTemplateFileName -ClearNavigation | |
| Set-WebPart -fileName $startPageFileName -webPart "webpart_Start.aspx_1.xml" -ZoneId "Header" -ZoneIndex 0 | |
| Set-WebPart -fileName $startPageFileName -webPart "webpart_Start.aspx_2.xml" -ZoneId "Header" -ZoneIndex 1 | |
| Set-WebPart -fileName $startPageFileName -webPart "webpart_Start.aspx_3.xml" -ZoneId "Header" -ZoneIndex 2 | |
| Set-WebPart -fileName $myTaskPageFileName -webPart "webpart_MyTasks.aspx_2.xml" -ZoneId "MiddleColumn" -ZoneIndex 0 | |
| Set-WebPart -fileName $myTaskPageFileName -webPart "webpart_MyTasks.aspx_3.xml" -ZoneId "LeftColumn" -ZoneIndex 0 | |
| Disconnect-PnPOnline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string directoryReportFile = "D:\upload\Reports\DailyReport.rdl"; | |
| string reportFileName = Path.GetFileName(datasetFile); | |
| string reportFullUrl = string.Concat("http://sharepoint/dashboard/Reports/", reportFileName) | |
| SPList reportLibrary = <Reports>; | |
| //First upload all report files | |
| using(FileStream fileStream = File.OpenRead(directoryDatasetFile)) | |
| { | |
| reportLibrary.Files.Add(datasetFileName, fileStream, true); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string directoryDatasetFile = "D:\upload\Report_Dataset.rsd"; | |
| string datasetFileName = Path.GetFileName(datasetFile); | |
| string datasetFullUrl = string.Concat("http://sharepoint/dashboard/Data Connections/Datasets/", datasetFileName) | |
| SPFolder folder = ....; //get folder "Datasets" from library "Data Connections" | |
| using(FileStream fileStream = File.OpenRead(directoryDatasetFile)) | |
| { | |
| folder.Files.Add(datasetFileName, fileStream, true); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string dataConnectionsLibraryUrl = "http://sharepoint/dashboard/Data Connections/DataSources" | |
| string directorySourceFile = "D:\upload\Reporting.SSAS.Tabular.rds"; | |
| //Need to change file extension for SharePoint | |
| string sourceFileName = Path.GetFileName(directorySourceFile).Replace("rds", "rsds"); | |
| //Relevant for dataset property | |
| string dataSourcesFileFullUrl = string.Concat(dataConnectionsLibraryUrl, sourceFileName); | |
| XmlNode extensionNode = null; | |
| XmlDocument xDocument = new XmlDocument(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ReportingService2010 reportingService = new ReportingService2010(); | |
| reportingService.Url = "http://sharepoint/dashboard/_vti_bin/ReportServer/ReportService2010.asmx"; | |
| reportingService.Credentials = System.Net.CredentialCache.DefaultCredentials; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var directoryDataSourcesFiles = Directory.GetFiles(uploadReportFolderPath + "\\" + Constants.DirectoryFolder.DataSources); | |
| var directoryDatasetFiles = Directory.GetFiles(uploadReportFolderPath + "\\" + Constants.DirectoryFolder.Datasets); | |
| var directoryReportFiles = Directory.GetFiles(uploadReportFolderPath + "\\" + Constants.DirectoryFolder.Reports); | |
| LoadReportingService(); | |
| using (SPSite siteColl = new SPSite(dashboardWebUrl)) | |
| using (SPWeb site = siteColl.OpenWeb()) | |
| { | |
| IList<DataSourceFile> dataSourceFiles = UploadAndConfigureDataSourceFiles(site, directoryDataSourcesFiles); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.SharePoint.Client; | |
| using System; | |
| using System.Text; | |
| using System.Web; | |
| namespace BlogNoneSpFullPageWeb | |
| { | |
| public partial class Default : System.Web.UI.Page | |
| { | |
| protected void Page_Load(object sender, EventArgs e) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="BlogNoneSpFullPageWeb.Default" %> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head runat="server"> | |
| <title>vintaurus.weeebly.com</title> | |
| <link href="../Content/bootstrap.min.css" rel="stylesheet" /> | |
| <link href="../Content/bootstrap-theme.min.css" rel="stylesheet" /> | |
| <script type="text/javascript" src="../Scripts/jquery-1.9.1.min.js"></script> | |
| <script type="text/javascript" src="../Scripts/bootstrap.min.js"></script> |
NewerOlder