|
You may use a link with href something like this one:
< a href = "Form1.submit()" > [Your text] < / a >
I dont know whether it is a good solution b ut I got the same problem like you before.
Hope it helps,
|
|
|
|
|
Hello guys..
I want to create a setup file for my application thats is done vs 2005..
how do i compile the crystal report information to the setup file
cause now when i run the report from my application after setup the is error
itried to copy manually the dll into the directory.. still cannot
diff error come out saying that.. the file to something i n registery..
now i'm a hurry so pls help...
thanks
|
|
|
|
|
To deploy your application, you need to create a setup project and add the necessary merge modules to your application before you build your solution.
Open your Windows application.
In the Solution Explorer, right-click your Windows application solution, point to Add then click New Project.
In the Add New Project dialog box, select Setup and Deployment Projects in the Project Types pane and select Setup Project in the Templates pane. Click OK.
In the Solution Explorer, right-click the Setup Project, point to Add then click Project Output.
In the Add Project Output Group, select Primary output and click OK. Any dependencies, such as the Managed.msm, are added automatically.
In the Solution Explorer, right-click the Setup Project, point to Add then click Merge Module.
In the Add Modules dialog box, select the following merge modules to add to your Setup project and click Open:
Database_Access.msm
Database_Access_enu.msm
regwiz.msm
For a description of these merge modules see Crystal Reports Merge Modules (ms-help://MS.VSCC/MS.MSDNQTR.2003JAN.1033/crystlmn/html/crconcrystalreportsmergemodules.htm). Note If you deploy a Windows application that uses an ADO .NET dataset, you also need to include the VC_CRT and VC_STL merge modules.
In the Solution Explorer, right-click the regwiz.msm file and choose Properties.
In the Properties window, expand MergeModuleProperties and enter a valid license key in the License Key properties box. Note Providing the license key is a mandatory step whenever you deploy a Crystal Reports for Visual Studio .NET application. A license key will be given to you once you have registered Crystal Reports for Visual Studio .NET. You can find the license key in the About dialog box. From the Help menu, choose About Microsoft Development Environment. The keycode is listed in the Installed Products field.
From the Build menu, choose Build Solution to build your application. When deploying to a client or server computer.
karim ben romdhane Tunisia
As I grow up I pay less attention to what men say, I just watch what they do.
|
|
|
|
|
thanks for the reply
it works now
|
|
|
|
|
hello,
The code shown below is for excel sheet generation but when i execute this i am getting an error as access is denied .plz go though the code and if any mistake plz correct it ....
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
da1.MissingSchemaAction = MissingSchemaAction.AddWithKey
CMD.Connection = con
con.Open()
CMD.CommandType = CommandType.StoredProcedure
CMD.CommandText = "ACE_CONTROLTOWER"
Dim cellid As New SqlParameter
Dim fromDATE As New SqlParameter
'Dim tomonth As New SqlParameter
'Dim fromyear As New SqlParameter
Dim toDATE As New SqlParameter
cellid.ParameterName = "@CELLID"
cellid.SqlDbType = SqlDbType.VarChar
cellid.Value = TextBox1.Text
cellid.Direction = ParameterDirection.Input
CMD.Parameters.Add(cellid)
fromDATE.ParameterName = "@fromDATE"
fromDATE.SqlDbType = SqlDbType.DateTime
fromDATE.Value = TextBox2.Text
fromDATE.Direction = ParameterDirection.Input
CMD.Parameters.Add(fromDATE)
toDATE.ParameterName = "@toDATE"
toDATE.SqlDbType = SqlDbType.DateTime
toDATE.Value = TextBox5.Text
toDATE.Direction = ParameterDirection.Input
CMD.Parameters.Add(toDATE)
Dim dr As SqlDataReader
dr = CMD.ExecuteReader()
DataGrid2.DataSource = dr
DataGrid2.DataBind()
dr.Close() 'closing data reader
CMD.Dispose()
con.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
bln = CreateExcelWorkbook("example")
'= Server.MapPath(".") + "\PWReports\"
filePath = "c:\"
filename = "example"
filePath = filePath & filename & ".xls"
Dim MyFileStream As FileStream = New FileStream(filePath, FileMode.Open)
Dim FileSize As Long
FileSize = MyFileStream.Length
Dim Buffer(FileSize) As Byte
MyFileStream.Read(Buffer, 0, MyFileStream.Length)
MyFileStream.Close()
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition", "attachment; filename=" & filename & " .xls")
Response.BinaryWrite(Buffer)
End Sub
Public Function CreateExcelWorkbook(ByVal strFileName As String) As Boolean
Dim oXL As Excel.Application
Dim oWB As Excel._Workbook
Dim oSheet, oSheet1, oSheet2 As Excel._Worksheet
Dim oRng As Excel.Range
filePath = "c:\"
filename = "example"
'Dim strCurrentDir As String
'strCurrentDir = Server.MapPath(".") + "\PWReports\"
Try
GC.Collect() '// clean up any other excel guys hangin' around...
oXL = New Excel.Application
oXL.Visible = False
'//Get a new workbook.
oWB = CType(oXL.Workbooks.Add("WorkBook"), Excel._Workbook)
oSheet = CType(oWB.Sheets("sheet1"), Excel._Worksheet)
oSheet.Name = "controltower"
oSheet.Range("A1", "O1").Font.Name = "Arial"
oSheet.Range("A1", "O1").Font.Size = 13.5
oSheet.Range("A1", "O1").Font.Color = RGB(255, 0, 0)
oSheet.Range(oSheet.Cells(1, 1), oSheet.Cells(1, 2)).Merge()
oSheet.Range(oSheet.Cells(1, 1), oSheet.Cells(1, 2)).Interior.Color = RGB(255, 255, 153)
oSheet.Range(oSheet.Cells(1, 1), oSheet.Cells(1, 2)).Value = "Infotech LCS Report : "
oSheet.Range(oSheet.Cells(1, 1), oSheet.Cells(1, 2)).Borders.ColorIndex = RGB(0, 0, 0)
oSheet.Range(oSheet.Cells(1, 1), oSheet.Cells(1, 2)).Font.Color = RGB(0, 0, 255)
oSheet.Range(oSheet.Cells(1, 1), oSheet.Cells(1, 2)).HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter
oSheet.Range("A1", "O1").Font.Bold = True
oSheet.Range("A1", "O1").VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
oXL.WindowState = Excel.XlWindowState.xlMinimized
oXL.Visible = True
oXL.UserControl = True
oSheet.Activate()
oXL.ActiveWindow.Zoom = 73
oSheet.Range("A4", "O4").Select()
oXL.ActiveWindow.FreezePanes = True
strfile = filename & ".xls"
Call RemoveFiles(filepath, strfile)
oWB.SaveAs(filePath + strfile, Excel.XlFileFormat.xlWorkbookNormal, Nothing, Nothing, False, False, Excel.XlSaveAsAccessMode.xlNoChange, False, True, Nothing, Nothing)
'// Need all following code to clean up and extingush all references!!!
oWB.Close(Nothing, Nothing, Nothing)
oXL.Workbooks.Close()
oXL.Quit()
Call KillProcess("EXCEL")
'System.Runtime.InteropServices.Marshal.ReleaseComObject(oRng)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oXL)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet1)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet2)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oWB)
oSheet = Nothing
oSheet1 = Nothing
oSheet2 = Nothing
oWB = Nothing
oXL = Nothing
GC.Collect() '// force final cleanup!
'Dim strMachineName As String = Request.ServerVariables("SERVER_NAME")
'errLabel.Text = "Download Report"
Return True
Catch theException As Exception
Response.Write(Err.Description)
Response.End()
Dim errorMessage As String
errorMessage = "Error: "
errorMessage = String.Concat(errorMessage, theException.Message)
errorMessage = String.Concat(errorMessage, " Line: ")
errorMessage = String.Concat(errorMessage, theException.Source)
Call KillProcess("EXCEL")
'System.Runtime.InteropServices.Marshal.ReleaseComObject(oRng)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oXL)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet1)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet2)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oWB)
oSheet = Nothing
oWB = Nothing
oXL = Nothing
GC.Collect() '// force final cleanup!
Return False
End Try
End Function
'Removing Excel Files
Private Sub RemoveFiles(ByVal strPath As String, ByVal fileName As String)
Dim di As System.IO.DirectoryInfo = New DirectoryInfo(strPath)
Dim fiArr() As FileInfo = di.GetFiles()
Dim fri As FileInfo
For Each fri In fiArr
If (fri.Name.ToString() = fileName) Then
fri.Delete()
End If
Next
End Sub
'Killing The Process
Private Sub KillProcess(ByVal strPrc As String)
Dim myproc As System.Diagnostics.Process = New System.Diagnostics.Process
Dim i As Integer
''Get all instances of proc that are open, attempt to close them.
Try
' i = Process.GetProcessesByName(strPrc).Length
For Each myproc In Process.GetProcessesByName(strPrc)
If Not (myproc.CloseMainWindow()) Then
''If closing is not successful or no desktop window handle, then force termination.
myproc.Kill()
Exit For
End If
Next myproc
Catch
Response.Write(Err.Description)
End Try
End Sub
End Class
thanks & regards
nagalakshmi
|
|
|
|
|
hi!
as far as i think ur connection object is faulty create cnnection object with appropriate parameters.. like if u r using sqlconnection it would be
dim constr as string="server=[servername];user Id=[username/sa];password=[pwd/""]initial catalog=[database name];"
dim con as new sqlconnecton(constr)
better if u would send connecton code as well..
GoodLuck!!
Sufyan
|
|
|
|
|
Hi all
I have a confusion that weather user controls
can be added as a column of datagrid through datagrid TextBox Column
AS i made a user control but that is not added with its full functionalities in the datagrid.
means many properties are not working when i embed a user control inside datagrid Column.
Thanks in advanece
Hema Chaudhry
|
|
|
|
|
Hi all,
I want to add the ListView Control in the Combobox control of vb.net
as I want to show the multiple columns in the combo box
SO I want to achieve this functionality with list view
AS the user Click on down arrow of Combo Box
that will show the listview
populateListView()<br />
<br />
Me.ComboBox1.Controls.Add(listview1)
But I am Not Successful
Its very urgent for me
I will highly appreciate Any help
Thanks in advance
Hema Chaudhry
|
|
|
|
|
No need 2 create that its already there..
follow link
http://www.codeproject.com/vb/net/MultiColumnFlatCombo.asp
enjoy!!
Sufyan,
|
|
|
|
|
Thanks for reply
But I have seen these all links of multiColumnComboBox
They are not working with my datagrid
The link which u suggest has the limitation that it limits the Column Numbers (Only 4) for the MultiCOlCombo
http://www.codeproject.com/vb/net/MultiColumnFlatCombo.asp[^]
So I want to generate my own Control
So that that control can be embed with datagrid.
I think Controls can't be added with the DatagridTextBoxColumn
I m right/not????????
Hema Chaudhry
|
|
|
|
|
Hema!
i think u can add controls in data grid as i 've heared about this
and hve jsu added a lisbox in a grid it works..keep it up ..
Sufyan,
|
|
|
|
|
hi SUfyan,
Thanks for prompt reply,
Acutally i have craete a userControl in vb.net for multiColumn COmboBox
But when I embed that User Control that will not work???
But If i add a toolbox Contorl like CheckBox etc they are working fine with the datagrid.
So I find the conclussion that
1. There may the problem with my user control(Although its working fine on Form)But not with that datagrid.
2. There may a chance that the winforms datagrid may not support User Controls.????????????????
Hope for early relply
Thanks a lot
Hema Chaudhry
|
|
|
|
|
Well!
i think first problem option my b there otherwise if simple control gets added then user defined control should be added as well..
thanks
Sufyan,
|
|
|
|
|
|
Neither really. The StreamReader/Writer classes wrap the Win32 API functions.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Is there any tip regarding copying locked file? For example the outlook.pst file which is locked and user can not copy that if the outlook is open. Any tip/piece of code will be appreciated. Or is there any third party activeX/ .NET DLL for this purpose?
Thanks,
Sameers
http://www.developersinn.net
|
|
|
|
|
Nope. Locked is locked for a reason. There's no getting around it. Even reading the disk sectors the file is stored in won't help.
The best you can do is to try:
Dim fs As New FileStream("filename", FileMode.Open, _
FileAccess.Read, FileShare.Read)
and copy the file yourself. If this doesn't work, you're sunk.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well, think if I am writing something like backup service. I must then read the file(s) which are even locked or in-use.
as per the code snippet, it will allow you to open file, but you will not be able to read even a single byte as you will end with message something like this "Can not read. Part of the file is locked by some other process".
Still need to think....
thanks,
Sameers
http://www.developersinn.net
Need to get reminded for your outlook emails? try www.outlookpa.com
|
|
|
|
|
That's not going to happen using standard file I/O methods. You'll have to write a device driver to get access to the disk below where the file system starts. Search for a book called "NTFS Internals" for more information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sameers (theAngrycodeR ) wrote: think if I am writing something like backup service
Are you writing a backup service?
The reason applications can lock files, preventing other applications from reading the file, is that the file is most likely going to be in a state of flux. Any application that reads the file will not be able to determine if the file contents are safe or not because they are subject to change. You might read one part which is fine, then the next part which has changed and no longer makes sense when placed next to the first part.
Sameers (theAngrycodeR ) wrote: I must then read the file(s) which are even locked or in-use
I would suggest that makes for a bit of a dodgy backup. For example: SQL Server provides its own backup engine which creates a new file that is in a consistent state because you cannot safely perform a file backup directly from the filesystem.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
is that possible!:
i want to add a C# class to a VB.NET project
and use the C# class in VB class???
without making the C# class a DLL file?;)
Militiaware
Faris Madi
|
|
|
|
|
militiaware wrote: without making the C# class a DLL file?
You're only other option is to rewrite to code in VB. You can't use the C# code, without rewriting it, without compiling it into its own .DLL.
A single project cannot use more than one language, but a solution can contain multiple projects, each written in a different language.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hummmmn, why dont you compile that C# code at runtime and use that in your VB class? Does that make sense?
Need custom software? Contact DevelopersINN
Need to add reminders for your Outlook emails? Try Outlook Personal Assistant
|
|
|
|
|
if someone could tell me what is the DLL name used to deal with the desktop wallpaper.
thanx
Militiaware
Faris Madi
|
|
|
|
|
What exactly are you looking to do? The .DLL is user32 .
You're looking for the SystemParametersInfo[^] function.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|