Click here to Skip to main content
       

ASP.NET

 
GeneralRe: Grouping Columns in Grid View PinmemberAmitTalekar7-Jan-13 22:54 
QuestionHow to make gridview coloum in hyperlink and get the values in lightbox Pinmemberkrishnavaradharajan7-Jan-13 2:26 
AnswerRe: How to make gridview coloum in hyperlink and get the values in lightbox PinmvpSandeep Mewara7-Jan-13 2:57 
GeneralRe: How to make gridview coloum in hyperlink and get the values in lightbox Pinmemberkrishnavaradharajan7-Jan-13 4:23 
AnswerRe: How to make gridview coloum in hyperlink and get the values in lightbox Pinmemberpiyush_dobariya7-Jan-13 18:41 
AnswerRe: How to make gridview coloum in hyperlink and get the values in lightbox PinmemberDavid Mujica8-Jan-13 3:48 
QuestionBrowser Compatibilty Pinmemberravitejapammi6-Jan-13 23:54 
AnswerRe: Browser Compatibilty PinmvpSandeep Mewara7-Jan-13 2:53 
GeneralRe: Browser Compatibilty Pinmemberravitejapammi17-Jan-13 20:21 
GeneralRe: Browser Compatibilty PinmvpSandeep Mewara17-Jan-13 23:50 
GeneralJavaScript - window.print() not working in Android mobile browsers Pinmemberravitejapammi23-Jan-13 23:08 
QuestionHow can I delete a Column of XLSX file with EPPlus in web application? [modified] Pinmembercawboy_iran6-Jan-13 20:00 
AnswerRe: How can I delete a Column of XLSX file From EPPlus in web application? PinmvpSandeep Mewara6-Jan-13 21:26 
GeneralRe: How can I delete a Column of XLSX file From EPPlus in web application? Pinmembercawboy_iran7-Jan-13 2:48 
thanx for your reply...
 
I leave My Code Here
 
I would remove the additional Column in and also want to change the page layout direction to (right to left)
 
'----/// Click Report Button ///----
Protected Sub btnExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExcel.Click
        If "MYcondition is true" Then
            GenerateXLSXFile(CreateDataTable())
        End If
End Sub
 
'----/// Genrate Report ///----
Private Sub GenerateXLSXFile(ByVal tbl As DataTable)
        Dim excelPackage = New ExcelPackage
        Dim excelWorksheet = excelPackage.Workbook.Worksheets.Add("My_Worksheet")
 
        excelWorksheet.View.ShowGridLines = False
        excelWorksheet.Cells.Style.Border.Bottom.Style = Style.ExcelBorderStyle.Thick
		
        excelWorksheet.Cells("A5").LoadFromDataTable(tbl, True)
        
       '-----/// Hide a Column ///---------
	excelWorksheet.Column(2).Hidden = True    
	
 
       '----/// Change PageLayout Direction ///---------------	
        excelWorksheet.View.PageLayoutView = excelWorksheet.View.RightToLeft  
 
        excelWorksheet.Cells("A5").Value = "header_1"
        excelWorksheet.Cells("B5").Value = "header_2"
        excelWorksheet.Cells("C5").Value = "header_3"
 
        Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
        Response.AddHeader("content-disposition", "attachment;  filename=My_ExcelName.xlsx")
 
        Dim stream As MemoryStream = New MemoryStream(excelPackage.GetAsByteArray())
        Response.OutputStream.Write(stream.ToArray(), 0, stream.ToArray().Length)
        Response.Flush()
        Response.Close()
End Sub
 
'----/// Create Data Table for Exel Report (use store procedure) ///----
Private Function CreateDataTable() As DataTable
        Dim dataTable As New DataTable("tbl_Name")
        Dim dataAdapter As New SqlDataAdapter()
 
        Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("ProvidersCS").ToString)
        Dim cmd As New SqlCommand("My Select Command", conn)
 
        cmd.CommandType = CommandType.StoredProcedure
        Try
            conn.Open()
            dataAdapter.SelectCommand = cmd
            dataAdapter.Fill(dataTable)
        Catch ex As Exception
        Finally
            conn.Close()
        End Try
 
        Return dataTable		
End Function

QuestionWoW Slider now showing the image PinmemberJassim Rahma5-Jan-13 8:06 
AnswerRe: WoW Slider now showing the image PinmvpSandeep Mewara5-Jan-13 20:09 
QuestionUnable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox Pinmemberamsedky5-Jan-13 1:00 
AnswerRe: Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox PinmvpSandeep Mewara5-Jan-13 20:24 
Questiondisplay animated image while save data to asp.net Pinmemberashraf almashhari4-Jan-13 21:46 
AnswerRe: display animated image while save data to asp.net PinmvpSandeep Mewara4-Jan-13 22:14 
QuestionAsp.net PinmemberManjunath Hegde4-Jan-13 0:41 
AnswerRe: Asp.net PinmemberRahul Rajat Singh4-Jan-13 1:04 
QuestionInsert/Update/Delete Records in Dynamic Generated Textbox/Checkbox and Loop Through All Records Pinmemberguodl3-Jan-13 10:11 
Questionlive update PinmemberSubin Mavunkal3-Jan-13 2:23 
AnswerRe: live update PinmentorKeith Barrow3-Jan-13 2:46 
AnswerRe: live update PinmemberRahul Rajat Singh3-Jan-13 22:04 
QuestionHow to populate WoW Slider from database PinmemberJassim Rahma1-Jan-13 8:32 
QuestionUmbarco or Joomla? PinmemberJassim Rahma31-Dec-12 23:58 
AnswerRe: Umbarco or Joomla? PinmemberRahul Rajat Singh3-Jan-13 21:51 
AnswerRe: Umbarco or Joomla? Pinmemberdeflinek8-Jan-13 2:55 
QuestionSlideShow Control Pinmembercdpsource31-Dec-12 1:19 
AnswerRe: SlideShow Control Pinmemberjkirkerx31-Dec-12 10:23 
GeneralRe: SlideShow Control Pinmembercdpsource31-Dec-12 23:41 
AnswerRe: SlideShow Control Pinmemberjkirkerx1-Jan-13 10:31 
GeneralRe: SlideShow Control Pinmember@AmitGajjar1-Jan-13 6:41 
GeneralRe: SlideShow Control Pinmembercdpsource1-Jan-13 9:35 
Questioni hv registerd in free web hostin website and i create an empty website... Pinmembersyedkhaleel30-Dec-12 23:24 
AnswerRe: i hv registerd in free web hostin website and i create an empty website... Pinmember_Amy31-Dec-12 17:47 
AnswerRe: i hv registerd in free web hostin website and i create an empty website... Pinmember@AmitGajjar1-Jan-13 6:43 
Questionregistration form Pinmemberkhusali30-Dec-12 21:39 
AnswerRe: registration form Pinmember_Amy31-Dec-12 17:45 
AnswerRe: registration form Pinmember@AmitGajjar1-Jan-13 6:55 
AnswerRe: registration form PinmemberRahul Rajat Singh3-Jan-13 21:53 
QuestionSlider control in SSRS PinmemberSanjeewan9929-Dec-12 18:28 
Questionadvertising platform...? PinmemberJassim Rahma29-Dec-12 9:24 
GeneralRe: advertising platform...? Pinmemberjkirkerx30-Dec-12 13:38 
QuestionFile Upload Component...? PinmemberJassim Rahma28-Dec-12 9:44 
AnswerRe: File Upload Component...? PinmvpSandeep Mewara28-Dec-12 21:14 
QuestionCan we make a application to update FB status? Pinmemberanubhaw.gupta28-Dec-12 6:18 
AnswerRe: Can we make a application to update FB status? PinmvpSandeep Mewara28-Dec-12 21:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 30 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid