Posts

Donate

How To Set Power BI Date Slicer To Current Month

Image
Gents, Here's another simple tip on how to set the date slicer's default value for the current month given that today is the month of March (ex. March 1, 2020 and March 31, 2020). Click the date slicer and go the the Filters on this visual pane. Choose Relative date for Filter Type and is in this month for Show items when the value filter. When you click Apply Filter, the values in the date slicer will now reset to the current month. That's it!

How To Hide Or Show Power BI Visuals In Power BI Desktop

Image
Hi Fellow Programmers! At present I'm working on creating reports for the top management and stakeholders using Power BI. Since I'm done with my training, it's time for the real challenge. The first challenge was familiarizing with the Power BI Desktop on how to hide or show visuals on the report page. After familiarizing with the Power BI Desktop menus, I finally found it. All you need to is to go to the View Menu , then choose Selection in Show Panes . From there you can either hide or show the visual objects. Cheers!

BACKUP LOG cannot be performed because there is no current database backup In SQL Server

Image
Hi All, While restoring a new database backup which resides from the server in US, I encountered an error which is 'SQL Server error 4214 - BACKUP LOG cannot be performed because there is no current database backup' . Glad that I had a skype session with our software architect in the US and presented to him the issue. The solution that worked was when performing the restore of the backup database was to go to the Options of Restore Database dialog and uncheck these two checkboxes 'Take tail-log backup before restore checkbox' and 'Leave source database in the restoring state checkbox' . Then check 'Check Overwrite the existing database (WITH REPLACE)' box. After that, the restore operation succeeded.

How To Change Open And Closed Folder Icons Of jsTree

To change the open and close folder icons, I found the answer here which is to set the 'open' and 'closed' properties of 'types' plugin. On the 'open_node' and 'close_node' events of the tree, set the data.nodes to 'open' and 'closed' respectively. See sample code below. function InitTreeEmployeesList() { $( '#jstree' ).jstree({ 'core' : { 'multiple' : false , 'themes' : { 'dots' : true , 'icons' : true } }, 'types' : { 'default' : { 'icon' : '../Content/Employee/Images/emp_default.png' }, 'open' : { 'icon' : '../Content/Employee/Images/employee_active.png' }, 'closed' : { 'icon' : '../Content/Employee/Images/emp_default.png' } },

Bootstrap Table Uncheck The Checkboxes On Page Load

Good evening all! When working with checkboxes in Bootstrap Table created by Wenzhixin, you may have notice that on page load the checkboxes are checked by default. If you want to uncheck these checkboxes on page load of your ASP.NET MVC page, call the checkInvert method of the bootstrap table on document ready of the page such as the code below: $(document).ready( function () { UncheckShoppingCartTable(); }); function UncheckShoppingCartTable() { $( '#tblShoppingCart' ).bootstrapTable( 'checkInvert' ); }

Custom AuthorizeAttribute Class In ASP.NET MVC

Hello All! In ASP.NET MVC projects, you would normally handle Unauthorized users if they access to a page in which they don't have access to. To do this I have a custom class that inherits the AuthorizeAttribute class. This class was take from accepted answers in stackoverflow with some modifications according to my needs for the project. Here's the complete AuthorizeUser class. using System.Configuration; using System.Web.Mvc; namespace AuthenticationDemo { public class AuthorizeUsersAttribute : AuthorizeAttribute { private string redirectUrl = "" ; public string NotifyUrl { get { return redirectUrl; } set { redirectUrl = value ; } } public AuthorizeUsersAttribute() : base () { } public AuthorizeUsersAttribute( string redirectUrl) : base () { this .redirectUrl = redirectUrl; } protected ov

How To Debug Or Step Through A WCF Service In ASP.NET MVC Application

Hello, In order to step through the WCF project in debugging mode through and ASP.NET MVC, follow these simple steps. WCF Project 1. Right click on the Solution of the WCF Service Project 2. Choose Properties 3. On Startup Project -> Select Multiple startup projects 4. On the Action dropdown of the WCF Service project, choose "Start". ASP.NET MVC Project 1. Run the WCF Service Project using the default web browser 2. Add a WCF connection using Connected Services (Make sure to type the correct url of the service). See web.config value below. 3. In web.config, add an endpoint element for the WCF service. <endpoint address= "http://localhost:63070/Service.svc" binding= "basicHttpBinding" bindingConfiguration= "BasicHttpBinding_Service1" contract= "DataLocalHostService.DataService" name= "BasicHttpBinding_Service1" /> 4. In your controller, you may call the service based from

Generate Page Numbers Of Word Document Using OpenXML

Hello, I've been working on OpenXML framework specifically for generating reports on a Word Document. One of the task of the project is to add page numbers to a document with the format of "Page 1 of 72". After doing some researches on stackoverflow and google, I found a few links with functions on how to add page numbers but not in the format as specified for my requirement. In case you need to add page numbers to a word document specifically in the footer area, see function below. private Footer GeneratePageNumbers ( string FooterText) { var element = new Footer ( new Paragraph ( new ParagraphProperties ( new ParagraphStyleId () { Val = "Footer" }, new Justification () { Val = JustificationValues.Center }), new Run ( new Text () { Text = FooterText, Space = SpaceProcessingModeValues.Preserve }), new Run ( new SimpleField () { Instruction = "Page" }), new Run ( new Text () { Te

Return Multiple Values From C# Asynchronous Function

Good evening fellow developers! I have a simple application that queries the database and returns list of employees and list of their dependents. Since I've just started learning async programming, I wonder if I could return multiple values for an asynchronous function or method. The initial solution that I have is to create a view model class that has two properties specifically list of employees and list of dependents. And this view model class will be the return type of the function. After reading through the docs, it's possible to return multiple values using System.ValueTuple namespace. If the target framework of the project is 4.6.2 and below, you need to add the System.ValueTuple NuGet package using NuGet Console Manager or add the package using Manage NuGet Package tool. For now, lets install the package using console manager. Install-Package "System.ValueTuple" Next is to modify the existing method to return multiple values using System.ValueTuple. pr

SQL Server : Login Success But “The database [dbName] is not accessible.” After Domain Migration Using New Domain User

Image
Recently, our systems administrator has just finished migrating our workstations from an old domain to a new domain. But this caused an issue wherein most of the databases are not accessible. I've done several workarounds from stackoverflow and non of them worked. The solution that worked is to add my new domain user to the databases using SQL Server Authentication (sa) and set my new domain user as dbOwner.

Donate