Archive for August, 2010

Creating Excel files from PHP

I needed to make a little app to make some listings in Excel and the easiest and fastest way to do it accesible to everyone was to upload it to the web. So I’ve searched how to create Excel files from PHP.

To do this I found the class IAM_XLS. With it you can create a .XLS file and add data to it (from a msql query or generating the data) and give it out to the explorer to download. Here you have an example of code:


<?php
require("iam_xls.php");

//Create EXCEL file in memory
$mid_excel = new IAM_XLS('tickets');

$i = 0;
$fila = 0;
while($i <= 50) {
//Write on cells
$mid_excel->WriteCellNumber($fila, 0, $i);
$mid_excel->WriteCellText($fila, 1, "texto");
$fila++;
$i++;
}

//Spit out the file in the browser
$mid_excel->OutputFile();

?>

Pretty simple, I had never done anything like this and in a few minutes I had it working.
It comes with enough documentation, in web format.

Tags: , , ,

Solution to Outlook printing emails bad

The other day in the office there was a computer that started to print emails from Outlook 2003 and from the web-client of Outlook in a bad way. They were cut from the sides like if there was no margin. Trying other programs, they print well.

The solution was in going to Internet Explorer, and go to Archive / File > Configure page and give it margins. (Sorry about the menu items, I don’t have an english version of Windows to look for the correct words of the menu).

Tags: , , , , ,

Ducks – Dog mask


Hahahahahahaha incredibol!

Tags: , ,

How to configure environment variables in Windows Vista / 7

I’ve had a little trouble installing strawberry perl and I’ve needed to configure my environment variables on my Windows 7. I needed to edit my %PATH% variable.
To do this we can go to:

Right Click on Computer > Properties
Advanced System Settings (left side)
(On Advanced Tab) Environment variables button

Tags: , , , , , , ,

How to identify the right earphone from the left one easy!

Via Microsiervos (spa) I found out an easy way to difference the right earphone from the left one of a headset, even in the dark: Just make a little knot in the right one!

Tags: , , , ,

Connecting to a network disk remembering credentials in Windows XP Home

I got tired of entering the password of the account I use to connect to a shared device (a folder) from Windows XP Home Edition (this version does not have enabled the “remember credentials” button in the connect to network drives window).
So I decided to search a way to get rid of that, and its pretty easy:

Net use L: "\\COMPUTER\Shared Folder" /user:USER PASSWORD

You only need to create a .bat file (a text file but changing the extension to .bat) with that linea (adapted to your case) and add it to the Start-on-boot stuff of the PC.

Tags: , , , , , ,

Remove blue background of Windows icons

Today at the job I’ve found a computer that had all the icons “like selected” with the blue background in the text.

To get rid of this effect I found the next solution (after many that didn’t work):

1. Right click on the Desktop
2. Properties
3. Desktop Tab
4. Personalize Desktop Tab
5. Web Tab
6. Unselect anything you don’t use

This was found out via nocturnar forums (spa).

Tags: , , , , ,