I didn't think of that, but you do make a good point.

I'd still give the gridview export idea a shot though.  Some time ago, I 
found a couple of lines of code from my co-worker and combined it into a 
class with some other code I've found.  I have used it to date with 
relatively no issues.

Here's the class: 
http://pastebin.com/YVepwHBs 

on whatever button click (I did an imagebutton here, but it doesn't 
matter), I did this:

  protected void btnExcel_Click(object sender, ImageClickEventArgs e)
  {
    clsExcelGenerator excel = new clsExcelGenerator();
    excel.GenerateExcel(*gridview name*, "*Report Title*");
  }

Sums did work on the exported sheet when I tried.  If you have a better 
idea, please advise.  I'm always willing to learn.  :)

On Thursday, March 15, 2012 10:54:18 AM UTC-5, srussell705 wrote:
>
> On Thu, Mar 15, 2012 at 9:57 AM, Chuck <charles.pierrot...@gmail.com> 
> wrote:
> > I don't have code in front of me to explain in detail, but can't you
> > step through the dataset and add some sort of String.Format (assuming
> > you're using C# here - it looks like you are)?
> >
> > Example for string format.
> > 
> http://stackoverflow.com/questions/418822/asp-net-negative-numbers-in-parenthesis
> >
> > Examples for cycling through dataset
> > 
> http://bytes.com/topic/c-sharp/answers/251798-loop-through-dataset-get-values-vb-net
> > 
> http://social.msdn.microsoft.com/Forums/zh/csharpgeneral/thread/0866d84c-b22c-4d68-9769-b51eb2d3955a
> ----------------------
>
> I don't think that would be a good thing because that value is now
> considered TEXT and a sort or SUM() will not comprehend the true
> value.
>
> The requester is attempting to sling pure text to the user and append
> a header for the browser to load the text into excel.
>
> If the user were going to make the file locally on the server, adjust
> the column formatting and then push that file it would work.
>
> Oh yeah this gets expensive to load Excel on a server!
>
>
> > A few minutes of Google search may very well help you in this case.
> >
> > FYI: if you're passing this dataset to a gridview of some sort, you
> > may very well be able to export the gridview itself, and do all your
> > formatting on the gridview - which sounds like you're doing that
> > already.
> --------------------------------
>
> -- 
> Stephen Russell
>
> 901.246-0159 cell
>
>

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to dotnetdevelopment@googlegroups.com
To unsubscribe from this group, send email to
dotnetdevelopment+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to