Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default view datagrid report in .xls or .pdf

Hello all!

I'm currently working on a report using webform in VB.Net for the
company i'm working with.

The layout is something like this:

Header(.inc)

Calendar start ---- Calender end (user choose the date they want to
view the report)

create report button (user click this button after specifying the date
and report is then generate)

Footer(.inc)

------------------------
Output:

The report is generated in datagrid according to the date selected.

Header(.inc)

Calendar start ---- Calendar end

Datagrid (with the data provided from stored procedure, which the user
wanted to see)

Footer(.inc)

------------------------
What i want:

after the report is generated, what i want is to enable the user to view
it in .pdf and/or .xls format, by the click of button.
I know i should/can use CrystalReport for this kind of thing, but i'm
not familiar with CrystalReport, i don't know how it works... If
possible i'd like to do this coding without having to use CrystalReport.


I hope, I've been clear to my problem...

Thank you in advance!
Yours,
syidah

----------------------------------------------------------
when you fear to fail, you fear something that has not yet happened.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default view datagrid report in .xls or .pdf

found a solution for this one. i've found a good code for letting the
user view the datagrid in excel format.
i hope this will be a good share for all ^^

'below are the conversion codes from datagrid to excel
If Request.QueryString("bExcel") = "1" Then

'Set the content type to Excel.
Response.ContentType = "application/vnd.ms-excel"

'Remove the charset from the Content-Type header.
Response.Charset = ""

'Turn off the view state.
Me.EnableViewState = False

Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)

'Get the HTML for the control
DataGrid1.RenderControl(hw)

'Write the HTML back to the browser
Response.Write(tw.ToString())

'End the response.
Response.End()

Notes: there are supposed to be two pages for this one.


----------------------------------------------------------
when you fear to fail, you fear something that has not yet happened.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default view datagrid report in .xls or .pdf

what i mean is two webforms, one to do the conversion process from the
server, one to return the resulting conversion.

----------------------------------------------------------
when you fear to fail, you fear something that has not yet happened.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Report Parameters to be named and saved like 'View' na Shrikant Excel Discussion (Misc queries) 1 August 9th 05 01:57 PM
datagrid Shashi Bhosale Excel Programming 0 June 21st 04 04:45 PM
Datagrid to Excel - error - rendercontrol Steve Chatham[_2_] Excel Programming 0 February 23rd 04 05:23 PM
Datagrid to Excel problem (ASP dot net) Steve Chatham[_2_] Excel Programming 3 February 23rd 04 03:07 PM
Datagrid ActiveX Control MK[_2_] Excel Programming 3 August 8th 03 09:30 AM


All times are GMT +1. The time now is 08:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"