This is a migrated thread and some comments may be shown as answers.

Tab (ascii 9) being collapsed when printing output

8 Answers 299 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kali
Top achievements
Rank 1
Kali asked on 23 Aug 2016, 02:55 PM

Hi admin,

I'm using telerik reporting 2015 Q2 on a WPF project. A textbox in the report may contains tab characters for formatting a remarks field. On the print preview the tab characters are there and you will see the value of remarks field formatted by tab characters. But when producing print output, the tab characters are not there anymore. This also happens when I try to export the print preview to any format (PDF, Excel, Word, etc.)

 

Help is much appreciated. 

Thank you!

8 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 26 Aug 2016, 11:43 AM
Hi Kali,

Please test escaping the tab input with 	. Further suggestions can be found in my colleague's post in Text field does not interpret "Tab" (ascii 9) character in string data.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Kali
Top achievements
Rank 1
answered on 27 Aug 2016, 05:38 PM

This doesn't fix the problem, it will have problem also on the print preview side as the spacing of tabs are different. 

I replaced the \t to &#09 and still doesn't work.

0
Kali
Top achievements
Rank 1
answered on 27 Aug 2016, 05:47 PM

Here are my test print preview screen and the output whenever I print or extract this tab indented report.

Thank you!

0
Stef
Telerik team
answered on 29 Aug 2016, 01:22 PM
Hello Kali,

Please share the code generating the report (the report's designer.cs|vb's or TRDX file's content). Include also the string input of the HtmlTextBox and TextBox items.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Kali
Top achievements
Rank 1
answered on 18 Sep 2016, 09:26 AM

Hi Stef, 

The value of the TextBox is "CALIBRATION OF INJECTION PUMP/INJECTOR OF  STAKE TRUCK (ST-09)\r\nA. INJECTION PUMP\r\n10 pcs.\tPlunger and barrel @ 2,400.00\t\t24,000.00\r\n10 pcs.  \tDelivery valve \t@ 1,200.00\t\t12,000.00\r\n10 pcs.  \tDelivery valve gasket  50.00\t\t     500.00\r\n 2 pcs.   \tCamshaft bearing\t @   950.00\t\t  1,900.00\r\n 1 pc.     \tCamshaft oil seal big @\t\t\t     750.00\r\n 1 pc.\tPiston\t\t\t\t\t     175.00\r\n 1 pc.\tFeed pump oil seal small @550.00\t\t     550.00\r\n1 set \tFeed pump kit\t\t\t\t     720.00\r\n1 set \tRepair kit\t\t\t\t  1,800.00\r\n1 lot\tPull out and installation\t\t\t     800.00\r\nLabor for overhauling & calibration\t\t\t  1,000.00\r\nB. INJECTOR\r\n10 pc.s\tNozzle tips\t@2,400.00\t\t24,000.00\r\n10 pcs.\tInjector labor\t@ 100.00\t\t  1,000.00\r\n\t\tTOTAL AMOUNT\t\t\t69,195.00\r\n\t\tLESS: 20% DISCOUNT\t\t13,839.00\r\n\t\tTOTAL AMOUNT\t\t\t55,356.00\r\n\t\tAdd 12% VAT\t\t\t  6,642.72\r\n\t\tTOTAL AMOUNT\t\t\t61,998.72\r\n\t\tLess: Addtl. discount\t\t  3,998.72\r\n\t\tDISCOUNTED AMOUNT\t\t58,000.00\r\n\r\nTERMS OF PAYMENT : 30 DAYS PDC UPON DELIVERY\r\n"

By testing this scenarios, all sections of the report has problems with the output having tab character (\t)

to show this report, I made a report viewer window (derived to window class) and have the code below to display inside the report viewer

InstanceReportSource instanceReportSource = new InstanceReportSource() { ReportDocument = (Telerik.Reporting.Report)reportSource };

            rptViewer.ViewMode = Telerik.ReportViewer.Wpf.ViewMode.PrintPreview;
            rptViewer.ReportSource = instanceReportSource;

 

Thanks for your reply!

 

 

0
Stef
Telerik team
answered on 21 Sep 2016, 03:48 PM
Hello Kali,

I misled you with my first post, the replacement must be an exact string consisting of empty spaces  as
the Tab character does not have a determined size and it will not be interpreted. 

In this case, the provided input does not replace the Tab characters.
Please use a custom function, the Replace function, Replace method to place empty spaces or other at the place of the controlling character.


For more details check the post in Text field does not interpret "Tab" (ascii 9) character in string data.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Kali
Top achievements
Rank 1
answered on 24 Sep 2016, 01:43 PM

Hi Stef, 

Thanks for the reply. I did this custom function that you linked to me but the problem is tab doesn't have a fixed number of spaces and this also ruined the tab formatted text. 

Can you please explain why is it the tab formatted text is fine during the preview of report but when printed or exported its now ruined. 

Thank you so much for your help!

0
Stef
Telerik team
answered on 27 Sep 2016, 11:16 AM
Hi Kali,

The reason is that the \t character is a control character without a fixed value for empty space. It is media dependent. If you replace the character with a fixed length string, the content should be rendered similarly in different media.

If after replacing the \t character with a printable character or a whole string does not result in properly formatted content, please elaborate in which formats the result is different and how.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Kali
Top achievements
Rank 1
Answers by
Stef
Telerik team
Kali
Top achievements
Rank 1
Share this question
or