print out from grid array with graphic and ccsid(1200)

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
m400mail
New User
Posts: 13
Joined: Wed Nov 19, 2014 3:39 am
First Name: Michael
Last Name: Krautscheid
Company Name: asMika
Contact:

print out from grid array with graphic and ccsid(1200)

Post by m400mail »

Hello to all

i have a grid with a tooltip. this tooltip is defined as graphic Field with 15000 and ccsid(1200)
i must print this. i have the following Javascript:

printSelectedReports();

function printSelectedReports() {
alert('start');

var griddata = getObj("Grid01").grid.getAllDataValues(true);

var printWindow = window.open("", "", 'left=50,top=50,width=1200,height=800');
printWindow.document.write("<h1> <p>BOHLE Report</p> </h1>");

printWindow.document.write( '<font size="8" face="Courier" >');
// Grid lesen und drucken

for (var i=0; i<griddata.length; i++) {
//******************************************************************
// print if checkbox on
//******************************************************************
if (griddata.CHECKBOX == '1' )
{
var aHeader = griddata.FLD001 + ' ' + griddata.FLD002 + '<br><br>';
printWindow.document.write(aHeader);

//******************************************************************
// print Text ( Textarea / variable Tooltip )
//******************************************************************
var atextvalue = griddata.IMGTOOLTIP + '<br> <br>' ;
printWindow.document.write(atextvalue);

//var atextvalue2 = griddata.FLD003 + '<br> <br>' ;
//printWindow.document.write(atextvalue2);

//******************************************************************
// Ende Kennzeichen
//******************************************************************
var aEndText = '---------------------------------------------------------------<br>';
printWindow.document.write(aEndText);
}
}
//printWindow.document.write( '</font');

printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();

}

The variable atextvalue shows this characters
image01.PNG
image01.PNG (110.37 KiB) Viewed 414 times
Does anyone have an idea how to print via Javascript graphic variables?
User avatar
matt.denninghoff
Profound Logic Staff Member
Posts: 115
Joined: Wed Feb 10, 2016 3:53 pm
First Name: Matthew
Last Name: Denninghoff
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: print out from grid array with graphic and ccsid(1200)

Post by matt.denninghoff »

Data from graphic fields are encoded in Base64 strings to prevent the HTTP server from trans-coding the original character's incorrectly. When Profound UI JavaScript reads the Base64-encoded graphic field data, then Profound UI decodes the Base64 string into a Unicode character string.

To read the raw grid data as you are attempting, you must decode the Base64 string. You can use the Base64-decoding function on the open-source version of the Profound UI framework, found here:
https://github.com/ProfoundLogic/profou ... pi.js#L915
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests