Click here to Skip to main content
15,890,438 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionBrowser Compatibilty Pin
RavitejaPammi6-Jan-13 23:54
RavitejaPammi6-Jan-13 23:54 
AnswerRe: Browser Compatibilty Pin
Sandeep Mewara7-Jan-13 2:53
mveSandeep Mewara7-Jan-13 2:53 
GeneralRe: Browser Compatibilty Pin
RavitejaPammi17-Jan-13 20:21
RavitejaPammi17-Jan-13 20:21 
GeneralRe: Browser Compatibilty Pin
Sandeep Mewara17-Jan-13 23:50
mveSandeep Mewara17-Jan-13 23:50 
GeneralJavaScript - window.print() not working in Android mobile browsers Pin
RavitejaPammi23-Jan-13 23:08
RavitejaPammi23-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
cawboy_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
mveSandeep 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
cawboy_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)

VB
'----/// 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
Jassim Rahma5-Jan-13 8:06 
AnswerRe: WoW Slider now showing the image Pin
Sandeep Mewara5-Jan-13 20:09
mveSandeep 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
amsedky5-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
mveSandeep Mewara5-Jan-13 20:24 
Questiondisplay animated image while save data to asp.net Pin
ashraf almashhari4-Jan-13 21:46
ashraf almashhari4-Jan-13 21:46 
AnswerRe: display animated image while save data to asp.net Pin
Sandeep Mewara4-Jan-13 22:14
mveSandeep Mewara4-Jan-13 22:14 
QuestionAsp.net Pin
Manjunath Hegde4-Jan-13 0:41
Manjunath Hegde4-Jan-13 0:41 
AnswerRe: Asp.net Pin
Rahul Rajat Singh4-Jan-13 1:04
professionalRahul 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
guodl3-Jan-13 10:11 
Questionlive update Pin
Subin Mavunkal3-Jan-13 2:23
Subin Mavunkal3-Jan-13 2:23 
AnswerRe: live update Pin
Keith Barrow3-Jan-13 2:46
professionalKeith Barrow3-Jan-13 2:46 
AnswerRe: live update Pin
Rahul Rajat Singh3-Jan-13 22:04
professionalRahul Rajat Singh3-Jan-13 22:04 
QuestionHow to populate WoW Slider from database Pin
Jassim Rahma1-Jan-13 8:32
Jassim Rahma1-Jan-13 8:32 
QuestionUmbarco or Joomla? Pin
Jassim Rahma31-Dec-12 23:58
Jassim Rahma31-Dec-12 23:58 
AnswerRe: Umbarco or Joomla? Pin
Rahul Rajat Singh3-Jan-13 21:51
professionalRahul Rajat Singh3-Jan-13 21:51 
AnswerRe: Umbarco or Joomla? Pin
Deflinek8-Jan-13 2:55
Deflinek8-Jan-13 2:55 
QuestionSlideShow Control Pin
cdpsource31-Dec-12 1:19
cdpsource31-Dec-12 1:19 

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

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