|
Dear Sir
I have designed 20 textboxes in Form1 and i have set some formulaes for the result.
so i wanted to see the 20 textboxes values and result textboxs values in print preview.
for example
Project Calculation Report No.XXXX Page1
Date:DDMMYYYY
Project:XXXXXXXXXXXXX
input Data
___________________________________________________________
Textbox1 Textbox2 Textbox3 Textbox4
Textbox5 Textbox6 Textbox7 Textbox8
Textbox9 Textbox10 Textbox11 Textbox12
Textbox13 Textbox14 Textbox15 Textbox16
Textbox17 Textbox18 Textbox19 Textbox20
____________________________________________________________
Result
Textbox21 Textbox22 Textbox23 Textbox24
_____________________________________________________________
Kindly Help me
|
|
|
|
|
OK, what are you using to generate this report??
|
|
|
|
|
I dont know,how to do it
can you please advise me ,what i have to use to generate the report
|
|
|
|
|
You might want to try CrystalReports.
|
|
|
|
|
I could really use some help with this. I have tested it and refined it a bit and it doesn't work and I need some help. It is in a BG worker. Here is the complete code. Need to try to get this done ASAP.
Public Class prnProcessing
Dim WshNetwork = CreateObject("WScript.Network")
Public arrInstalled As New ArrayList()
Dim WithEvents ToDoWork As New System.ComponentModel.BackgroundWorker
Public Sub prnProcessing_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If prnSelection.arrToInstall.Count > 0 Then
'added 10-2-08
prnProgress.Style = ProgressBarStyle.Continuous
'prnProgress.Dock = DockStyle.Bottom
prnProgress.Visible = False
prnProgress.Minimum = 1
prnProgress.Maximum = prnSelection.arrToInstall.Count
'end add 10-2-08
ToDoWork.WorkerReportsProgress = True
ToDoWork.WorkerSupportsCancellation = True
ToDoWork.RunWorkerAsync(prnSelection.arrToInstall)
Me.CenterToScreen()
Else
MsgBox("There are no printers to install. Please choose the printers you wish to install.")
prnSelection.Show()
Me.Close()
End If
End Sub
Public Sub ToDoWork_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles ToDoWork.DoWork
Dim worker As System.ComponentModel.BackgroundWorker = CType(sender, System.ComponentModel.BackgroundWorker)
If e.Argument IsNot Nothing AndAlso TypeOf (e.Argument) Is ArrayList Then
Dim arrToInstall As ArrayList = e.Argument
If arrToInstall.Count > 0 Then
Dim i As Integer = 1
For Each printer As String In arrToInstall
CallByName(Me, printer, CallType.Method)
worker.ReportProgress(i)
i += 1
System.Threading.Thread.Sleep(200)
Next
End If
End If
End Sub
Public Sub ToDoWork_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles ToDoWork.ProgressChanged
prnProgress.Visible = True
prnProgress.Value = e.ProgressPercentage
End Sub
Public Sub PrinterProgress(ByVal i As Integer, ByVal worker As System.ComponentModel.BackgroundWorker, ByVal e As System.ComponentModel.DoWorkEventArgs)
worker.ReportProgress(i)
End Sub
Public Sub ToDoWork_EndProgress() Handles ToDoWork.RunWorkerCompleted
ToDoWork.Dispose()
prnWrapup.Show()
Me.Close()
End Sub
Public Sub CSE211CLQ()
MsgBox("Does it start??", vbOK)
'arrInstalled.Add("CSE-211-CLQ")
WshNetwork.AddWindowsPrinterConnection("LPR", "\\at-cetus.ad.ufl.edu\CSE-211-CLQ", "True")
MsgBox("Did it install??", vbOK)
Shell("net stop spooler")
Shell("net start spooler")
Shell("rundll32 printui.dll, PrintUIEntry /if /b ""test_1/"" /f ""C:\7760.inf\"" /q /r ""at-cetus.ad.ufl.edu:CSE-211-CLQ/"" /m ""Xerox Phaser 7760GX PS"" /z /u")
MsgBox("Did it install??", vbOK)
End Sub
End Class
I have added two msg boxes before and after and when it gets to the WshNetwork line it just conks out and quits the bg workers and goes to the next form without showing the next msgbox or doing anyother thing. How do I get this to work.
|
|
|
|
|
Trey5498 wrote: WshNetwork.AddWindowsPrinterConnection("LPR", "\\at-cetus.ad.ufl.edu\CSE-211-CLQ", "True")
I don't know if it'll work on a background thread, but that's what I'm looking at.
The arguments you're passing to AddWindowsPrinterConnection are wrong. It's the printer path that goes first (you have it second), then the driver name to use (which you don't specify). On NT Kernel Windows, the third parameter ("True" isn't exactly a valid port name!) is ignored.
|
|
|
|
|
I am trying to get it to be used on the LPR port. How do I get that to work assuming that the fixed line would be:
WshNetwork.AddWindowsPrinterConnection("at-cetus.ad.ufl.edu\CSE-211-CLQ", "Xerox Phaser 7760GX PS", CSE-211-CLQ")
given the following
Port: LPR
Server providing LPD: at-cetus.ad.ufl.edu
Queue Name: CSE-211-CLQ
|
|
|
|
|
You can try this. There's no guarantee that this will work for you.
WshNetwork.AddWindowsPrinterConnection("\\at-cetus.ad.ufl.edu\CSE-211-CLQ", "Xerox Phaser 7760GX PS", "LPR")
|
|
|
|
|
It installed the printer, however it did not create or even use the LPR port. Please how do I direct the driver to a server side .inf file?
and it does seem to work in the BG worker
|
|
|
|
|
Then you're going to have to use WMI to create the connection. It appears that the documentation is correct and the port parameter is ignored on NT/2000 kernel systems.
I don't know the exact process to go through, but you can do the research on it by reading up on the WMI class "Win32_Printer".
|
|
|
|
|
I have to register a .dll, I was using the following code
Imports System.ComponentModel
Imports System.Configuration.Install
Public Class Installer1 ()
Public Sub New ()
MyBase.New ()
InitializeComponent ()
End Sub
Public Overrides Sub Commit(ByVal savedstate As System.Collections.IDictionary)
MyBase.Commit (savedstate)
Dim RegAddin As New Process
RegAddin.StartInfo.FileName=My.Application.Info.DirectoryPath + "\FeatureRName.Bat"
RegAddin.Start ()
This shows the command window with running but the action was not done
the bat file contains
c:\Windows\Microsoft.Net\Framework\v2.0.50727\regasm /codebase FeatureRname.dll
if I run the same bat file manually it works good
Is there any other method to avoid using the bat file and using the code directly in the Installat class
Saseendran Kombath
|
|
|
|
|
You're only running a single command, so why are you using a batch file and not running the command line that it's holding directly using the Process class?
|
|
|
|
|
I have tried to use like below but it is not working
process.start("c:\windows\microsoft.net\framework\v2.0.50727\regasm.exe /codebase " & chr(34) & my.application.info.directorypath & "RenameFeature.dll" & chr(34)
this gives an error
Please help on this
Saseendran Kombath
|
|
|
|
|
Tha'ts because you tried to launch the entire command line as the executeable and didn't supply an argument parameter. Read up on the Process class instead of guessing at things. You'll get alot farther, faster, if you know how it works and what the different overloads of the Start method are.
It should look like this:
Process.Start("C:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm.exe", _
String.Format("/codebase ""{0}""", Path.Combine(My.Application.Info.DirectoryPath, "RenameFeature.dll")))
|
|
|
|
|
Thanks a lot
Saseendran Kombath
|
|
|
|
|
Hi,
i am binding a data grid using an openfiledialoge control, which read the columns from an excel that the user has chose. There are a lot of unwanted headers coming in the grid when it binds, so how can i remove or hide them. I want to display only those headers that i have added in the columns of the data grid. Requesting your help in this matter. Thank's in advance.....
|
|
|
|
|
If you have defined the columns in advance, it may be that you are somehow resetting the GridColumnStyles collection in your code instead of just assigning a new data source using SetDataBinding.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Thanks for the help Mike, but i am not using setdatabinding. i am using oledb connection, i am using the default view of the data table. i doubt if it has something to do with the default view of data table. why i have this doubt is till i select an excel only those columns that i have defined are shown in the grid but once i select the excel then columns like table_name, data type, isnull(checkbox) etc are shown in the grid. I want to remove or hide these columns.
|
|
|
|
|
Hmm, SetDataBinding is a method for DataGrid class regardless where you get the data from (it could be oledb, file etc). DataView is a valid argument for SetDataBinding and if no columns are defined in the grid before binding is done, all the columns in DataView are shown. You can either loop them through and remove those not needed or define columns in forehand.
Perhaps if you could post the code where the problem is, it would be easier to see the cause.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
oki Mike, but still i have not used the SetDataBinding method. Could you tell me how do i got about and loop through it??
|
|
|
|
|
Private Sub ofdExcelReader_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ofdExcelReader.FileOk
Dim DataViewExcel As DataView
txtTempXls.Text = ofdExcelReader.FileName
DataViewExcel = FillDataSet()
If (DataViewExcel.Table.Rows.Count < 1) Then
MsgBox("This Sheet Is Empty. Please Select Another Sheet", MsgBoxStyle.OkOnly)
Else
dgvExcelColumn.DataSource = DataViewExcel
dgvExcelColumn.AutoResizeColumn(0)
dgvExcelColumn.AutoResizeColumn(1)
'Me.dgvExcelColumn.Columns(0).Visible = False
End If
End Sub
Mike this the code tht i use to read t excel into th grid n i am using visual studio 2005
|
|
|
|
|
Okay,
First thing: You are obviously using DataGridView, not DataGrid as your original post implied. For this reason my earlier replies are useless.
Second: In DataView, include only those columns you need to show, nothing else. This automatically solves the displaying problem for DataGridView
If you must have unnecessary columns in the DataGridView for some reason (there should be none), but you want to hide them, you can refer to those columns with the column name in DataView. For example: Me.dgvExcelColumn.Columns("NotNeededColumnName").Visible = False
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
First of all sorry for late reply.....thank you very much one n all for th help provded. i used th following code to remove the extra columns.
DataViewXls.Table.Columns.Remove("TABLE_CATALOG")
|
|
|
|
|
You're welcome Glad you got it solved.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi
try this .
**********************************************
Me.dgView.Columns(0).Visible = False
***********************************************
hope this helps
Anoop
|
|
|
|