Special Characters displayed incorrectly in print preview

Originally Posted 18 April 2017, 2:56 pm EST

  • Originally Posted 18 April 2017, 2:56 pm EST

    Special characters, like, degree, diameter, plus-minus are show correctly in the grid view but when I do a print preview, they show as small squares. How can I get it to show up correctly on the print preview as well? I'm on v2.

    These show up correct in the dridview:

    const char centerline = (char)0x2104;
    const char degree = (char)176;
    const char diameter = (char)0x2205;
    const char plate = (char)0x214A;
    const char plusminus = (char)177;


    Here is the other part of the code:

    http://helpcentral.componentone.com/nethelp/c1truedbgrid/tutorial15usingprint.html
    Font fntFont;
    fntFont = new Font(
    dgvEBOM2.PrintInfo.PageHeaderStyle.Font.Name,
    dgvEBOM2.PrintInfo.PageHeaderStyle.Font.Size,
    FontStyle.Italic);

    dgvEBOM2.PrintInfo.PageHeaderStyle.Font = fntFont;


    dgvEBOM2.PrintInfo.WrapText = PrintInfo.WrapTextEnum.Wrap;

    dgvEBOM2.PrintInfo.PageSettings.Landscape = true;

    // Column headers will be on every page.
    dgvEBOM2.PrintInfo.RepeatColumnHeaders = true;

    // Invoke print preview.
    dgvEBOM2.PrintInfo.UseGridColors = true;

    dgvEBOM2.PrintInfo.PrintPreview();
  • Reply

    Hi William,

    I am sorry to mention but I could not reproduce the issue at my end. Special Characters are reflected properly when C1TrueDBGrid is print previewed. Please refer the attached application demonstrating the same.

    You can either modify my application or provide your own stripped down sample so that I can reproduce the same behaviour at my end and assist you further accordingly.

    Thanks,
    Pragati
    2017/04/prj_TDBSpecialCharacters.rar
  • Reply

    Your example works as it should on my end but there is a difference, we are currently on version 2 of the ComponentOne libraries whereas the example that you sent me is based on version 4.
  • Reply

    I figured out the problem..... "Some-what" I was formatting the grids cell font to use Arial and the characters would not show (in the PrintPreview) with this font, I then changed the font to "Microsoft Sans Serif" and the characters are now showing as they should. This still does not explain why the characters are displayed correctly in the DGV but not in the PrintPreview. See the attached project, it's a modified version of what you sent me because I made as close to my situation as possible. Run it as is then change the font to Arial so that you can see what I mean.
    2017/04/prj_TDBSpecialCharacters1.rar
  • Reply

    Hi William,

    Thank you for sharing the project.
    I could replicate the issue at my end as well. I have escalated it to the development team (internal tracking ID: 253878) and will let you know once there is any information from them.

    Warm Regards,
    Pragati
  • Marked as Answer

    Reply

    Hi William,

    Please note, C1TrueDBGrid uses C1Report for printing. The problem is the Font specified does not have the special characters used in the sample. To prove this, you can open windows tool character map and search the codes.

    C1Report uses different system API for drawing from the grid. It uses EMF+ at the time grid uses GDI/GDI+.
    It seems like GDI can do font substitution for absent symbols and EMF+ cannot.

    Therefore, this is a limitation. I would suggest to use only symbols presented in the specified font.

    Thanks,
    Pragati
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels