Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

jazzgirl

@jazzgirl
About
Posts
8
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C# access to a directory path
    J jazzgirl

    thanks!

    C# csharp question

  • C# access to a directory path
    J jazzgirl

    In a C# 2008/2010 desktop application, I need to be able to allow users the ability to select a file they need to work with. There needs to be a default directory path. However I need to be able to allow users the ability to select files from whatever directory path they have access to. Thus can you tell me. show me code, and/or point me to a url I can use as a reference to accomplish my goal?

    C# csharp question

  • visual bais output written to excel
    J jazzgirl

    ChandraRam: I have the following questions to ask you which include: 1. I am not certain of when I can use a recording macro in excel? I basically need to have the visual basic.net 2005 desktop application control the processing since it is the one the drives the generation of separate excel worksheets in distinct workbooks. (There is one worksheet per workbook since each spreadsheet is email and to differet customers.) 2. When I use the recroding macro, when it be before I create the excel object, while I am putting data into the excel object, or after the excel worksheet has been generated? 3. I am not certain where you are refering to using the VBA code. Am I including the VBA code in the following .NET code: xlApp = New Excel.Application xlClApp = New Excel.ApplicationClass xlApp.Workbooks.Add() xlWorkBook = xlApp.Workbooks.Add(misValue) xlWorkSheet = CType(xlWorkBook.Sheets("sheet1"), Microsoft.Office.Interop.Excel.Worksheet) xlApp.Visible = False xlApp.ScreenUpdating = True dt = ds4.Tables(0) 'Add the column headings for the from the dataset Dim dc As DataColumn Dim iCols As Int32 = 0 For Each dc In dt.Columns xlWorkSheet.Range("A1").Offset(0, iCols).Value = dc.ColumnName xlWorkSheet.Range("A1").Offset(0, iCols).Font.Bold = True xlWorkSheet.Range("A1").Offset(0, iCols).BorderAround() iCols += 1 Next Dim iRows As Int32 For iRows = 0 To dt.Rows.Count - 1 xlWorkSheet.Range("A2").Offset(0, iCols).Select() xlWorkSheet.Range("A2").Offset(0, iCols).Justify() xlWorkSheet.Range("A2").Offset(0, iCols).WrapText = True xlWorkSheet.Range("A2").Offset(iRows).Resize(1, iCols).Value = _ dt.Rows(iRows).ItemArray() xlWorkSheet.Range("A2").Offset(0, iCols).BorderAround() Next excelFile = "c:\exceltst.xls" xlWorkBook.Sheets("sheet1").SaveAs(excelFile) 4. How can I use VBA code here? 5. Here is my code so far: Private Sub ShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim xlApp As Excel.Application Dim xlWorkBook As Excel.Workbook Dim xlWorkSheet As Excel.Worksheet Dim misValue As Object = System.Reflection.Missing.Value Dim xlClApp As Excel.ApplicationClass Dim excelFile As String = " " Dim dt As DataTable Dim da4 As SqlDataAdapter cnn4 = New SqlConnection(connectionString) cmd4 = New SqlCommand("stored procedure name", cnn4) cmd4.CommandType = CommandType.StoredProcedure With cmd4 .Parameters.Add("@parm1", SqlDbType.VarChar).Value = strParm1 .Parameters.Add("@pa

    Visual Basic

  • visual bais output written to excel
    J jazzgirl

    I have the following excel 2003 formatting to ask: I am writing a Visual Basic.Net 2005 desktop application write out data from a sql server 2005 database to a excel 2003 spreadsheet. After you look at my questions you can see a portion of the code that I am currently working with. if you can answer any of the questions below, I would appreciate it. I would like to know how to change the following code to do the following: 1. I would like to have the center data in most of the columns including the column headers. 2. I would like to see all the data in all the cels including the column headers. 3. I would like the last column of the table to 'wraparound' to the next line and display no more that 75 to 100 characters in a line. (The last column is varchar(500) due to the messages that could be displayed.) 4. I would like the column headers to be BOLD and the font be Times new Roman and be able to control the font size. 5. I would like the detail lines to be Times New Roman in a regular font size. 6. Some of the column headers are larger than the detail column. Thus I need the column headers to wrap. Some of the column headers are larger four words long. Thus, I do not want the column headers to 'wrap' in the middle of a word. I would like the column headers only to wrap between words. Private Sub ShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim xlApp As Excel.Application Dim xlWorkBook As Excel.Workbook Dim xlWorkSheet As Excel.Worksheet Dim misValue As Object = System.Reflection.Missing.Value Dim xlClApp As Excel.ApplicationClass Dim excelFile As String = " " Dim dt As DataTable Dim da4 As SqlDataAdapter cnn4 = New SqlConnection(connectionString) cmd4 = New SqlCommand("stored procedure name", cnn4) cmd4.CommandType = CommandType.StoredProcedure With cmd4 .Parameters.Add("@parm1", SqlDbType.VarChar).Value = strParm1 .Parameters.Add("@parm2", SqlDbType.VarChar).Value = strParm2 End With da4 = New SqlDataAdapter(cmd4) da4.Fill(ds4) xlApp = New Excel.Application xlClApp = New Excel.ApplicationClass xlApp.Workbooks.Add() xlWorkBook = xlApp.Workbooks.Add(misValue) xlWorkSheet = CType(xlWorkBook.Sheets("sheet1"), Microsoft.Office.Interop.Excel.Worksheet) xlApp.Visible = False xlApp.ScreenUpdating = True dt = ds4.Tables(0) 'Add the column headings for the from the dataset Dim dc As DataColumn Dim

    Visual Basic

  • vb.net dataset object being exported and formatted in excel
    J jazzgirl

    I am writing a Visual Basic.Net 2005 desktop application that exports data to individual excel 2003 spreadsheets in separate workbooks. (The data is written to separate workbooks since the workbooks are emailed to different customers.) I am exporting all the data I want to the spreadsheets now. However, I would like to know how to do any of the following: 1. Put the column headers on to the top of each data column. 2. How to put report headers on the first 3 rows of each spreadsheet, 3. How to set the wraparound property one column in particular. I have one column that is varchar(500) and I want this column to wraparound. Thanks!

    Visual Basic

  • vb.net writes output to separate worksheets in separate workbooks
    J jazzgirl

    Dave Kreskowiak: Thank you for your immediate response. However my question is can I reuse the excel object embedded in the vb.net 2005 desktop application? I need to put the output from sql server 2005 on separate spreadsheets for different customers. To accomplish this tak, it looks like I need to close and reopen the excel object each time I need to write to a new excel worksheet. Thus is there a way that I could reuse the object? Thanks!

    Visual Basic csharp sales tutorial

  • vb.net writes output to separate worksheets in separate workbooks
    J jazzgirl

    I would like to know how to write out excel 2003 excel worksheets to separate files. Basically I need to write out each excel 2003 file generated by a vb.net 2005 desktop application to separate workbooks. Each separate worksheet is going to be email and encrypted for each customer. Thus I would appreciate any suggestions that you have how to accomplish this task. Thanks!

    Visual Basic csharp sales tutorial

  • vb.net pass paraqmeters to crystal reports
    J jazzgirl

    How should I pass 2 parameters from a vb.net 2005 windows application to a crystal report that is written in version 11? I am working on a Visual Basic.NET 2005 windows application. This application needs to call an existing crystal report written in version 11 and needs to pass two (2) parameters to the crystal report. When I step though the code I think I am passing the first parameter, and I know that I am not passing the second parameter. I am getting an error message on the second when I step though the code. My code is basically the following (except I do not know how to code the second parameter) mports CrystalDecisions.Shared Imports CrystalDecisions.ReportSource Imports CrystalDecisions.Windows.Forms Imports System.Data.SqlClient Public Class vbCls Dim cryRpt As New ReportDocument Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cryRpt As New ReportDocument Dim sql As String Dim connetionString As String Dim connection As SqlConnection Dim adapter As SqlDataAdapter Dim ds As New DataSet Dim i As Integer 'located crystal report from Dim strReportPath As String = "C:\TstReport.rpt" connetionString = "Data Source=server3;Initial Catalog=ProgTest;User ID=xxx;Password=xxxx" connection = New SqlConnection(connetionString) sql = "select * from test_table" Try connection.Open() adapter = New SqlDataAdapter(sql, connection) adapter.Fill(ds) connection.Close() cryRpt.Load(strReportPath) Dim crParameterFieldDefinitions As ParameterFieldDefinitions Dim crParameterFieldDefinition As ParameterFieldDefinition Dim crParameterValues As New ParameterValues Dim crParameterDiscreteValue As New ParameterDiscreteValue crParameterDiscreteValue.Value = 12345 crParameterFieldDefinitions = _ cryRpt.DataDefinition.ParameterFields crParameterFieldDefinition = _ crParameterFieldDefinitions.Item("@Id") crParameterValues = crParameterFieldDefinition.CurrentValues crParameterValues.Clear() crParameterValues.Add(crParameterD

    Visual Basic csharp database help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups