Contact us today: (866) 4-WEBSAN (932726)                Get Instant Support

Learn more about Dynamics GPView Dynamics GP PricingFree Dynamics GP Training

Have you ever wanted to share a report between several different people or companies, but wanted the report to only display data for that specific person or company?  This can be tricky with a multi company or multi person database.  However there is an easy way to do this, and it's not coping and pasting the report for each company/user.

There are 2 steps to do this.

The first step is easy.  When creating the SRS report, create a person or company parameter, just a normal text field parameter.  This will be the parameter be used to set which specific person/company the report will be for.  It would probably be a good idea to use a different naming convention for this parameter, to specify that it as a default parameter, like default_user.  Then finish creating the report and onto the next step!

The second step is to change your code where you set/send the report parameters to the SSRSPHP library.  All you have to do is check if the parameter name is equal to one of the default parameters and hide the parameter from the user when setting the parameter.  Then when the report is being submitted, all you have to do is set the parameter before sending it to the SSRSPHP library to retrieve the report.

The code to do this would look something like this:

ssrs

Now the user won't be able to change or even see the parameter.  This is pretty good, but if we want to add more default parameters this isn't a very elegant solution.  Instead we can put all the default parameters into an array and check if the default parameter exists in the array.  This way in order to add more parameters, all we have to do is change an array

The code to do this would look something like this:

ssrs 1

To the user it will seem like nothing has happened, but we have effectively limited the user to see the report data that we want them to see without having to create separate reports for each company or person.

By: Dustin Yee, Application Developer, , WebSan Solutions Inc., a Canadian Certified Microsoft Partner

Published in Uncategorized

PHP is one of the most versatile programming languages for building web applications.   However, one of the problems with PHP is that there is more than one way to do the same thing.  This might not sound like a problem, but PHP's ease of use is also its downfall.  Because there are less restrictions on the structure of the code you write, it's much easier to write bad code. The solution to this problem is to use a framework and design pattern such as Model, View, and Controller (MVC).

There are many PHP frameworks out there.  Here, at WebSan, one of the PHP frameworks we use regularly is Codeigniter.  The reason is that it is well documented, small footprint, exceptional performance and has a large user community.

Here are some resources to get started with Codeigniter:

Tutorials:
CodeIgniter From Scratch: Day 1, Nettuts.com - Getting Started With the Framework
CodeIgniter From Scratch: Day 2, Nettuts.com - Database Selecting Methods
CodeIgniter From Scratch: Day 3, Nettuts.com - Sending Emails
CodeIgniter From Scratch: Day 4, Nettuts.com - Newsletter Signup

IBM developerWorks - Getting started with CodeIgniter

Published in Uncategorized