Tuesday, December 15, 2015

A simple and stupid way to solve can not copy file to bin folder when compiling the project in visual studio 2015


when i try to compile a project with HiQPdf dll being add to support the Pdf document manipulation,

i always got this annoying message. i can not use the rebuild function from visual studio. since the rebuild action will clear all the files in the Bin folder. I had to manually copy the dep file back to bin folder and then build the project.




since the rebuild action will delete all the file within the bin folder. after i set the file attribute to readonly, then the issue is gone. since the rebuilt can not delete the readonly file.




Friday, December 11, 2015

How to define the tab order in AngularJS ng-repeat Table?

in my application. there is a table to host multiple textbox in each row.

since the user want to use the tab key to put the cursor focus on the next textbox, after they complete a textbox.

we can use the tabIndex properties in the textbox, set tabIndex value by using $index in the ng-repeat.

 <tr ng-repeat="orderDetail in MyOrder.orderDetailsList track by $index">
                           
                            <td><input type="text" tabindex="6+{{$index}}" ng-model="orderDetail.quantities" ng-blur="getQuantityTotal()"></td>
                            <td><input type="text" tabindex="6+{{$index}}+1"  class="shipItemInput" ng-model="orderDetail.shipItemName" ng-keyup="shipItemAutoComp('shipItemInput',$index)"><input type="text" ng-model="orderDetail.shipItemID" ng-show="false"   /></td>
                       
                            <td><input type="text"  tabindex="6+{{$index}}+3"  ng-model="orderDetail.weight" ng-blur="getWeightTotal()"></td>
                        </tr>

Thursday, December 10, 2015

how to fix blank Row and Column issue in export SSRS report to excel file

after we completed the report and deployed it to the sharepoint report library. it looks good when the user view the report in the browser.

however there is not annoying empty row and column found in the excel when user exported the report to excel file.




the fix is extreme easy. we only need to modify the location coordinate of the Tablix object in the report.



Set the Left and Top position in Location Property to be 0in
 




Wednesday, December 9, 2015

how to refresh a table/grid in the AngularJS implementation with ngDialog Popup

when i try to  add a new row to the grid with ngDialog modal popup,  the grid never refresh to show the new row after the ngDialog is closed. I debug it with console.log to view the data in Chrome.

the data array did update with new record. However the grid did not show the new record.

the trick is we must use the submit action in the form to trigger the anglarJS ng-repeat bindding update.


before the modification, the data array had been update with ng-click.

ngDialog.open({
            template: '\
                    <h2 class="underline">Add New Customer</h2>\
                     <p class="red">{{addCustomerError}}</p>\
                    <table>\
                        <tr>\
                            <td>\
                                CustomerName:<br />\
                                <input type="text" ng-model="customerFormData.dealerIdName" />\
                            </td></tr>\
                            <tr><td>\
                                street:<br />\
                                <input type="text" ng-model="customerFormData.mailAddress1" />\
                            </td></tr>\
                            <tr><td>\
                                City:<br />\
                                <input type="text" ng-model="customerFormData.mailCity" />\
                                 </td></tr>\
                            <tr><td>\
                                Province:<br />\
                                <input type="text" ng-model="customerFormData.mailProvince" />\
                            </td></tr>\
                              <tr><td>\
                                Postal Code:<br />\
                                <input type="text" ng-model="customerFormData.mailPostCode" />\
                            </td></tr>\
                            <tr><td>\
                                Phone:<br />\
                                <input type="text" ng-model="customerFormData.phone" />\
                            </td></tr>\
                    </table> <br />\
                <div class="ngdialog-buttons">\
                    <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="closeThisDialog(0)">Cancel</button>\
                    <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="saveCustomer()" >Confirm</button>\
            </div>',
            className: 'ngdialog-theme-plain custom-width',
            scope: $scope,
            plain: true
        })

Finally the table can be refreshed with the following code. and highlight the change in Bold.

we had to use the form with ng-submit action to update the data array and trigger the date binding on the ng-repeat table.

ngDialog.open({
            template: '\
                     <form ng-submit="saveCustomer()">\
                    <h2 class="underline">Add New Customer</h2>\
                     <p class="red">{{addCustomerError}}</p>\
                    <table>\
                        <tr>\
                            <td>\
                                CustomerName:<br />\
                                <input type="text" ng-model="customerFormData.dealerIdName" />\
                            </td></tr>\
                            <tr><td>\
                                street:<br />\
                                <input type="text" ng-model="customerFormData.mailAddress1" />\
                            </td></tr>\
                            <tr><td>\
                                City:<br />\
                                <input type="text" ng-model="customerFormData.mailCity" />\
                                 </td></tr>\
                            <tr><td>\
                                Province:<br />\
                                <input type="text" ng-model="customerFormData.mailProvince" />\
                            </td></tr>\
                              <tr><td>\
                                Postal Code:<br />\
                                <input type="text" ng-model="customerFormData.mailPostCode" />\
                            </td></tr>\
                            <tr><td>\
                                Phone:<br />\
                                <input type="text" ng-model="customerFormData.phone" />\
                            </td></tr>\
                    </table> <br />\
                <div class="ngdialog-buttons">\
                    <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="closeThisDialog(0)">Cancel</button>\
                    <button type="submit" class="ngdialog-button ngdialog-button-primary" >Confirm</button>\
            </div></form>',
            className: 'ngdialog-theme-plain custom-width',
            scope: $scope,
            plain: true

        })