Click here to Skip to main content
11,581,210 members (67,228 online)
   

ASP.NET

 
QuestionBrowser Compatibilty Pin
ravitejapammi6-Jan-13 23:54
memberravitejapammi6-Jan-13 23:54 
AnswerRe: Browser Compatibilty Pin
Sandeep Mewara7-Jan-13 2:53
mvpSandeep Mewara7-Jan-13 2:53 
GeneralRe: Browser Compatibilty Pin
ravitejapammi17-Jan-13 20:21
memberravitejapammi17-Jan-13 20:21 
GeneralRe: Browser Compatibilty Pin
Sandeep Mewara17-Jan-13 23:50
mvpSandeep Mewara17-Jan-13 23:50 
GeneralJavaScript - window.print() not working in Android mobile browsers Pin
ravitejapammi23-Jan-13 23:08
memberravitejapammi23-Jan-13 23:08 
QuestionHow can I delete a Column of XLSX file with EPPlus in web application? Pin
cawboy_iran6-Jan-13 20:00
membercawboy_iran6-Jan-13 20:00 
AnswerRe: How can I delete a Column of XLSX file From EPPlus in web application? Pin
Sandeep Mewara6-Jan-13 21:26
mvpSandeep Mewara6-Jan-13 21:26 
GeneralRe: How can I delete a Column of XLSX file From EPPlus in web application? Pin
cawboy_iran7-Jan-13 2:48
membercawboy_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 Pin
Jassim Rahma5-Jan-13 8:06
memberJassim Rahma5-Jan-13 8:06 
AnswerRe: WoW Slider now showing the image Pin
Sandeep Mewara5-Jan-13 20:09
mvpSandeep Mewara5-Jan-13 20:09 
QuestionUnable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox Pin
amsedky5-Jan-13 1:00
memberamsedky5-Jan-13 1:00 
AnswerRe: Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox Pin
Sandeep Mewara5-Jan-13 20:24
mvpSandeep Mewara5-Jan-13 20:24 
Questiondisplay animated image while save data to asp.net Pin
ashraf almashhari4-Jan-13 21:46
memberashraf almashhari4-Jan-13 21:46 
AnswerRe: display animated image while save data to asp.net Pin
Sandeep Mewara4-Jan-13 22:14
mvpSandeep Mewara4-Jan-13 22:14 
QuestionAsp.net Pin
Manjunath Hegde4-Jan-13 0:41
memberManjunath Hegde4-Jan-13 0:41 
AnswerRe: Asp.net Pin
Rahul Rajat Singh4-Jan-13 1:04
memberRahul Rajat Singh4-Jan-13 1:04 
QuestionInsert/Update/Delete Records in Dynamic Generated Textbox/Checkbox and Loop Through All Records Pin
guodl3-Jan-13 10:11
memberguodl3-Jan-13 10:11 
Questionlive update Pin
Subin Mavunkal3-Jan-13 2:23
memberSubin Mavunkal3-Jan-13 2:23 
AnswerRe: live update Pin
Keith Barrow3-Jan-13 2:46
mentorKeith Barrow3-Jan-13 2:46 
AnswerRe: live update Pin
Rahul Rajat Singh3-Jan-13 22:04
memberRahul Rajat Singh3-Jan-13 22:04 
QuestionHow to populate WoW Slider from database Pin
Jassim Rahma1-Jan-13 8:32
memberJassim Rahma1-Jan-13 8:32 
QuestionUmbarco or Joomla? Pin
Jassim Rahma31-Dec-12 23:58
memberJassim Rahma31-Dec-12 23:58 
AnswerRe: Umbarco or Joomla? Pin
Rahul Rajat Singh3-Jan-13 21:51
memberRahul Rajat Singh3-Jan-13 21:51 
AnswerRe: Umbarco or Joomla? Pin
deflinek8-Jan-13 2:55
memberdeflinek8-Jan-13 2:55 
QuestionSlideShow Control Pin
cdpsource31-Dec-12 1:19
membercdpsource31-Dec-12 1:19 

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
Web04 | 2.8.150603.1 | Last Updated 6 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid