|
Hey u can connect the database and assign the field to the text or label in report. sorry in my system no backend software. It works I tried previous. Before doing formatting system.
|
|
|
|
|
hi, I,m trying to create a hierarchical view of the data in my database using a gridview but the problem is every time I load the data to the gridview, they will just file in single line. Can you help me to arrange my data in a hierarchical form?
thank a lot.
|
|
|
|
|
You'll need a third party grid to do this. The DataGridView in the .NET Framework does not support this. I suggest looking into DevExpress' control sets.
|
|
|
|
|
actually if I understand what he means with hierarchical gridview it is possible although not easy.
have a look at this
http://blogs.msdn.com/markrideout/archive/2006/01/08/510700.aspx
I never understood why the old datagrid control supported this and the new datagridview doesn't, but I guess that's microsoft.
But as you suggested the DevExpress controls are easyer to use and have alot more options.
|
|
|
|
|
Tom deketelaere wrote: I never understood why the old datagrid control supported this and the new datagridview doesn't, but I guess that's microsoft.
Yeah, I couldn't figure that one out either, and here we are, on the cusp of .NET 4.0 and we still can't do it easily.
Tom deketelaere wrote: But as you suggested the DevExpress controls are easyer to use and have alot more options.
It's much easier to do it with a control that was designed for it from the start than to hack it together.
|
|
|
|
|
Dave Kreskowiak wrote: It's much easier to do it with a control that was designed for it from the start than to hack it together.
True. I actually started to make my own custom grid control (based on the standerd gridview ofcourse), I didn't get far.
I'v been using the devexpress controls for olmost a year now and I have to say there very easy to use (once you understand how they work) and very extended, I fear I'v only scratched the surfice.
|
|
|
|
|
you can try this method. take max. column in datagridview and make visible false and load the data into last col. then u can use visible option true when u increase the hierarchical view. Sorry for any grammar mistake.
|
|
|
|
|
Hi
I want to load a word document into RTF control in VB.Net.I used Loadfile()method, its load only richtextfiles into RTF.But i want to load only .doc files.Any idea...?
Thanks in advance...
|
|
|
|
|
You can't. You need Word on the machine you want to use to load the document, and then you can interact with Word, perhaps to convert the file to RTF and thus be able to load it. Or you can buy a third party control.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
There is one 3rd party control called DSOFramer.cab from Microsoft only, you can load all office components in to it as excel, word etc.
I guess it should be free from micro soft site, check with that.
As it is developped by Microsoft it will work only on IE.
If you want any more components similar to it, you can go for Aspose an Australian company product. But with aspose everything is good it is browser independent, but the problem is you have to define the template document and then fill the data by using code. You can define the template structure by using aspose code.
Try with which you find convenient.
Thanks,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Hi All,
I got solution to this...My code is,
Imports System.IO
Imports System.Runtime.InteropServices
Dim FilePath As String
Dim objWord As Object
Dim objDoc As Object
objWord = CreateObject("Word.Application")
FilePath = ("C:\Documents and Settings\Administrator\Desktop\Resume2.doc")
objDoc = objWord.Documents.Open(FilePath, , True, , , , , , , , , False)
objDoc.Select()
RTB.Text = objWord.Selection.Text
objDoc.Close()
objWord.Quit()
It shows my .doc file into RTB.
|
|
|
|
|
This works, but you lose all the formatting and bullet points. All you're getting is the unformatted text, nothing else.
|
|
|
|
|
How can I say get the first x cells in an excel sheet where all you know is the row?
Ie get sum of first x cells starting at cell y?
|
|
|
|
|
I'm not sure what you're after, but using Rows method you can select an entire row. For example:
Application.ActiveSheet.Rows("1:1").Select
After that you can iterate through the Range object using Application.Selection .
Hopefully this gets you forward.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
I have a process whereas I need to save a string from a textbox to a temp file and then hashing the file via SHA1. I have that handled but when I create the file and write the data to the file
"08 39 01 62 30 21 12 69 09"
it is written in ascii and I need it written in hex as is. So if you opened the file up in a hex editor you would see "08 39 01 62 30 21 12 69 09" with the ascii as .9.b0!.i. .
Currently I am only getting 30382033392030312036322033302032312031322036392030390D0A
as my hex string in the hex editor and obviously hashing that value will not match the hash of h08 h39 h01 h62 h30 h21 h12 h69 h09
Thanks for any and all help.
Celldet
|
|
|
|
|
A quick look at an ASCII table reveals that you have "08 39..." as a string variable. So of course when you write the string to the file, you get the string in the file. If you want to store the bytes represented by the string, you will need to parse it yourself. I would start with String.Split and Byte.Parse with a parameter of System.Globalization.NumberStyles.AllowHexSpecifier and a BinaryWriter.
|
|
|
|
|
Worked out great!!!! Thanks for the pointing to the right direction.
|
|
|
|
|
Hi,
can anyone help me to compress and decompress a text file(.txt) using VB.NET.
I tried but i got error msg as "Magic number in GZip header is INCORRECT".
|
|
|
|
|
thiru_5862 wrote: can anyone help me to compress and decompress a text file(.txt) using VB.NET.
I tried but i got error msg as "Magic number in GZip header is INCORRECT".
You tried with what code??
|
|
|
|
|
Hi Dave.. The code which i use to decompress the file is given below.. Am getting the error "Magic number in GZip header is INCORRECT".
dim source_file as string = "c:/Compressed.txt"
dim destination_file as string = "c:/Decompressed.txt"
Dim sourceFile As FileStream = File.OpenRead(source_file)
Dim destinationFile As FileStream = File.Create(destination_file)
destinationFile.Close()
Dim ms As New MemoryStream()
Dim zipStream As New DeflateStream(ms, CompressionMode.Decompress)
Dim decompressedBuffer(3500) As Byte
System.IO.File.WriteAllBytes(destination_file, decompressedBuffer)
'end writing
'Because the uncompressed size of the file is unknown,
'we are imports an arbitrary buffer size.
Dim buffer(4096) As Byte
Dim n As Integer
Using input As New GZipStream(source_file, _
CompressionMode.Decompress, False)
Console.WriteLine("Decompressing {0} to {1}.", source_file.Name, _
destination_file.Name)
n = input.Read(decompressedBuffer, 0, decompressedBuffer.Length)
destination_file.Write(decompressedBuffer, 0, n)
End Using
'Close the files.
source_file.Close()
destination_file.Close()
|
|
|
|
|
|
Sorry Dave.. I gave the old code .. Below u can find the latest code i use. In the below code.. am getting the exception(Magic number in GZip header is INCORRECT) in line
n = input.Read(decompressedBuffer, 0, decompressedBuffer.Length)
'Compressed File path
dim comp_file as string = "c:/compressed.txt"
'File to which decompressed contents has to be written
dim dest_file as string ="c:/decompressed.txt"
Dim sourceFile As FileStream = File.OpenRead(comp_file)
Dim destinationFile As FileStream = File.Create(dest_file)
destinationFile.Close()
Dim ms As New MemoryStream()
Dim zipStream As New DeflateStream(ms, CompressionMode.Decompress)
Dim decompressedBuffer(3500) As Byte
System.IO.File.WriteAllBytes(dest_file, decompressedBuffer)
'end writing
'Because the uncompressed size of the file is unknown,
'we are imports an arbitrary buffer size.
Dim buffer(4096) As Byte
Dim n As Integer
Using input As New GZipStream(sourceFile, _
CompressionMode.Decompress, False)
Console.WriteLine("Decompressing {0} to {1}.", sourceFile.Name,_
destinationFile.Name)
n = input.Read(decompressedBuffer, 0, decompressedBuffer.Length)
destinationFile.Write(decompressedBuffer, 0, n)
End Using
'Close the files.
sourceFile.Close()
destinationFile.Close()
|
|
|
|
|
This is a bit of spaghetti code, it's a little hard to follow. But, from what I can tell, you're trying to decompress a normal text file, which won't work and would explain the error you're getting. We can't really tell because we don't know the contents of "C:\compressed.txt". Also, forward slashes, in Windows, are used to denote command line paramters, not file paths. I suggest getting into the habit of specifying filepath with backslash's, "\".
|
|
|
|
|
Hi.. thanks for suggesstions.. can u suggest any code that i can use to compress and decompress a text file.
|
|
|
|
|
I dont' have any and don't have the time right now to create an example.
You've got the basic building blocks. You just need to examine your code, and especially the documentation on the zip stream classes, and lay out what you need to do, step-by-step. Just work on compressing a text file to another file first. Once that's done, then you can worry about uncompressing it.
|
|
|
|