|
This error raises when you use installed application? If yes, have yo included Crystal Reports Merge Module? If not you, the cause maybe this.
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Hi,
Sorry I was out of town.
Actually this error occur when the report is generated not at the time of installation. I was working fine but as the system reboots this problem occurs at the time of report generation.
Regards,
rahul saini
|
|
|
|
|
public ArrayList listcht = new ArrayList();<br />
byte[] comparar = new byte[10];<br />
<br />
comparar[0] = 0x57;<br />
comparar[1] = 0x33;<br />
comparar[2] = 0x58;<br />
comparar[3] = 0x20;<br />
comparar[4] = 0x56;<br />
comparar[5] = 0x69;<br />
comparar[6] = 0x73;<br />
comparar[7] = 0x69;<br />
comparar[8] = 0x6f;<br />
comparar[9] = 0x6e;<br />
listcht.Add(comparar);<br />
<br />
<br />
comparar[0] = 0x57;<br />
comparar[1] = 0x33;<br />
comparar[2] = 0x58;<br />
comparar[3] = 0x31;<br />
comparar[4] = 0x76;<br />
comparar[5] = 0x73;<br />
comparar[6] = 0x31;<br />
comparar[7] = 0x48;<br />
comparar[8] = 0x61;<br />
comparar[9] = 0x63;<br />
listcht.Add(comparar);<br />
<br />
comparar[0] = 0x57;<br />
comparar[1] = 0x33;<br />
comparar[2] = 0x58;<br />
comparar[3] = 0x43;<br />
comparar[4] = 0x75;<br />
comparar[5] = 0x73;<br />
comparar[6] = 0x74;<br />
comparar[7] = 0x6f;<br />
comparar[8] = 0x6d;<br />
comparar[9] = 0x4b;<br />
listcht.Add(comparar);<br />
}
The problem here is the comparar[] array byte can't assign the new values
why? they maintaine the old values.
well, the sort soluction is redeclare the array
|
|
|
|
|
When you add the array to the list, it's not copied. The list is just a list of references, and you add the reference to the array, not a copy of the array.
You add the same array three times to the list, so all the items in the list will be the same actual array. When you change the contents of the array, it will change the contents of all items in the list, as they are all the same object.
---
single minded; short sighted; long gone;
|
|
|
|
|
Good Day Gents/Madam,
I am wondering if there is a way to convert a certain file(.EXE,.JPG) to Binary/Byte and put them back together?
For example, I have a certain Picture.jpg. I want to convert it to binary/Byte, and save it as a TEXT FILE. Now I want to take that TEXT FILE and convert it back to JPG.
Is this possible? If it is, is the proccess of converting a JPG similar to converting other file types like .EXE?
Thank You for your time.
-- modified at 1:51 Saturday 13th October, 2007
|
|
|
|
|
Ian Uy wrote: I am wondering if there is a way to convert a certain file(.EXE,.JPG) to Binary/Byte and put them back together?
Yes, use CopyFile(...)[^] the new copy of the file is converted into binary. To convert back to .exe or .jpg format use CopyFile(...) in reverse.
|
|
|
|
|
I was thinking of doing some manipulations with the byte/binary stream before saving them as a text file.
So I need to have them in the memory or in a Byte type.
|
|
|
|
|
Ian Uy wrote: So I need to have them in the memory or in a Byte type.
As Mav said all files are written in bytes. I suggest you study the subject of files more to gain a better understanding.
|
|
|
|
|
Hi!
Not quite sure what you mean by "Binary/Byte" - every file (no matter if it is a jpg or a doc or something else) is just a bunch of bytes in a certain order.
The only meaning implied on this stream of bytes is the one given by applications that can interprete the data in a given way.
When you try to load a .doc file into your favourite image processor (probably having to rename the file to do so), it'll choke on the data because it cannot be interpreted as an image.
Anyway, you can read any file into a byte array using classes from the System.IO namespace and then get a base64 string from this array using Convert.ToBase64String() .
This base64 string is something you can write to a text file (i.e. a file with all of its bytes in the limited range of printable characters).
The way back is straightforward: Read the base64 string from the text file, convert it to a byte[] with Convert.FromBase64String() and write the array to a binary file.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thanks for the reply.
I meant about the Byte/Binary is the Byte data type.
What I want is to convert a FILE to Byte, meaning instantiate the Byte data type with the contents of the File. Like:
Byte[] ByteArray = [Byte_of_File] //Is this even possible O_o?
I want it this way because I want to do some modifications on the Byte_of_File itself and after some modifications, I want to write it as a text file. (Filestream?)
After that, I want to reverse the process by reading the text file(Filestream), saving the contents of the text file to a ByteArray, undoing the modifications, and export them back as a workable file.
Am I talking junk or is this possible?
Thank You
|
|
|
|
|
Ian Uy wrote: Am I talking junk
Yes
|
|
|
|
|
Ouch.
But Sir, is this possible to do even it its "junk"?
Thanks.
|
|
|
|
|
You can READ bytes from a file. There's no conversion.
Simply use "byte[] byteArray = System.IO.File.ReadAllBytes(fileName);".
|
|
|
|
|
Thanks for the reply.
How can I do the reverse proccess? I mean, from byte to file. Thanks.
|
|
|
|
|
Perhaps there is a method with a name that is the opposite of Read . Write perhaps?
|
|
|
|
|
Ian Uy wrote: I am wondering if there is a way to convert a certain file(.EXE,.JPG) to Binary/Byte
The files are already binary data. All files are always binary data, even text files are binary data. It's only when you read a text file as text that it becomes text, otherwise it's only bytes.
Reading a file is quite easy:
byte[] data = File.ReadAllBytes(@"c:\test.jpg");
Ian Uy wrote: For example, I have a certain Picture.jpg. I want to convert it to binary/Byte, and save it as a TEXT FILE.
You can't save binary data as text. If you want the binary data as text, you have to convert it, for example using base 64:
string dataText = Convert.ToBase64String(data);
Each character (which is a 16 bit unicode character) now contains 6 bits of information. Now you can save the string as a text file.
(Note that the text will be encoded to binary format (usually using utf-8 encoding) when saved as a file, as files always are binary.)
When you have read back the text file as a string, you can convert it back to the original data:
byte[] data = Convert.FromBase64String(dataText);
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you for the reply Sir Guffa.
Now that I have the data back to byte array. By using this:
byte[] data = Convert.FromBase64String(dataText);
How can I turn it back to c:\test.jpg
Thank you again.
|
|
|
|
|
Take a look at the File.WriteAllBytes method.
---
single minded; short sighted; long gone;
|
|
|
|
|
I have written a report to print labels which works quite well as long as a full sheet is to be printed. Unfortunately in the real world people rarely print full sheets of labels. Instead they need to be able to specify a column and row to begin printing.
The label report is actually a horizontal report that prints three rows then moves to the next column prints three rows and so on. The names and addresses are pulled from a SQL Server 2005 database.
Is there a way to send printer codes to the printer to position the print head before printing begins?
I've even thought about using dummy records to get the printer to skip to the right record, but I'm not sure how to do that or if it would even work.
Any suggestions are appreciated.
|
|
|
|
|
Roger CS wrote: Any suggestions are appreciated.
I suggest you do some reading about how to do printing[^]
|
|
|
|
|
Anyone here who actually knows how to do what I'm asking about?
|
|
|
|
|
Your description isn't very clear, so I'm guessing at it too. How about this[^].
|
|
|
|
|
Dave Kreskowiak wrote: Your description isn't very clear
I’ll try to be clearer. I am printing mailing labels. The sheet of labels has 3 columns and 10 rows (for a total of 30 labels). Normally people don't need to print exactly 30 labels or multiples of 30. Instead they may need to print 10, then later 6 more and so on. If the user starts with a fresh sheet and prints 10 labels, there will be 20 labels remaining. The next time the user prints labels they need to start printing at label 11. For this reason, the program allows the user a way to enter the row and column at which to start printing labels. In this case the user would enter row = 4 and column = 2.
I want to know how to start printing labels at row 4, column 2.
The information in the labels is pulled from a SQL Server 2005 database using a select query.
Thanks for the pointer to the KB article!
Roger
-- modified at 17:35 Saturday 13th October, 2007
|
|
|
|
|
led mike wrote: I suggest you do some reading about how to do printing
Yup, you were right. Everything I needed to know was there... I just had to extend PrintDocument and add some functionality.
Thanks,
Roger
|
|
|
|
|
Roger CS wrote: Thanks
See I did actually now something about it
Seriously though, one can never go wrong reading documentation. Even if it does not present your immediate solution you still gain knowledge.
|
|
|
|