PHP Classes

Create Multiple spreadsheet xls file: Create Multiple spreadsheet xls file

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (4)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 44%Total: 2,510 This week: 1All time: 1,537 This week: 560Up
Version License PHP version Categories
xlsgenerator 1.0Artistic License5.0XML, PHP 5
Description 

Author

This class can be used to create Multiple spreadsheets xls file format.

Which can be open in openoffice, Excel viewer and also in others latest editors.

Here you can customize cloumn's name,size,color,width of xls file.It will create xml file and open that file in xls or save as xls..it works perfect.

Picture of Prashant Bhavsar
Name: Prashant Bhavsar <contact>
Classes: 1 package by
Country: India India
Age: 40
All time rank: 124970 in India India
Week rank: 416 Up25 in India India Up

Example

<?php
########################Master Block################
#Created by Prashant Bhavsar
#mail me:prashantmbhavsar@gmail.com
#contact no:+91 - 09975589046

include("xmlFileCreation.php");

#put the xls file header names here. if two spreadsheet then use two headervalues..
$headerValues = "Flavor External ID, Preview Content File,Preview Descriptor File, Target Device Groups,Preview Type,Preview Media Format Name,Delivery Method";

#put name of xls spreadsheet
$worksheetName = "ContentItem";

#this creating the xls files header,and style of xls file
$xmlObject = new ExcelWriter;
$xmlPart1 = "";
$xmlPart .= $xmlObject->GetHeader();
$xmlPart .= $xmlObject->OfficeDocumentSettings();
$xmlPart .= $xmlObject->Style();

#worksheet means spreadsheet of xls file..if you want to add more than one then use logic
#and use this functino AddWorkSheet again for second spreadsheet
$xmlPart .= $xmlObject->AddWorkSheet($worksheetName,$headerValues);

#put the values of header..presently taking one spreadsheet
$DataValues ="put the column values here as per header values.That should be comma separated";

#its writing the values into xls file
$xmlPart .= $xmlObject->getColumnData($DataValues);

#filename of xls file.here you have to give the extension xml but when file will get done then
#open that file with openoffice or xls it will definately work
$file_name = "filename.xml";

$fp = fopen("/".$sourcepath.$file_name,"w");
$rr = "/".$sourcepath.$file_name;
system("chmod -rf 777 '".$rr."'");

#here i am using one spreadsheet so this 3 line code will get include once and if you want to
#create 2 spreadsheet then use twice
$xmlPart .= "</Table>";
$xmlPart .= $xmlObject->GetFooter();

#use this at the end of the all code means after creation of all spreadsheet
$xmlPart .= "</Workbook>";

if(
$fp){
    echo
"file open ";
}else{
    echo
"file Not open ";
}

#writing code to file
fwrite($fp,$xmlPart);
fclose($fp);

?>



  Files folder image Files  
File Role Description
Accessible without login Plain text file insertValues.php Example In this file you pass the values to functions to create the multiple sheet xls file.While creating it will create the xml file .but open that file with openoffice or xls option ..it will work perfect
Plain text file xmlFileCreation.php Class The class included in this file will create the xls file with multiple sheets.I spend many days to create this script as not got a perfect solution anywhere.

 Version Control Unique User Downloads Download Rankings  
 0%
Total:2,510
This week:1
All time:1,537
This week:560Up
User Ratings User Comments (4)
 All time
Utility:65%StarStarStarStar
Consistency:65%StarStarStarStar
Documentation:-
Examples:50%StarStarStar
Tests:-
Videos:-
Overall:44%StarStarStar
Rank:3466
 
The Class is no "XLS generating Class".
11 years ago (Carlos Martinez)
17%Star
nice one
13 years ago (anil jain)
52%StarStarStar
good one
15 years ago (Avinash Pawar)
47%StarStarStar
This is good script for generating multiple spreadsheet in on...
15 years ago (Shilbhushan Wasnik)
67%StarStarStarStar