RTF data in Crystal Report 13 with Data field - visual-studio-2013

I have problem to display RTF data in crystal report.My RTF data showing with formatting but data fields value not showing.
My RTF Data Below:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}}
{\colortbl ;\red0\green0\blue0;}
\viewkind4\uc1\pard\qc\cf1\ul\b\fs28 BLOOD GROUP\ulnone \fs24
\par \pard
\par
\par
\par \pard\tx2160\tx4320\tx6480\b0\tab ABO GROUP\tab \b :\b0 \tab\b\{bgrp\}
\par \pard\tx2160\b0
\par \pard\tx2160\tx4320\tx6480\tab Rh GROUP\tab \b :\b0\tab\b\{rh\}
\par
\par
\par
\par }
I need too show value but it showing {bgrp} and {rh} instead show the data like O Positive.I use vs2013 .
Please Help me.
Image

Related

How to send color images with ESC/POS?

I have an Epson CW-C6000 that I'm trying to control with ESC commands. I've gotten text to print, so I know I have the IP address, port, etc correct but cannot for the life of me get an image printed.
Here is my code (running from a Ruby on Rails server, with most of the image truncated):
streamSock = TCPSocket.new( "X.X.X.X", 9100 )
str = "~DYR:PRODIMG,B,P,183208,0,89504E470D...4AE426082" + "^XA" + "^FO150,150^IMR:PRODIMG.PNG^FS" + "^XZ"
streamSock.send( str , 0)
streamSock.close
The image is a .png I converted to hexadecimal with this site:
http://tomeko.net/online_tools/file_to_hex.php?lang=en
I'm mostly using page 10 of this PDF for reference:
https://files.support.epson.com/pdf/pos/bulk/esclabel_apg_en_forcw-c6000series_reve.pdf
Does anyone have a hint? Epson support staff was spectacularly unhelpful.
Also I'm sorry if my formatting is bad; I'm new here and will happily edit my post if something is wrong.
Alright I finally got it working. The command for printing a color .PNG is this:
~DYE:[Image Name].PNG,p,p,[Image Size],0,:B64:[Base64 String]:[CRC]
Things that tripped me up:
-You seem to need the .PNG extension on the file name, even though the Epson manual doesn't show that.
-[Image Size] is the number of characters in the Base64 string, even though the Epson manual says it should be the size of the original .PNG image file. If this is wrong the printer will hang and no longer accept input of any kind until restarted.
-There may be other options, but I could only get it working with a CRC of the hex CRC-16/XMODEM type.
Thanks to K J for his/her suggestions and coming along with me!
Perhaps this material can be used as an additional reference.
They seem to have a completely different command/data format than ESC/POS.
ESC/Label Command Reference Guide
Page 12
1.3.4 About Saving the Graphics and Label Formats in the Printer
With ESC/Label command, you can save graphics and label formats in the printer. The printer has a file system. Data saved in the printer is handled as files and is managed in the following way.
The file system does not have a hierarchy.
The printer has a non-volatile saving device, such as Flash ROM, and a volatile saving device, such as RAM, and different drive letters are allocated for each device.
Files are designated as
"<drive letter> colon <:> <file name> dot <.> <extension>".
Page 40-41
2.8 Printing Graphics
...Details have been omitted. Please refer to the actual document...
2.8.1 Registering a Graphic in a Printer and Printing It
...Pick up some from the content. Please refer to the actual document...
Delete the files that remain in the printer (^ID command).
Register the graphic in the printer (~DY command).
When registering a color graphic, you can use the PNG format. When registering a monochrome graphic, you can register the PNG format or the GRF format.
PNG format Monochrome and color graphics
GRF format Monochrome graphics
The reason to execute the step 1.
To ensure capacity of the storage memory necessary for print which application will perform.
2.8.2 Embedding a Graphic in the Field and Printing It
...Details have been omitted. Please refer to the actual document...
In Addition:
Page 104-106
~DY
[Name]
Save File
[Format]
~DY d: o ,f ,x ,t ,w ,data
...A table detailing the parameters is due, but omitted...
[Function]
...Further detailed explanations and figures of functions and parameters are due, but omitted...
Graphic data is handled as follows.
If the data format is binary, you can use any binary data as Parameter data. At this time, the size of Parameter data must be matched to the size specified in Parameter t.
If the data format is a hexadecimal character string, one character from 1. to 3. below is used as Parameter data. At this time, the size of Parameter data written in binary must be matched to the size specified in Parameter t.
0 to 9, A to F, and a to f in ASCII can be used as hexadecimal graphic data.
ASCII comma <,>, the parameter separator character, is used to separate lines. If a comma is input, processing is carried out as if ASCII 0 was input for the remainder of the line.
G to Y and g to z in ASCII can be used as repetition characters. For example, if I9 is input, processing is carried out as if 999 were input. The following table indicates the number of repetitions.
...Characters and repeat specified number of times table omitted...
Looking at the contents of this Technical Reference Guide, it seems that you can register images with tools instead of commands.
CW-C6000/C6500 Series Technical Reference Guide
Page 173-174
And page 288 outlines the Epson Inkjet Label Printer SDK and also describes the existence of sample programs.
#Farmbot26. I have been attempting this same using vb.Net and as you noted Epson support is not helpful. I'm not sure if it's the actual image data that is wrong, CRC, or the ZPL code as nothing helps. Here's 2 examples that have not worked.
`Dim binaryData As Byte() = System.IO.File.ReadAllBytes(txtPNGFile.Text)
zplImageData = Convert.ToBase64String(binaryData)
crc = calcrc(binaryData, binaryData.Length).ToString("X4")
Dim zplToSend As String = "~DYE:" & Path.GetFileName(txtPNGFile.Text).ToUpper & ",P,P," & zplImageData.Length & ",0,:B64:" & zplImageData & ":" & crc & "^XZ"`
`Dim binaryData As Byte() = System.IO.File.ReadAllBytes(txtPNGFile.Text)
crc = calcrc(binaryData, binaryData.Length).ToString("X4") 'Calculate CRC
zplImageData = BitConverter.ToString(binaryData).Replace("-", "")
Dim zplToSend As String = "~DYE:" & Path.GetFileName(txtPNGFile.Text).ToUpper & ",A,P," & zplImageData.Length & ",0,:B64:" & zplImageData & ":" & crc & "^XZ"`
This is the CRC example I have.
`Function calcrc(ByVal data() As Byte, ByVal count As Integer) As Integer
Dim crc As Integer = 0
For Each b As Byte In data
Dim d As Integer = CInt(b)
crc = crc Xor (d << 8)
For j = 0 To 7
If ((crc And &H8000) <> 0) Then
crc = (crc << 1) Xor &H1021
Else
crc = (crc << 1)
End If
Next
Next
Return crc And &HFFFF
End Function`
I have figured out another solution. Save the PNG Image using the Binary data. I found this when reading the Saved Backup file of Image data using the Epson Settings Utility.
~DYE:FILENAME.PNG,B,P,BINARYFILESIZE,0, BINARYIMGDATA
` Try
Dim binaryData As Byte() = System.IO.File.ReadAllBytes(txtPNGFile.Text)
Dim client As System.Net.Sockets.TcpClient = New System.Net.Sockets.TcpClient()
client.Connect(IP_TextBox1.Text.Replace(" ", ""), txtPort.Text)
Dim writer As System.IO.StreamWriter = New System.IO.StreamWriter(client.GetStream(), Encoding.UTF8)
Using mStream As New MemoryStream(binaryData)
Dim zplToSend As String = "~DYE:" & Path.GetFileName(txtPNGFile.Text).ToUpper & ",B,P," & mStream.Length & ",0,"
writer.Write(zplToSend)
writer.Flush()
mStream.WriteTo(client.GetStream())
writer.Flush()
End Using
writer.Close()
client.Close()
MsgBox("Send Complete", MsgBoxStyle.OkOnly, "Complete")
Catch ex As Exception
MsgBox(ex.Message.ToString, MsgBoxStyle.OkOnly, "ERROR")
End Try`
You can also open the image file in an IMAGE object and resize it as needed. I had to do this for the label size of the printer.

Where "character viewer" data is stored?

I need to parse all data from Character Viewer on Mac, how can I do it? Or where is it stored?
I need this format:
☀︎
BLACK SUN WITH RAYS
Unicode: U+2600 U+FE0E, UTF-8: E2 98 80 EF B8 8E
☼
WHITE SUN WITH RAYS
Unicode: U+263C, UTF-8: E2 98 BC
and so on.
Thanks!
In OS X El Capitan (Version 10.11.6), the "Character Viewer" data can be found inside the package of the "Character Palette" system application located at /System/Library/Input Methods/CharacterPalette.app, in the SQLite database file: /System/Library/Input Methods/CharacterPalette.app/Contents/Resources/CharacterDB.sqlite3.
You can use an appropriate application (such as DB Browser for SQLite) to open the database file and export its main table to a file in CSV format, then extract the data by yourself.
In JavaScript (Node.js), provided you already know how to read the file lines, that would be something like:
let lines =
[
"☼ WHITE SUN WITH RAYS|||||||||||||||",
"☀︎ BLACK SUN WITH RAYS|||||||||||||||",
"☀️ BLACK SUN WITH RAYS|||||||||||||||",
"☀ BLACK SUN WITH RAYS|||||||||||||||"
];
for (let line of lines)
{
let fields = line.split ('\t');
let characterSequence = fields[0];
let name = fields[1].split ('|')[0];
let codePoints = Array.from (characterSequence).map (char => "U+" + char.codePointAt (0).toString (16).toUpperCase ().padStart (4, "0")).join (" ");
console.log (characterSequence, name, "Unicode:", codePoints);
}
Notes:
The name of the main table (unihan_dict) is somehow misleading, but it contains data for all non-Unihan characters as well, with minimal information though.
The Unicode character codes are not stored in the database file, since this would be redundant, but they can be easily computed.

How to remove column header in csv output in BI publisher?

