Tab (ascii 9) being collapsed when printing output

9 posts, 0 answers
  1. Kali
    Kali avatar
    5 posts
    Member since:
    Aug 2016

    Posted 23 Aug Link to this post

    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!

  2. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 26 Aug Link to this post

    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
  3. DevCraft banner
  4. Kali
    Kali avatar
    5 posts
    Member since:
    Aug 2016

    Posted 27 Aug Link to this post

    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.

  5. Kali
    Kali avatar
    5 posts
    Member since:
    Aug 2016

    Posted 27 Aug in reply to Kali Link to this post

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

    Thank you!

  6. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 29 Aug Link to this post

    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
  7. Kali
    Kali avatar
    5 posts
    Member since:
    Aug 2016

    Posted 18 Sep in reply to Stef Link to this post

    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!

     

     

  8. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 21 Sep Link to this post

    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
  9. Kali
    Kali avatar
    5 posts
    Member since:
    Aug 2016

    Posted 24 Sep in reply to Stef Link to this post

    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!

  10. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 27 Sep Link to this post

    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
Back to Top
DevCraft banner