/    Sign up×
Community /Pin to ProfileBookmark

Exporting to Excel Spreadsheet help

Hi I have data which I’m exporting to excel using PHP & header(“Content-Type: application/vnd.ms-excel”) etc…..

Here is what I want to do…

I’m looping through the recordset and when there is a duplicate environment name and version name I want to only print the detail information and not the environment name and version again… So it would look something like this…

Environment 1 Details1
—————–Details2
—————–Details3 etc…

rather than…

Environment 1 Details1
Environment 1 Details2 etc…

Here is my logic and for some reason it is not working…
There is more code above which gets the next environment and version name, I just figured I didn’t need to include that….

[code=php]<?php if ($strEnv === $lastStrEnv && $strVer === $lastStrVersion) {?>
//Details only since its same env
<?php }
else {?>
//Write new env name version and details…
<?php }

//Place values into var holder..
$lastStrVersion = $strVer;
$lastStrEnv = $strEnv;
?>

<?php $rs->MoveNext();
} ?> [/code]

Any help would be appreciated
Thanks,

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@JayMMay 18.2007 — What you posted tells us nothing ?. You need to post your more. Also, describe why it's not working.

Are you getting an error? Is it displaying the environment more than once? What's happening? You have to let us know as much as possible because we can't see the program infront of us. ?
Copy linkTweet thisAlerts:
@mattv10authorMay 18.2007 — Sorry.. That was the one part I forgot to talk about.. It is writing the environment name multiple rather than writing it once and placing all the errors inside the one cell..

That is the issue I am getting.. Hopefully that is enough..
×

Success!

Help @mattv10 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...