Hi I want to create a report in bi publisher which is
csv format
uses semicolon as the delimiter
no column header
Note that the report is scheduled.
I always get the data like this
GL_ACCOUNT_CODE;GL_ACCOUNT_DESCRIPTION;REPORTING_CODE;REPORTING_DESCRIPTION;ACCOUNT_TYPE;START_DATE;END_DATE
208000;"SITES INTERNET";208000;"208000 desctest";Asset;;
101000;CAPITAL;;;"Owner's Equity";;
218300;"MATERIEL DE BUREAU ET INFO. ST DENIS";;;Asset;;
205000;"CONCESSIONS ET DROITS SIMILAIRES";;;Asset;;
but i just want the data, not the column headers, like this
208000;"SITES INTERNET";208000;"208000 desctest";Asset;;
101000;CAPITAL;;;"Owner's Equity";;
218300;"MATERIEL DE BUREAU ET INFO. ST DENIS";;;Asset;;
205000;"CONCESSIONS ET DROITS SIMILAIRES";;;Asset;;
I tried to use an eText template, but it only returns 0's and question marks. Can you please analyze my template. Thank you.
Format Setup:
<TEMPLATE TYPE> DELIMITER_BASED
<OUTPUT CHARACTER SET> iso-8859-1
<NEW RECORD CHARACTER> Carriage Return
Format Data Records:
<LEVEL> DATA_DS
<NEW RECORD> G_1
<MAXIMUM LENGTH> <FORMAT> <DATA> <COMMENTS>
99 Number ‘GL_ACCOUNT_CODE’
1 Alpha `;` Delimiter
99 Alpha ‘GL_ACCOUNT_DESCRIPTION’
1 Alpha `;` Delimiter
99 Alpha ‘ACCOUNT_TYPE’
1 Alpha `;` Delimiter
99 Number ‘REPORTING_DESCRIPTION’
1 Alpha `;` Delimiter
<END LEVEL> G_1
<END LEVEL> DATA_DS
You can use a eText template to achieve your requirement. See documentation here https://docs.oracle.com/cd/E28280_01/bi.1111/e22254/create_etext_tmpl.htm#BIPRD2908

Talend Convert string to Float

I am using Talend to make an ETL project.
To convert my string to Double, i use Float.parseFloat(row4.Exportation2.trim())
This the error that it gives me.
This is how my data looks like "766,9997474" "1 345,43" in the exportation2
Does anyone have an idea why ?
Démarrage du job ConvertString a 14:03 27/01/2017.
Exception in component tMap_1
java.lang.NumberFormatException: For input string: "23,4897452"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at sun.misc.FloatingDecimal.parseDouble(Unknown Source)
at java.lang.Double.parseDouble(Unknown Source)
at last.convertstring_0_1.ConvertString.tFileInputDelimited_1Process(ConvertString.java:1553)
at last.convertstring_0_1.ConvertString.runJobInTOS(ConvertString.java:2075)
at last.convertstring_0_1.ConvertString.main(ConvertString.java:1932)
[statistics] connecting to socket on port 3464
[statistics] connected
6|Royaume-Uni|BA|1971|23,4897452
[statistics] disconnected
Job ConvertString terminé à 14:03 27/01/2017. [Code sortie=1]
Multiple problems here :
If you want to convert from String to Double you should use Double.parseDouble().
"," is not the expected char : it should be "." :
You will have to convert "," char to "." char : if your input comes from an excel or delimited file, you can set this option on the advanced settings of tFileInput component ("advanced separator"). Otherwise you should use yourString.replaceAll(",", "."))
there is a non-standard space in the String that you should replace with yourString.replaceAll(" ", ""))
To do so u can use so many fucntions in t_Map :
columnValue = columnValue.replaceAll("\\W","");
\w = Anything that is a word character
\W = Anything that isn't a word character (including punctuation etc)
\s = Anything that is a space character (including space, tab characters etc)
`\S = Anything that isn't a space character (including both letters and numbers, as well as punctuation etc)
or if u want to ignore any thing other then a letter or a number u can use simply :
.replaceAll("[^a-zA-Z0-9]", "")

ZPL/Zebra Printer not catching new line?

I am passing a ZPL code to a Zebra printer. And in this ZPL code, I have a portion where it will generate a QR Code. The QR Code's value is from string that I got from using a barcode scanning function in the mobile app im developing for WM6.5.
The string result from the scan looks like this:
Name:John Smith
Gender:Male
Position:Developer
I need to pass this string to a datagrid. So I parse it line by line via "\n" or environment new line. passing it to the datagrid is ok. But when I print out the string result to a QR Code on a Zebra printer. It seems like the new lines are not being included in the QR Code.
If you want to pass in non-printable characters, use the ^FH command to pass it in as a hex value
^XA
^FO100,100
^AD^FH
^FDTilde _7e used for hex^FS
^XZ
This will print out a ~ instead of _7e
ISO-8859-1 encoding characters
HTML OCTL HEX CMP CHR MEANING
------ + ---- + --- + --- + --- + ------------------------------
| \012 | =0A | | | Line feed (ASCII NL, newline)
Use 0x0A instead of \n ?

Resources